Automatically compile .c files from PROJECTDIRS
This commit is contained in:
parent
84ea0971bc
commit
2fd6fa1fd6
@ -58,6 +58,7 @@ 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)}}
|
||||
|
||||
# Provide way to create $(OBJECTDIR) if it has been removed by make clean
|
||||
|
@ -3,20 +3,12 @@ all: coap-example-server coap-example-client
|
||||
|
||||
CONTIKI=../..
|
||||
|
||||
# automatically build RESTful resources
|
||||
REST_RESOURCES_DIR = ./resources
|
||||
ifndef TARGET
|
||||
REST_RESOURCES_FILES = $(notdir $(shell find $(REST_RESOURCES_DIR) -name '*.c'))
|
||||
else
|
||||
ifeq ($(TARGET), native)
|
||||
REST_RESOURCES_FILES = $(notdir $(shell find $(REST_RESOURCES_DIR) -name '*.c'))
|
||||
else
|
||||
REST_RESOURCES_FILES = $(notdir $(shell find $(REST_RESOURCES_DIR) -name '*.c' ! -name 'res-plugtest*'))
|
||||
# build RESTful resources
|
||||
include $(CONTIKI)/Makefile.identify-target
|
||||
ifeq ($(TARGET),native)
|
||||
PROJECTDIRS += ./resources-plugtest
|
||||
endif
|
||||
endif
|
||||
|
||||
PROJECTDIRS += $(REST_RESOURCES_DIR)
|
||||
PROJECT_SOURCEFILES += $(REST_RESOURCES_FILES)
|
||||
PROJECTDIRS += ./resources
|
||||
|
||||
# Include the CoAP implementation
|
||||
MODULES += os/net/app-layer/coap
|
||||
|
@ -1,12 +1,6 @@
|
||||
all: cc26xx-web-demo
|
||||
|
||||
REST_RESOURCES_DIR = ./resources
|
||||
|
||||
REST_RESOURCES_FILES += res-leds.c res-toggle-leds.c res-device.c
|
||||
REST_RESOURCES_FILES += res-sensors.c res-ble-advd.c res-net.c
|
||||
|
||||
PROJECTDIRS += $(REST_RESOURCES_DIR)
|
||||
PROJECT_SOURCEFILES += $(REST_RESOURCES_FILES)
|
||||
PROJECTDIRS += ./resources
|
||||
|
||||
PROJECT_SOURCEFILES += cetic-6lbr-client.c coap-server.c net-uart.c mqtt-client.c
|
||||
PROJECT_SOURCEFILES += httpd-simple.c
|
||||
|
@ -9,7 +9,6 @@ CONTIKI=../../../../..
|
||||
MAKE_MAC = MAKE_MAC_TSCH
|
||||
MODULES += os/lib/json
|
||||
PROJECTDIRS += .. ../tools
|
||||
PROJECT_SOURCEFILES += rpl-tools.c
|
||||
|
||||
MODULES += os/net/app-layer/coap
|
||||
|
||||
|
@ -9,7 +9,6 @@ CONTIKI=../../../../..
|
||||
MAKE_MAC = MAKE_MAC_TSCH
|
||||
MODULES += os/lib/json
|
||||
PROJECTDIRS += .. ../tools
|
||||
PROJECT_SOURCEFILES += rpl-tools.c
|
||||
|
||||
MODULES += os/net/app-layer/coap
|
||||
|
||||
|
@ -9,7 +9,6 @@ CONTIKI=../../../../..
|
||||
MAKE_MAC = MAKE_MAC_TSCH
|
||||
MODULES += os/lib/json
|
||||
PROJECTDIRS += .. ../tools
|
||||
PROJECT_SOURCEFILES += rpl-tools.c
|
||||
|
||||
MODULES += os/net/app-layer/coap
|
||||
|
||||
|
@ -7,6 +7,5 @@ CONTIKI=../../../../..
|
||||
|
||||
MAKE_MAC = MAKE_MAC_TSCH
|
||||
PROJECTDIRS += .. ../tools
|
||||
PROJECT_SOURCEFILES += rpl-tools.c
|
||||
|
||||
include $(CONTIKI)/Makefile.include
|
||||
|
@ -6,7 +6,6 @@ JN516x_WITH_DONGLE = 1
|
||||
CONTIKI=../../../../../..
|
||||
|
||||
PROJECTDIRS += .. ../../tools
|
||||
PROJECT_SOURCEFILES += rpl-tools.c
|
||||
MAKE_MAC = MAKE_MAC_TSCH
|
||||
MODULES += os/net/app-layer/coap
|
||||
MODULES += os/services/orchestra os/lib/json
|
||||
|
@ -6,7 +6,6 @@ JN516x_WITH_DONGLE = 1
|
||||
CONTIKI=../../../../../..
|
||||
|
||||
PROJECTDIRS += .. ../../tools
|
||||
PROJECT_SOURCEFILES += rpl-tools.c
|
||||
|
||||
MAKE_MAC = MAKE_MAC_TSCH
|
||||
MODULES += os/net/app-layer/coap
|
||||
|
@ -8,7 +8,6 @@ CONTIKI=../../../../../..
|
||||
PROJECT_SOURCEFILES += slip-bridge.c slip.c
|
||||
|
||||
PROJECTDIRS += .. ../../tools
|
||||
PROJECT_SOURCEFILES += rpl-tools.c
|
||||
|
||||
MAKE_MAC = MAKE_MAC_TSCH
|
||||
MODULES += os/net/app-layer/coap
|
||||
|
@ -7,7 +7,6 @@ TARGET_WITH_UART1 = 1
|
||||
CONTIKI=../../../../..
|
||||
|
||||
PROJECTDIRS += .. ../tools
|
||||
PROJECT_SOURCEFILES += rpl-tools.c
|
||||
|
||||
MAKE_MAC = MAKE_MAC_TSCH
|
||||
MODULES += os/net/app-layer/coap
|
||||
|
@ -16,11 +16,7 @@ CFLAGS += -DDEVICE_NAME=\"nRF52-DK-CoAP-Server\"
|
||||
endif
|
||||
|
||||
# automatically build RESTful resources
|
||||
REST_RESOURCES_DIR = ./resources
|
||||
REST_RESOURCES_FILES = $(notdir $(shell find $(REST_RESOURCES_DIR) -name '*.c' ! -name 'res-plugtest*'))
|
||||
|
||||
PROJECTDIRS += $(REST_RESOURCES_DIR)
|
||||
PROJECT_SOURCEFILES += $(REST_RESOURCES_FILES)
|
||||
PROJECTDIRS += ./resources
|
||||
|
||||
# REST Engine shall use Erbium CoAP implementation
|
||||
MODULES += os/net/app-layer/coap
|
||||
|
@ -15,7 +15,6 @@ endif
|
||||
include $(SOURCES_DIR)/Makefile
|
||||
|
||||
PROJECTDIRS += $(SOURCES_DIR)
|
||||
PROJECT_SOURCEFILES += httpd-simple.c webserver.c border-router-common.c
|
||||
CFLAGS += -DPROJECT_CONF_PATH=\"$(SOURCES_DIR)/project-conf.h\"
|
||||
|
||||
include $(CONTIKI)/Makefile.include
|
||||
|
@ -2,10 +2,6 @@
|
||||
### add more source files to the build or define make variables.
|
||||
-include $(SOURCES_DIR)/$(TARGET)/Makefile.$(TARGET)
|
||||
|
||||
PROJECTDIRS += $(SOURCES_DIR)/$(TARGET)
|
||||
|
||||
PROJECT_SOURCEFILES += slip-bridge.c border-router-embedded.c
|
||||
|
||||
$(CONTIKI)/tools/tunslip6: $(CONTIKI)/tools/tunslip6.c
|
||||
(cd $(CONTIKI)/tools && $(MAKE) tunslip6)
|
||||
|
||||
|
@ -1,9 +1,5 @@
|
||||
MODULES += os/services/slip-cmd
|
||||
|
||||
PROJECT_SOURCEFILES += border-router-native.c
|
||||
PROJECT_SOURCEFILES += border-router-cmds.c tun-bridge.c
|
||||
PROJECT_SOURCEFILES += slip-config.c slip-dev.c border-router-mac.c
|
||||
|
||||
MAKE_MAC = MAKE_MAC_OTHER
|
||||
MAKE_NET = MAKE_NET_IPV6
|
||||
|
||||
|
@ -1,4 +1 @@
|
||||
PROJECT_SOURCEFILES += slip-radio-cc2420.c slip-radio-sky-sensors.c
|
||||
PROJECT_SOURCEFILES += slip-radio-putchar.c
|
||||
|
||||
CFLAGS += -DTARGET_CONF_PATH=\"target-conf.h\"
|
||||
|
Loading…
Reference in New Issue
Block a user