2222
2323include $(APPDIR ) /Make.defs
2424
25+ # BAS configuration
2526BAS_UNPACKNAME = BAS
2627BAS_HASH = 9f74a2f778b002ad8441471b8a7a5b13172dbe76
28+ BAS_REPO_URL = https://github.com/RealTimeLogic/BAS.git
29+
30+ # BAS-Resources configuration
2731BAS_RESOURCES_UNPACKNAME = BAS-Resources
2832BAS_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
3234
3335XEDGEZIP = BAS/examples/xedge/XedgeZip.c
3436
@@ -47,49 +49,35 @@ VPATH += $(BAS_UNPACKNAME)/examples/xedge
4749
4850CSRCS = BAS.c dlmalloc.c ThreadLib.c SoDisp.c BaFile.c xedge.c XedgeZip.c
4951
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/ && \
8168 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 )
8472
8573$(CSRCS:.c =$(OBJEXT ) ): xedge-deps
8674
8775ifeq ($(wildcard $(BAS_UNPACKNAME ) /.git) ,)
88- distclean :: xedge-deps
89- $(call DELDIR, $(BAS_UNPACKNAME ) )
90- $(call DELDIR, $(BAS_RESOURCES_UNPACKNAME ) )
91-
9276context :: xedge-deps
9377endif
9478
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