22
22
23
23
include $(APPDIR ) /Make.defs
24
24
25
+ # BAS configuration
25
26
BAS_UNPACKNAME = BAS
26
27
BAS_HASH = 9f74a2f778b002ad8441471b8a7a5b13172dbe76
28
+ BAS_REPO_URL = https://github.com/RealTimeLogic/BAS.git
29
+
30
+ # BAS-Resources configuration
27
31
BAS_RESOURCES_UNPACKNAME = BAS-Resources
28
32
BAS_RESOURCES_HASH = 227a4b998300fa4cfde871dc7dac92c09e1636c2
29
-
30
- BAS_ZIP_URL = https://github.com/RealTimeLogic/BAS/archive/$(BAS_HASH ) .zip
31
- BAS_RESOURCES_ZIP_URL = https://github.com/RealTimeLogic/BAS-Resources/archive/$(BAS_RESOURCES_HASH ) .zip
33
+ BAS_RESOURCES_REPO_URL = https://github.com/RealTimeLogic/BAS-Resources.git
32
34
33
35
XEDGEZIP = BAS/examples/xedge/XedgeZip.c
34
36
@@ -47,49 +49,35 @@ VPATH += $(BAS_UNPACKNAME)/examples/xedge
47
49
48
50
CSRCS = BAS.c dlmalloc.c ThreadLib.c SoDisp.c BaFile.c xedge.c XedgeZip.c
49
51
50
- # Download and prepare BAS and BAS-Resources
51
- xedge-deps :
52
- # ############################################################################
53
- # Config and Fetch xedge
54
- # ############################################################################
55
-
56
- @if [ ! -d $(BAS_UNPACKNAME) ]; then \
57
- echo "Downloading BAS from hash $(BAS_HASH)..."; \
58
- curl -f -L $(BAS_ZIP_URL) -o bas-temp.zip || \
59
- (echo "Error downloading BAS"; exit 1); \
60
- unzip -q bas-temp.zip; \
61
- mv BAS-$(BAS_HASH) $(BAS_UNPACKNAME); \
62
- rm -f bas-temp.zip; \
63
- fi
64
-
65
- @if [ ! -d $(BAS_RESOURCES_UNPACKNAME) ]; then \
66
- echo "Downloading BAS-Resources from hash $(BAS_RESOURCES_HASH)..."; \
67
- curl -f -L $(BAS_RESOURCES_ZIP_URL) -o resources-temp.zip || \
68
- (echo "Error downloading BAS-Resources"; exit 1); \
69
- unzip -q resources-temp.zip; \
70
- mv BAS-Resources-$(BAS_RESOURCES_HASH) $(BAS_RESOURCES_UNPACKNAME); \
71
- rm -f resources-temp.zip; \
72
- fi
73
-
74
- # ############################################################################
75
- # Library Configuration
76
- # ############################################################################
77
-
78
- @if [ ! -f "$(XEDGEZIP)" ]; then \
79
- echo "Creating XedgeZip.c"; \
80
- cd $(BAS_RESOURCES_UNPACKNAME)/build/ && \
52
+ # Clone and setup BAS repository
53
+ $(BAS_UNPACKNAME ) :
54
+ $(Q ) echo " Cloning BAS repository..."
55
+ $(Q ) git clone $(BAS_REPO_URL ) $(BAS_UNPACKNAME )
56
+ $(Q ) cd $(BAS_UNPACKNAME ) && git checkout $(BAS_HASH )
57
+
58
+ # Clone and setup BAS-Resources repository
59
+ $(BAS_RESOURCES_UNPACKNAME ) :
60
+ $(Q ) echo " Cloning BAS-Resources repository..."
61
+ $(Q ) git clone $(BAS_RESOURCES_REPO_URL ) $(BAS_RESOURCES_UNPACKNAME )
62
+ $(Q ) cd $(BAS_RESOURCES_UNPACKNAME ) && git checkout $(BAS_RESOURCES_HASH )
63
+
64
+ # Create XedgeZip.c
65
+ $(XEDGEZIP ) : $(BAS_UNPACKNAME ) $(BAS_RESOURCES_UNPACKNAME )
66
+ $(Q ) echo " Creating XedgeZip.c..."
67
+ $(Q ) cd $(BAS_RESOURCES_UNPACKNAME ) /build/ && \
81
68
printf " n\nl\nn\n" | bash Xedge.sh > /dev/null && \
82
- cp XedgeZip.c ../../$(BAS_UNPACKNAME)/examples/xedge/ || exit 1; \
83
- fi
69
+ cp XedgeZip.c ../../$(BAS_UNPACKNAME ) /examples/xedge/
70
+
71
+ xedge-deps : $(XEDGEZIP )
84
72
85
73
$(CSRCS:.c =$(OBJEXT ) ): xedge-deps
86
74
87
75
ifeq ($(wildcard $(BAS_UNPACKNAME ) /.git) ,)
88
- distclean :: xedge-deps
89
- $(call DELDIR, $(BAS_UNPACKNAME ) )
90
- $(call DELDIR, $(BAS_RESOURCES_UNPACKNAME ) )
91
-
92
76
context :: xedge-deps
93
77
endif
94
78
95
- include $(APPDIR ) /Application.mk
79
+ include $(APPDIR ) /Application.mk
80
+
81
+ distclean ::
82
+ $(call DELDIR, $(BAS_UNPACKNAME ) )
83
+ $(call DELDIR, $(BAS_RESOURCES_UNPACKNAME ) )
0 commit comments