Skip to content

Commit

Permalink
contiki/Makefile: Add in Contiki version check
Browse files Browse the repository at this point in the history
Set to release/v4.9
  • Loading branch information
mrdeep1 committed Aug 7, 2023
1 parent 3f8bb33 commit 4b845c2
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion examples/contiki/Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 4b845c2

Please sign in to comment.