Filter out multiple definitions of the same module

This commit is contained in:
Adam Dunkels 2013-12-02 10:30:56 +01:00
parent 13f8837422
commit 460da08a37

View File

@ -96,6 +96,8 @@ PROJECT_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(PROJECT_SOURCEFI
$(OBJECTDIR): $(OBJECTDIR):
mkdir $@ mkdir $@
uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
### Include application makefiles ### Include application makefiles
ifdef APPS ifdef APPS
@ -125,8 +127,9 @@ else
endif endif
ifdef MODULES ifdef MODULES
MODULESSUBST = ${subst /,-,$(MODULES)} UNIQUEMODULES = $(call uniq,$(MODULES))
MODULEDIRS = ${wildcard ${addprefix $(CONTIKI)/, $(MODULES)}} MODULESSUBST = ${subst /,-,$(UNIQUEMODULES)}
MODULEDIRS = ${wildcard ${addprefix $(CONTIKI)/, $(UNIQUEMODULES)}}
MODULEINCLUDES = ${foreach m, $(MODULESSUBST), ${wildcard ${foreach d, $(MODULEDIRS), $(d)/Makefile.$(m)}}} MODULEINCLUDES = ${foreach m, $(MODULESSUBST), ${wildcard ${foreach d, $(MODULEDIRS), $(d)/Makefile.$(m)}}}
-include $(MODULEINCLUDES) -include $(MODULEINCLUDES)
MODULES_SOURCES = ${foreach m, $(MODULESSUBST), $($(m)_src)} MODULES_SOURCES = ${foreach m, $(MODULESSUBST), $($(m)_src)}