contiki/Makefile: Add in Contiki version check

Set to release/v4.9
This commit is contained in:
Jon Shallow authored and Jon Shallow committed 2023-08-07 14:01:28 +01:00
1 parent 65f0be894e
commit ef943c93a8
1 file changed
+19 -1
+19 -1
View File
@@ -1,12 +1,30 @@
CONTIKI=contiki-ng
TARGET?=native
all: server
WITH_CONTIKI_NG_BRANCH=release/v4.9
all: $(CONTIKI) check-version server
$(CONTIKI):
git clone --depth 1 https://github.com/contiki-ng/contiki-ng.git $@
echo "Updating $(CONTIKI) to ${WITH_CONTIKI_NG_BRANCH}"
(cd ${CONTIKI} ; git pull --tags 2> /dev/null ; git checkout ${WITH_CONTIKI_NG_BRANCH})
cd $(CONTIKI)/os/net/app-layer && rm -rf libcoap && ln -s ../../../../../.. libcoap
check-version:
@(if [ -d $(CONTIKI) ] ; then \
cd $(CONTIKI) ; \
TAG=`git describe --tags --all`; \
if [ "$$TAG" != ${WITH_CONTIKI_NG_BRANCH} ] ; then \
if [ "$$TAG" != "tags/${WITH_CONTIKI_NG_BRANCH}" ] ; then \
git pull --tags 2> /dev/null ; \
echo "Updating $(CONTIKI) to ${WITH_CONTIKI_NG_BRANCH}" ; \
git checkout ${WITH_CONTIKI_NG_BRANCH} ; \
cd os/net/app-layer && rm -rf libcoap && ln -s ../../../../../.. libcoap ; \
fi ; \
fi ; \
fi)
server: $(CONTIKI)
$(MAKE) -f Makefile.contiki CONTIKI=$(CONTIKI) TARGET=$(TARGET) server