Allow application directories to be both in the generic apps/ directory and in target-specific platform/X/apps

This commit is contained in:
adamdunkels 2009-03-12 19:10:37 +00:00
parent f67909271e
commit 1122e49b72

View File

@ -84,17 +84,6 @@ CONTIKI_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(CONTIKI_SOURCEFI
PROJECT_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(PROJECT_SOURCEFILES)}} PROJECT_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(PROJECT_SOURCEFILES)}}
### Include application makefiles
ifdef APPS
APPDIRS += ${addprefix $(CONTIKI)/apps/, $(APPS)}
APPINCLUDES = ${foreach APP, $(APPS), $(CONTIKI)/apps/$(APP)/Makefile.$(APP)}
-include $(APPINCLUDES)
APP_SOURCES = ${foreach APP, $(APPS), $($(APP)_src)}
DSC_SOURCES = ${foreach APP, $(APPS), $($(APP)_dsc)}
CONTIKI_SOURCEFILES += $(APP_SOURCES) $(DSC_SOURCES)
endif
### Include target makefile (TODO Unsafe?) ### Include target makefile (TODO Unsafe?)
target_makefile := $(wildcard $(CONTIKI)/platform/$(TARGET)/Makefile.$(TARGET)) target_makefile := $(wildcard $(CONTIKI)/platform/$(TARGET)/Makefile.$(TARGET))
@ -106,6 +95,20 @@ else
include $(CONTIKI)/platform/$(TARGET)/Makefile.$(TARGET) include $(CONTIKI)/platform/$(TARGET)/Makefile.$(TARGET)
endif endif
### Include application makefiles
ifdef APPS
APPDIRS += ${wildcard ${addprefix $(CONTIKI)/apps/, $(APPS)} \
${addprefix $(CONTIKI)/platform/$(TARGET)/apps/, $(APPS)}}
APPINCLUDES = ${foreach APP, $(APPS), ${wildcard \
$(CONTIKI)/apps/$(APP)/Makefile.$(APP) \
$(CONTIKI)/platform/$(TARGET)/apps/$(APP)/Makefile.$(APP)}}
-include $(APPINCLUDES)
APP_SOURCES = ${foreach APP, $(APPS), $($(APP)_src)}
DSC_SOURCES = ${foreach APP, $(APPS), $($(APP)_dsc)}
CONTIKI_SOURCEFILES += $(APP_SOURCES) $(DSC_SOURCES)
endif
### Forward comma-separated list of arbitrary defines to the compiler ### Forward comma-separated list of arbitrary defines to the compiler
COMMA := , COMMA := ,