From 214edd42d19689f212dcc87276b1671375dac324 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Sun, 11 Oct 2015 00:50:50 -0500 Subject: [PATCH] Minor RULES_EXPAND changes Added support for a _PATTERN variable which calls $(wildcard) and prepends .. and the other SRC_DIRS automatically. Use $(ECHO) instead of @echo so make -s works silently. Added another meta-rule to create .d files when make needs one. --- configure/RULES_EXPAND | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/configure/RULES_EXPAND b/configure/RULES_EXPAND index 69636db19..0f43db347 100644 --- a/configure/RULES_EXPAND +++ b/configure/RULES_EXPAND @@ -34,20 +34,32 @@ expand_clean: ASSEMBLE_TOOL ?= $(PERL) $(TOOLS)/assembleSnippets.pl define COMMON_ASSEMBLY_template -$(COMMON_DIR)/$1: $($1_SNIPPETS) - @echo "Assembling file $$@ from snippets" +$1_SNIPPETS += $$(foreach dir, .. $$(SRC_DIRS), \ + $$(wildcard $$(dir)/$$($1_PATTERN))) +$(COMMON_DIR)/$1: $$($1_SNIPPETS) + $(ECHO) "Assembling common file $$@ from snippets" @$(RM) $1 - $(ASSEMBLE_TOOL) -o $1 $($1_SNIPPETS) + $(ASSEMBLE_TOOL) -o $1 $$^ @$(MV) $1 $$@ endef $(foreach asy, $(COMMON_ASSEMBLIES), \ $(eval $(call COMMON_ASSEMBLY_template,$(strip $(asy))))) define ASSEMBLY_template -$1: $($1_SNIPPETS) - @echo "Assembling file $$@ from snippets" +$1_SNIPPETS += $$(foreach dir, .. $$(SRC_DIRS), \ + $$(wildcard $$(dir)/$$($1_PATTERN))) +$1: $$($1_SNIPPETS) + $(ECHO) "Assembling file $$@ from snippets" @$(RM) $$@ - $(ASSEMBLE_TOOL) -o $$@ $($1_SNIPPETS) + $(ASSEMBLE_TOOL) -o $$@ $$^ endef $(foreach asy, $(ASSEMBLIES), \ $(eval $(call ASSEMBLY_template,$(strip $(asy))))) + +define ASSEMBLY_DEP_template +$1$(DEP): + @echo $1: > $$@ +endef +$(foreach asy, $(sort $(COMMON_ASSEMBLIES) $(ASSEMBLIES)), \ + $(eval $(call ASSEMBLY_DEP_template,$(strip $(asy))))) +