Build system: automatically include Makefiles from PROJECTDIRS
This commit is contained in:
parent
c2d301a434
commit
a0961ac2a1
@ -60,6 +60,8 @@ CONTIKI_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(CONTIKI_SOURCEFI
|
||||
|
||||
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):
|
||||
|
@ -5,14 +5,14 @@ CONTIKI = ../..
|
||||
include $(CONTIKI)/Makefile.identify-target
|
||||
|
||||
ifeq ($(TARGET),native)
|
||||
SOURCES_DIR = native
|
||||
PROJECTDIRS += native
|
||||
CFLAGS += -DPROJECT_CONF_PATH=\"native/project-conf.h\"
|
||||
else
|
||||
SOURCES_DIR = embedded
|
||||
PROJECTDIRS += embedded
|
||||
# For embedded platforms, include platform-specific directory
|
||||
PROJECTDIRS += embedded/$(TARGET)
|
||||
CFLAGS += -DPROJECT_CONF_PATH=\"embedded/project-conf.h\"
|
||||
endif
|
||||
include $(SOURCES_DIR)/Makefile
|
||||
|
||||
PROJECTDIRS += common
|
||||
PROJECTDIRS += $(SOURCES_DIR)
|
||||
CFLAGS += -DPROJECT_CONF_PATH=\"$(SOURCES_DIR)/project-conf.h\"
|
||||
|
||||
include $(CONTIKI)/Makefile.include
|
||||
|
@ -1,7 +1,3 @@
|
||||
### Optionally, the target can add its own Makefile, to do things like e.g.
|
||||
### add more source files to the build or define make variables.
|
||||
-include $(SOURCES_DIR)/$(TARGET)/Makefile.$(TARGET)
|
||||
|
||||
$(CONTIKI)/tools/tunslip6: $(CONTIKI)/tools/tunslip6.c
|
||||
(cd $(CONTIKI)/tools && $(MAKE) tunslip6)
|
||||
|
||||
|
@ -1,3 +1 @@
|
||||
PROJECT_SOURCEFILES += slip-bridge-putchar.c
|
||||
|
||||
CFLAGS += -DTARGET_CONF_PATH=\"target-conf.h\"
|
||||
|
@ -6,10 +6,6 @@ PROJECTDIRS += pool $(TARGET)
|
||||
|
||||
include $(CONTIKI)/Makefile.identify-target
|
||||
|
||||
### Optionally, the target can add its own Makefile, to do things like e.g.
|
||||
### add more source files to the build or define make variables.
|
||||
-include $(TARGET)/Makefile.$(TARGET)
|
||||
|
||||
all: $(CONTIKI_PROJECT)
|
||||
|
||||
# use a custom MAC driver: sensniff_mac_driver
|
||||
|
@ -5,10 +5,6 @@ MODULES += os/services/slip-cmd
|
||||
CONTIKI=../..
|
||||
include $(CONTIKI)/Makefile.identify-target
|
||||
|
||||
### Optionally, the target can add its own Makefile, to do things like e.g.
|
||||
### add more source files to the build or define make variables.
|
||||
-include $(TARGET)/Makefile.$(TARGET)
|
||||
|
||||
PROJECTDIRS += $(TARGET)
|
||||
PROJECT_SOURCEFILES += slip-net.c
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user