mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-19 02:17:37 +08:00
netutils/xedge: refactor Makefile to use git clone instead of zip downloads
Previous zip-based approach was failing in CI environment. Changed to use git clone with specific commit hashes to resolve CI build issues. Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
This commit is contained in:

committed by
Alan C. Assis

parent
caefd0de9f
commit
c19c2a71f3
@@ -22,13 +22,15 @@
|
|||||||
|
|
||||||
include $(APPDIR)/Make.defs
|
include $(APPDIR)/Make.defs
|
||||||
|
|
||||||
|
# BAS configuration
|
||||||
BAS_UNPACKNAME = BAS
|
BAS_UNPACKNAME = BAS
|
||||||
BAS_HASH = 9f74a2f778b002ad8441471b8a7a5b13172dbe76
|
BAS_HASH = 9f74a2f778b002ad8441471b8a7a5b13172dbe76
|
||||||
|
BAS_REPO_URL = https://github.com/RealTimeLogic/BAS.git
|
||||||
|
|
||||||
|
# BAS-Resources configuration
|
||||||
BAS_RESOURCES_UNPACKNAME = BAS-Resources
|
BAS_RESOURCES_UNPACKNAME = BAS-Resources
|
||||||
BAS_RESOURCES_HASH = 227a4b998300fa4cfde871dc7dac92c09e1636c2
|
BAS_RESOURCES_HASH = 227a4b998300fa4cfde871dc7dac92c09e1636c2
|
||||||
|
BAS_RESOURCES_REPO_URL = https://github.com/RealTimeLogic/BAS-Resources.git
|
||||||
BAS_ZIP_URL = https://github.com/RealTimeLogic/BAS/archive/$(BAS_HASH).zip
|
|
||||||
BAS_RESOURCES_ZIP_URL = https://github.com/RealTimeLogic/BAS-Resources/archive/$(BAS_RESOURCES_HASH).zip
|
|
||||||
|
|
||||||
XEDGEZIP = BAS/examples/xedge/XedgeZip.c
|
XEDGEZIP = BAS/examples/xedge/XedgeZip.c
|
||||||
|
|
||||||
@@ -47,49 +49,35 @@ VPATH += $(BAS_UNPACKNAME)/examples/xedge
|
|||||||
|
|
||||||
CSRCS = BAS.c dlmalloc.c ThreadLib.c SoDisp.c BaFile.c xedge.c XedgeZip.c
|
CSRCS = BAS.c dlmalloc.c ThreadLib.c SoDisp.c BaFile.c xedge.c XedgeZip.c
|
||||||
|
|
||||||
# Download and prepare BAS and BAS-Resources
|
# Clone and setup BAS repository
|
||||||
xedge-deps:
|
$(BAS_UNPACKNAME):
|
||||||
# ############################################################################
|
$(Q) echo "Cloning BAS repository..."
|
||||||
# Config and Fetch xedge
|
$(Q) git clone $(BAS_REPO_URL) $(BAS_UNPACKNAME)
|
||||||
# ############################################################################
|
$(Q) cd $(BAS_UNPACKNAME) && git checkout $(BAS_HASH)
|
||||||
|
|
||||||
@if [ ! -d $(BAS_UNPACKNAME) ]; then \
|
# Clone and setup BAS-Resources repository
|
||||||
echo "Downloading BAS from hash $(BAS_HASH)..."; \
|
$(BAS_RESOURCES_UNPACKNAME):
|
||||||
curl -f -L $(BAS_ZIP_URL) -o bas-temp.zip || \
|
$(Q) echo "Cloning BAS-Resources repository..."
|
||||||
(echo "Error downloading BAS"; exit 1); \
|
$(Q) git clone $(BAS_RESOURCES_REPO_URL) $(BAS_RESOURCES_UNPACKNAME)
|
||||||
unzip -q bas-temp.zip; \
|
$(Q) cd $(BAS_RESOURCES_UNPACKNAME) && git checkout $(BAS_RESOURCES_HASH)
|
||||||
mv BAS-$(BAS_HASH) $(BAS_UNPACKNAME); \
|
|
||||||
rm -f bas-temp.zip; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
@if [ ! -d $(BAS_RESOURCES_UNPACKNAME) ]; then \
|
# Create XedgeZip.c
|
||||||
echo "Downloading BAS-Resources from hash $(BAS_RESOURCES_HASH)..."; \
|
$(XEDGEZIP): $(BAS_UNPACKNAME) $(BAS_RESOURCES_UNPACKNAME)
|
||||||
curl -f -L $(BAS_RESOURCES_ZIP_URL) -o resources-temp.zip || \
|
$(Q) echo "Creating XedgeZip.c..."
|
||||||
(echo "Error downloading BAS-Resources"; exit 1); \
|
$(Q) cd $(BAS_RESOURCES_UNPACKNAME)/build/ && \
|
||||||
unzip -q resources-temp.zip; \
|
|
||||||
mv BAS-Resources-$(BAS_RESOURCES_HASH) $(BAS_RESOURCES_UNPACKNAME); \
|
|
||||||
rm -f resources-temp.zip; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ############################################################################
|
|
||||||
# Library Configuration
|
|
||||||
# ############################################################################
|
|
||||||
|
|
||||||
@if [ ! -f "$(XEDGEZIP)" ]; then \
|
|
||||||
echo "Creating XedgeZip.c"; \
|
|
||||||
cd $(BAS_RESOURCES_UNPACKNAME)/build/ && \
|
|
||||||
printf "n\nl\nn\n" | bash Xedge.sh > /dev/null && \
|
printf "n\nl\nn\n" | bash Xedge.sh > /dev/null && \
|
||||||
cp XedgeZip.c ../../$(BAS_UNPACKNAME)/examples/xedge/ || exit 1; \
|
cp XedgeZip.c ../../$(BAS_UNPACKNAME)/examples/xedge/
|
||||||
fi
|
|
||||||
|
xedge-deps: $(XEDGEZIP)
|
||||||
|
|
||||||
$(CSRCS:.c=$(OBJEXT)): xedge-deps
|
$(CSRCS:.c=$(OBJEXT)): xedge-deps
|
||||||
|
|
||||||
ifeq ($(wildcard $(BAS_UNPACKNAME)/.git),)
|
ifeq ($(wildcard $(BAS_UNPACKNAME)/.git),)
|
||||||
distclean:: xedge-deps
|
|
||||||
$(call DELDIR, $(BAS_UNPACKNAME))
|
|
||||||
$(call DELDIR, $(BAS_RESOURCES_UNPACKNAME))
|
|
||||||
|
|
||||||
context:: xedge-deps
|
context:: xedge-deps
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include $(APPDIR)/Application.mk
|
include $(APPDIR)/Application.mk
|
||||||
|
|
||||||
|
distclean::
|
||||||
|
$(call DELDIR, $(BAS_UNPACKNAME))
|
||||||
|
$(call DELDIR, $(BAS_RESOURCES_UNPACKNAME))
|
Reference in New Issue
Block a user