File: Makefile

package info (click to toggle)
libcoap3 4.3.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,368 kB
  • sloc: ansic: 60,037; makefile: 1,280; sh: 938; python: 6
file content (39 lines) | stat: -rw-r--r-- 1,256 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
CONTIKI=contiki-ng
TARGET?=native

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

clean:
	$(MAKE) -f Makefile.contiki CONTIKI=$(CONTIKI) TARGET=$(TARGET) clean
	rm -rf build

distclean:
	$(MAKE) -f Makefile.contiki CONTIKI=$(CONTIKI) TARGET=$(TARGET) distclean

viewconf:
	$(MAKE) -f Makefile.contiki CONTIKI=$(CONTIKI) TARGET=$(TARGET) viewconf