From b2810f02e127960771afaa425c174b5dafe6076c Mon Sep 17 00:00:00 2001 From: oliverschmidt Date: Mon, 26 May 2008 07:37:24 +0000 Subject: [PATCH] Many project Makefiles build just one Contiki binary. Up to now the name of this binary was only available to the 'all' goal as prerequisite. So it was possible to create a non-project-specific rule to i.e. load that binary into the target device. Therefore I introduced the make variable CONTIKI_PROJECT. Now a typical project Makefile starts with: CONTIKI_PROJECT = hello-world all: $(CONTIKI_PROJECT) --- examples/esb/Makefile | 11 +++++------ examples/hello-world/Makefile | 5 +++-- examples/multi-threading/Makefile | 5 +++-- examples/sky-ip/Makefile | 11 +++++++---- examples/sky-shell/Makefile | 9 ++++++--- examples/telnet-server/Makefile | 8 +++++--- examples/test-ipv6/Makefile | 10 ++++++---- examples/webbrowser/Makefile | 8 +++++--- examples/webserver/Makefile | 8 +++++--- 9 files changed, 45 insertions(+), 30 deletions(-) diff --git a/examples/esb/Makefile b/examples/esb/Makefile index 5bc3d8e12..4da37e3c6 100644 --- a/examples/esb/Makefile +++ b/examples/esb/Makefile @@ -1,8 +1,7 @@ +CONTIKI_PROJECT = blinker +all: $(CONTIKI_PROJECT) + +DEFAULT_TARGET = esb + CONTIKI = ../.. -ifndef TARGET -TARGET=esb -endif - -all: blinker - include $(CONTIKI)/Makefile.include diff --git a/examples/hello-world/Makefile b/examples/hello-world/Makefile index 8a3aa723d..0a79167ae 100644 --- a/examples/hello-world/Makefile +++ b/examples/hello-world/Makefile @@ -1,4 +1,5 @@ -CONTIKI = ../.. -all: hello-world +CONTIKI_PROJECT = hello-world +all: $(CONTIKI_PROJECT) +CONTIKI = ../.. include $(CONTIKI)/Makefile.include diff --git a/examples/multi-threading/Makefile b/examples/multi-threading/Makefile index e645bc725..c6371bafa 100644 --- a/examples/multi-threading/Makefile +++ b/examples/multi-threading/Makefile @@ -1,4 +1,5 @@ -CONTIKI = ../.. -all: multi-threading +CONTIKI_PROJECT = multi-threading +all: $(CONTIKI_PROJECT) +CONTIKI = ../.. include $(CONTIKI)/Makefile.include diff --git a/examples/sky-ip/Makefile b/examples/sky-ip/Makefile index 3ed7a69e7..b9c26c6d8 100644 --- a/examples/sky-ip/Makefile +++ b/examples/sky-ip/Makefile @@ -1,7 +1,10 @@ -all: telnet-webserver -APPS=telnetd webserver -DEFAULT_TARGET=sky -CFLAGS=-DWITH_UIP=1 #-DWITH_NULLMAC=1 +CONTIKI_PROJECT = telnet-webserver +all: $(CONTIKI_PROJECT) + +APPS = telnetd webserver +DEFAULT_TARGET = sky + +CFLAGS = -DWITH_UIP=1 #-DWITH_NULLMAC=1 # The webserver application normally contains a built-in file system and support # for server-side includes. diff --git a/examples/sky-shell/Makefile b/examples/sky-shell/Makefile index aeedfc46b..69a5a7334 100644 --- a/examples/sky-shell/Makefile +++ b/examples/sky-shell/Makefile @@ -1,7 +1,10 @@ +CONTIKI_PROJECT = sky-shell +all: $(CONTIKI_PROJECT) + +APPS = shell +DEFAULT_TARGET = sky + CONTIKI = ../.. -APPS=shell -DEFAULT_TARGET=sky -all: sky-shell ifdef MOTE login: diff --git a/examples/telnet-server/Makefile b/examples/telnet-server/Makefile index 669561077..e369dd60a 100644 --- a/examples/telnet-server/Makefile +++ b/examples/telnet-server/Makefile @@ -1,6 +1,8 @@ -all: telnet-server -APPS=telnetd program-handler -DEFAULT_TARGET=minimal-net +CONTIKI_PROJECT = telnet-server +all: $(CONTIKI_PROJECT) + +APPS = telnetd program-handler +DEFAULT_TARGET = minimal-net CONTIKI = ../.. include $(CONTIKI)/Makefile.include diff --git a/examples/test-ipv6/Makefile b/examples/test-ipv6/Makefile index d3eb1dea6..95dffd5e4 100644 --- a/examples/test-ipv6/Makefile +++ b/examples/test-ipv6/Makefile @@ -1,7 +1,9 @@ -all: testv6 -APPS=webserver -DEFAULT_TARGET=minimal-net -CFLAGS=-DUIP_CONF_IPV6 +CONTIKI_PROJECT = testv6 +all: $(CONTIKI_PROJECT) + +APPS = webserver +DEFAULT_TARGET = minimal-net +CFLAGS = -DUIP_CONF_IPV6 CONTIKI = ../.. include $(CONTIKI)/Makefile.include diff --git a/examples/webbrowser/Makefile b/examples/webbrowser/Makefile index 6bfc33189..02002d728 100644 --- a/examples/webbrowser/Makefile +++ b/examples/webbrowser/Makefile @@ -1,6 +1,8 @@ -all: webbrowser -APPS=webbrowser -DEFAULT_TARGET=win32 +CONTIKI_PROJECT = webbrowser +all: $(CONTIKI_PROJECT) + +APPS = webbrowser +DEFAULT_TARGET = win32 CONTIKI = ../.. include $(CONTIKI)/Makefile.include diff --git a/examples/webserver/Makefile b/examples/webserver/Makefile index b54952784..8b95d9104 100644 --- a/examples/webserver/Makefile +++ b/examples/webserver/Makefile @@ -1,6 +1,8 @@ -all: webserver-example -APPS=webserver -DEFAULT_TARGET=minimal-net +CONTIKI_PROJECT = webserver-example +all: $(CONTIKI_PROJECT) + +APPS = webserver +DEFAULT_TARGET = minimal-net # The webserver application normally contains a built-in file system and support # for server-side includes.