2010-01-14 00:13:01 +08:00
|
|
|
# This file is intended to be included from each subdirectory makefile.
|
2009-06-27 00:47:03 +08:00
|
|
|
|
|
|
|
ifeq ($(Dir),)
|
|
|
|
$(error "No Dir variable defined.")
|
|
|
|
endif
|
|
|
|
|
2010-01-18 14:48:12 +08:00
|
|
|
ifeq ($(DEBUGMAKE),1)
|
2009-06-27 00:47:03 +08:00
|
|
|
$(info MAKE: $(Dir): Processing subdirectory)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Expand template for each configuration and architecture.
|
2010-01-14 00:13:01 +08:00
|
|
|
#
|
2009-06-27 00:47:03 +08:00
|
|
|
# FIXME: This level of logic should be in primary Makefile?
|
|
|
|
ifeq ($(OnlyConfigs),)
|
|
|
|
ConfigsToTraverse := $(Configs)
|
|
|
|
else
|
|
|
|
ConfigsToTraverse := $(OnlyConfigs)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OnlyArchs),)
|
|
|
|
ArchsToTraverse := $(Archs)
|
|
|
|
else
|
|
|
|
ArchsToTraverse := $(OnlyArchs)
|
|
|
|
endif
|
|
|
|
|
2009-09-04 04:49:22 +08:00
|
|
|
# If we are only targetting a single arch, only traverse that.
|
|
|
|
ifneq ($(TargetArch),)
|
|
|
|
ArchsToTraverse := $(filter $(TargetArch), $(ArchsToTraverse))
|
|
|
|
endif
|
|
|
|
|
2009-06-27 00:47:03 +08:00
|
|
|
$(foreach config,$(ConfigsToTraverse), \
|
|
|
|
$(foreach arch,$(ArchsToTraverse), \
|
|
|
|
$(eval $(call CNA_subdir_template,$(config),$(arch),$(Dir)))))
|
|
|
|
|
|
|
|
###
|
|
|
|
# Include child makefile fragments
|
|
|
|
|
2010-01-14 00:13:01 +08:00
|
|
|
# Evaluate this now so we do not have to worry about order of evaluation.
|
2009-06-27 00:47:03 +08:00
|
|
|
SubDirsList := $(SubDirs:%=$(Dir)/%)
|
|
|
|
ifeq ($(SubDirsList),)
|
|
|
|
else
|
2010-01-18 14:48:12 +08:00
|
|
|
ifeq ($(DEBUGMAKE),1)
|
2009-06-27 00:47:03 +08:00
|
|
|
$(info MAKE: Descending into subdirs: $(SubDirsList))
|
|
|
|
endif
|
|
|
|
$(foreach subdir,$(SubDirsList),$(eval include $(subdir)/Makefile.mk))
|
|
|
|
endif
|
|
|
|
|