Allow platform makefiles to specify APPS to be used, by defining a PLATFORMAPPS variable.

This commit is contained in:
Adam Dunkels 2013-03-17 23:24:03 +01:00
parent ee64780cb6
commit 03ce7c65cf

View file

@ -89,10 +89,11 @@ PROJECT_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(PROJECT_SOURCEFI
### Include application makefiles ### Include application makefiles
ifdef APPS ifdef APPS
APPDIRS += ${wildcard ${addprefix $(CONTIKI)/apps/, $(APPS)} \ APPDS = ${wildcard ${foreach DIR, $(APPDIRS), ${addprefix $(DIR)/, $(APPS)}}} \
${addprefix $(CONTIKI)/platform/$(TARGET)/apps/, $(APPS)} \ ${wildcard ${addprefix $(CONTIKI)/apps/, $(APPS)} \
$(APPS)} ${addprefix $(CONTIKI)/platform/$(TARGET)/apps/, $(APPS)} \
APPINCLUDES = ${foreach APP, $(APPS), ${wildcard ${foreach DIR, $(APPDIRS), $(DIR)/Makefile.$(APP)}}} $(APPS)}
APPINCLUDES = ${foreach APP, $(APPS), ${wildcard ${foreach DIR, $(APPDS), $(DIR)/Makefile.$(APP)}}}
-include $(APPINCLUDES) -include $(APPINCLUDES)
APP_SOURCES = ${foreach APP, $(APPS), $($(APP)_src)} APP_SOURCES = ${foreach APP, $(APPS), $($(APP)_src)}
DSC_SOURCES = ${foreach APP, $(APPS), $($(APP)_dsc)} DSC_SOURCES = ${foreach APP, $(APPS), $($(APP)_dsc)}
@ -116,6 +117,20 @@ else
include $(target_makefile) include $(target_makefile)
endif endif
ifdef PLATFORMAPPS
PLATFORMAPPDS = ${wildcard ${foreach DIR, $(APPDIRS), ${addprefix $(DIR)/, $(PLATFORMAPPS)}}} \
${wildcard ${addprefix $(CONTIKI)/apps/, $(PLATFORMAPPS)} \
${addprefix $(CONTIKI)/platform/$(TARGET)/apps/, $(PLATFORMAPPS)} \
$(PLATFORMAPPS)}
PLATFORMAPPINCLUDES = ${foreach APP, $(PLATFORMAPPS), \
${wildcard ${foreach DIR, $(PLATFORMAPPDS), $(DIR)/Makefile.$(APP)}}}
-include $(PLATFORMAPPINCLUDES)
PLATFORMAPP_SOURCES = ${foreach APP, $(PLATFORMAPPS), $($(APP)_src)}
CONTIKI_SOURCEFILES += $(PLATFORMAPP_SOURCES)
APPDS += $(PLATFORMAPPDS)
endif
### Forward comma-separated list of arbitrary defines to the compiler ### Forward comma-separated list of arbitrary defines to the compiler
COMMA := , COMMA := ,
@ -129,7 +144,7 @@ CONTIKI_CPU_DIRS_CONCAT = ${addprefix $(CONTIKI_CPU)/, \
$(CONTIKI_CPU_DIRS)} $(CONTIKI_CPU_DIRS)}
SOURCEDIRS = . $(PROJECTDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) \ SOURCEDIRS = . $(PROJECTDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) \
$(CONTIKI_CPU_DIRS_CONCAT) $(CONTIKIDIRS) $(APPDIRS) ${dir $(target_makefile)} $(CONTIKI_CPU_DIRS_CONCAT) $(CONTIKIDIRS) $(APPDS) ${dir $(target_makefile)}
vpath %.c $(SOURCEDIRS) vpath %.c $(SOURCEDIRS)
vpath %.S $(SOURCEDIRS) vpath %.S $(SOURCEDIRS)