From 81d1b1bd80b0d84582284fdc1edcec54badf3161 Mon Sep 17 00:00:00 2001 From: Simon Duquennoy Date: Tue, 19 Dec 2017 05:29:55 -0800 Subject: [PATCH] PROJECTDIR now turned into modules via MODULES_REL --- Makefile.include | 18 ++++++------------ arch/cpu/arm/common/usb/Makefile.usb | 2 +- examples/coap/Makefile | 4 ++-- .../cc26xx/cc26xx-web-demo/Makefile | 2 +- .../jn516x/rpl/coap-dongle-node/Makefile | 2 +- .../jn516x/rpl/coap-dr1175-node/Makefile | 2 +- .../jn516x/rpl/coap-dr1199-node/Makefile | 2 +- .../platform-specific/jn516x/rpl/node/Makefile | 2 +- .../tsch/simple-sensor-network/node/Makefile | 2 +- .../tsch/tx-power-verification/node/Makefile | 2 +- .../rpl-border-router/Makefile | 2 +- .../jn516x/tsch/uart1-test-node/Makefile | 2 +- .../nrf52dk/coap-demo/Makefile | 2 +- examples/rpl-border-router/Makefile | 8 ++++---- examples/sensniff/Makefile | 2 +- examples/slip-radio/Makefile | 2 +- tools/sky/uip6-bridge/Makefile | 2 +- 17 files changed, 26 insertions(+), 32 deletions(-) diff --git a/Makefile.include b/Makefile.include index c8c9c4597..3bf19bd37 100644 --- a/Makefile.include +++ b/Makefile.include @@ -57,11 +57,7 @@ MODULES += os os/net os/net/mac os/storage oname = ${patsubst %.c,%.o,${patsubst %.S,%.o,$(1)}} CONTIKI_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(CONTIKI_SOURCEFILES)}} - -PROJECT_SOURCEFILES += ${foreach d, $(PROJECTDIRS), ${subst ${d}/,,${wildcard $(d)/*.c}}} PROJECT_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(PROJECT_SOURCEFILES)}} -PROJECT_INCLUDES = ${strip ${wildcard ${foreach d, $(PROJECTDIRS), $(d)/Makefile.${notdir $(d)}}}} --include $(PROJECT_INCLUDES) # Provide way to create $(OBJECTDIR) if it has been removed by make clean $(OBJECTDIR): @@ -166,14 +162,12 @@ else CFLAGS += -DUIP_CONF_IPV6_RPL=0 endif -ifdef MODULES - UNIQUEMODULES = $(call uniq,$(MODULES)) - MODULEDIRS = ${wildcard ${addprefix $(CONTIKI)/, $(UNIQUEMODULES)}} - MODULES_SOURCES = ${foreach d, $(MODULEDIRS), ${subst ${d}/,,${wildcard $(d)/*.c}}} - MODULES_INCLUDES = ${wildcard ${foreach d, $(MODULEDIRS), $(d)/Makefile.${notdir $(d)}}} - include $(MODULES_INCLUDES) - CONTIKI_SOURCEFILES += $(MODULES_SOURCES) -endif +MODULEDIRS = $(MODULES_REL) ${wildcard ${addprefix $(CONTIKI)/, $(MODULES)}} +UNIQUEMODULES = $(call uniq,$(MODULEDIRS)) +MODULES_SOURCES = ${foreach d, $(MODULEDIRS), ${subst ${d}/,,${wildcard $(d)/*.c}}} +MODULES_INCLUDES = ${wildcard ${foreach d, $(MODULEDIRS), $(d)/Makefile.${notdir $(d)}}} +include $(MODULES_INCLUDES) +CONTIKI_SOURCEFILES += $(MODULES_SOURCES) ### Verbosity control. Use make V=1 to get verbose builds. diff --git a/arch/cpu/arm/common/usb/Makefile.usb b/arch/cpu/arm/common/usb/Makefile.usb index 3286ca365..05266cf7b 100644 --- a/arch/cpu/arm/common/usb/Makefile.usb +++ b/arch/cpu/arm/common/usb/Makefile.usb @@ -6,7 +6,7 @@ endif STRUCTGEN = structgen -PROJECTDIRS += $(BUILTSRCDIR) +MODULES_REL += $(BUILTSRCDIR) USB_STRING_DESCRIPTORS ?= $(CONTIKI_CPU_ARM)/common/usb/cdc-acm/string-descriptors.xml diff --git a/examples/coap/Makefile b/examples/coap/Makefile index 8b0cc3b7a..379ffb104 100644 --- a/examples/coap/Makefile +++ b/examples/coap/Makefile @@ -6,9 +6,9 @@ CONTIKI=../.. # build RESTful resources include $(CONTIKI)/Makefile.identify-target ifeq ($(TARGET),native) - PROJECTDIRS += ./resources-plugtest + MODULES_REL += ./resources-plugtest endif -PROJECTDIRS += ./resources +MODULES_REL += ./resources # Include the CoAP implementation MODULES += os/net/app-layer/coap diff --git a/examples/platform-specific/cc26xx/cc26xx-web-demo/Makefile b/examples/platform-specific/cc26xx/cc26xx-web-demo/Makefile index bc8fd02ca..bc024b826 100644 --- a/examples/platform-specific/cc26xx/cc26xx-web-demo/Makefile +++ b/examples/platform-specific/cc26xx/cc26xx-web-demo/Makefile @@ -1,6 +1,6 @@ all: cc26xx-web-demo -PROJECTDIRS += ./resources +MODULES_REL += ./resources PROJECT_SOURCEFILES += cetic-6lbr-client.c coap-server.c net-uart.c mqtt-client.c PROJECT_SOURCEFILES += httpd-simple.c diff --git a/examples/platform-specific/jn516x/rpl/coap-dongle-node/Makefile b/examples/platform-specific/jn516x/rpl/coap-dongle-node/Makefile index 68dfc3104..1b39fbae3 100644 --- a/examples/platform-specific/jn516x/rpl/coap-dongle-node/Makefile +++ b/examples/platform-specific/jn516x/rpl/coap-dongle-node/Makefile @@ -8,7 +8,7 @@ CONTIKI=../../../../.. MAKE_MAC = MAKE_MAC_TSCH MODULES += os/lib/json -PROJECTDIRS += .. ../tools +MODULES_REL += .. ../tools MODULES += os/net/app-layer/coap diff --git a/examples/platform-specific/jn516x/rpl/coap-dr1175-node/Makefile b/examples/platform-specific/jn516x/rpl/coap-dr1175-node/Makefile index 8ff775250..79a7e7f13 100644 --- a/examples/platform-specific/jn516x/rpl/coap-dr1175-node/Makefile +++ b/examples/platform-specific/jn516x/rpl/coap-dr1175-node/Makefile @@ -8,7 +8,7 @@ CONTIKI=../../../../.. MAKE_MAC = MAKE_MAC_TSCH MODULES += os/lib/json -PROJECTDIRS += .. ../tools +MODULES_REL += .. ../tools MODULES += os/net/app-layer/coap diff --git a/examples/platform-specific/jn516x/rpl/coap-dr1199-node/Makefile b/examples/platform-specific/jn516x/rpl/coap-dr1199-node/Makefile index dc8ee8490..a5887a8ef 100644 --- a/examples/platform-specific/jn516x/rpl/coap-dr1199-node/Makefile +++ b/examples/platform-specific/jn516x/rpl/coap-dr1199-node/Makefile @@ -8,7 +8,7 @@ CONTIKI=../../../../.. MAKE_MAC = MAKE_MAC_TSCH MODULES += os/lib/json -PROJECTDIRS += .. ../tools +MODULES_REL += .. ../tools MODULES += os/net/app-layer/coap diff --git a/examples/platform-specific/jn516x/rpl/node/Makefile b/examples/platform-specific/jn516x/rpl/node/Makefile index d581bb235..83cd48869 100644 --- a/examples/platform-specific/jn516x/rpl/node/Makefile +++ b/examples/platform-specific/jn516x/rpl/node/Makefile @@ -6,6 +6,6 @@ TARGET ?= jn516x CONTIKI=../../../../.. MAKE_MAC = MAKE_MAC_TSCH -PROJECTDIRS += .. ../tools +MODULES_REL += .. ../tools include $(CONTIKI)/Makefile.include diff --git a/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/Makefile b/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/Makefile index 691dc94ec..2e7e32585 100644 --- a/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/Makefile +++ b/examples/platform-specific/jn516x/tsch/simple-sensor-network/node/Makefile @@ -5,7 +5,7 @@ JN516x_WITH_DONGLE = 1 CONTIKI=../../../../../.. -PROJECTDIRS += .. ../../tools +MODULES_REL += .. ../../tools MAKE_MAC = MAKE_MAC_TSCH MODULES += os/net/app-layer/coap MODULES += os/services/orchestra os/lib/json diff --git a/examples/platform-specific/jn516x/tsch/tx-power-verification/node/Makefile b/examples/platform-specific/jn516x/tsch/tx-power-verification/node/Makefile index b4846ed91..3884b9d30 100644 --- a/examples/platform-specific/jn516x/tsch/tx-power-verification/node/Makefile +++ b/examples/platform-specific/jn516x/tsch/tx-power-verification/node/Makefile @@ -5,7 +5,7 @@ JN516x_WITH_DONGLE = 1 CONTIKI=../../../../../.. -PROJECTDIRS += .. ../../tools +MODULES_REL += .. ../../tools MAKE_MAC = MAKE_MAC_TSCH MODULES += os/net/app-layer/coap diff --git a/examples/platform-specific/jn516x/tsch/tx-power-verification/rpl-border-router/Makefile b/examples/platform-specific/jn516x/tsch/tx-power-verification/rpl-border-router/Makefile index b3b1fd9a4..3773e04a5 100644 --- a/examples/platform-specific/jn516x/tsch/tx-power-verification/rpl-border-router/Makefile +++ b/examples/platform-specific/jn516x/tsch/tx-power-verification/rpl-border-router/Makefile @@ -7,7 +7,7 @@ CONTIKI=../../../../../.. PROJECT_SOURCEFILES += slip-bridge.c slip.c -PROJECTDIRS += .. ../../tools +MODULES_REL += .. ../../tools MAKE_MAC = MAKE_MAC_TSCH MODULES += os/net/app-layer/coap diff --git a/examples/platform-specific/jn516x/tsch/uart1-test-node/Makefile b/examples/platform-specific/jn516x/tsch/uart1-test-node/Makefile index fdd38cc9e..640495432 100644 --- a/examples/platform-specific/jn516x/tsch/uart1-test-node/Makefile +++ b/examples/platform-specific/jn516x/tsch/uart1-test-node/Makefile @@ -6,7 +6,7 @@ TARGET_WITH_UART1 = 1 CONTIKI=../../../../.. -PROJECTDIRS += .. ../tools +MODULES_REL += .. ../tools MAKE_MAC = MAKE_MAC_TSCH MODULES += os/net/app-layer/coap diff --git a/examples/platform-specific/nrf52dk/coap-demo/Makefile b/examples/platform-specific/nrf52dk/coap-demo/Makefile index 02f87b5d6..37b4cef4d 100644 --- a/examples/platform-specific/nrf52dk/coap-demo/Makefile +++ b/examples/platform-specific/nrf52dk/coap-demo/Makefile @@ -16,7 +16,7 @@ CFLAGS += -DDEVICE_NAME=\"nRF52-DK-CoAP-Server\" endif # automatically build RESTful resources -PROJECTDIRS += ./resources +MODULES_REL += ./resources # REST Engine shall use Erbium CoAP implementation MODULES += os/net/app-layer/coap diff --git a/examples/rpl-border-router/Makefile b/examples/rpl-border-router/Makefile index 0870aacd9..80bdf5c85 100644 --- a/examples/rpl-border-router/Makefile +++ b/examples/rpl-border-router/Makefile @@ -5,14 +5,14 @@ CONTIKI = ../.. include $(CONTIKI)/Makefile.identify-target ifeq ($(TARGET),native) - PROJECTDIRS += native + MODULES_REL += native CFLAGS += -DPROJECT_CONF_PATH=\"native/project-conf.h\" else - PROJECTDIRS += embedded + MODULES_REL += embedded # For embedded platforms, include platform-specific directory - PROJECTDIRS += embedded/$(TARGET) + MODULES_REL += embedded/$(TARGET) CFLAGS += -DPROJECT_CONF_PATH=\"embedded/project-conf.h\" endif -PROJECTDIRS += common +MODULES_REL += common include $(CONTIKI)/Makefile.include diff --git a/examples/sensniff/Makefile b/examples/sensniff/Makefile index 3c04da8e4..a3c3286f2 100644 --- a/examples/sensniff/Makefile +++ b/examples/sensniff/Makefile @@ -2,7 +2,7 @@ CONTIKI_PROJECT = sensniff CONTIKI = ../.. PROJECT_SOURCEFILES += sensniff-mac.c netstack.c -PROJECTDIRS += pool $(TARGET) +MODULES_REL += pool $(TARGET) include $(CONTIKI)/Makefile.identify-target diff --git a/examples/slip-radio/Makefile b/examples/slip-radio/Makefile index 85c9e35b1..3ab7bffa3 100644 --- a/examples/slip-radio/Makefile +++ b/examples/slip-radio/Makefile @@ -5,7 +5,7 @@ MODULES += os/services/slip-cmd CONTIKI=../.. include $(CONTIKI)/Makefile.identify-target -PROJECTDIRS += $(TARGET) +MODULES_REL += $(TARGET) PROJECT_SOURCEFILES += slip-net.c # custom net layer, but with IPv6 enabled diff --git a/tools/sky/uip6-bridge/Makefile b/tools/sky/uip6-bridge/Makefile index ce605851e..55da6798e 100644 --- a/tools/sky/uip6-bridge/Makefile +++ b/tools/sky/uip6-bridge/Makefile @@ -12,7 +12,7 @@ ifndef TARGET TARGET=sky endif -PROJECTDIRS = dev +MODULES_REL += dev PROJECT_SOURCEFILES = fakeuip.c sicslow_ethernet.c all: uip6-bridge-tap.sky