From 8596dc41f290907f9beca22ca5e57609cb2cf098 Mon Sep 17 00:00:00 2001 From: Ralph Lange Date: Sat, 10 Oct 2015 18:55:17 +0200 Subject: [PATCH] configure: add assemblies to RULES_EXPAND --- configure/RULES_EXPAND | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/configure/RULES_EXPAND b/configure/RULES_EXPAND index ca087aadc..69636db19 100644 --- a/configure/RULES_EXPAND +++ b/configure/RULES_EXPAND @@ -2,6 +2,9 @@ vpath %@ $(USR_VPATH) $(ALL_SRC_DIRS) +#--------------------------------------------------------------- +# Variable expansion + # Default settings EXPAND_TOOL ?= $(PERL) $(TOOLS)/expandVars.pl @@ -24,3 +27,27 @@ expand_clean: @$(RM) $(EXPANDED) .PHONY : expand_clean + +#--------------------------------------------------------------- +# Assemblies (files assembled from snippets) + +ASSEMBLE_TOOL ?= $(PERL) $(TOOLS)/assembleSnippets.pl + +define COMMON_ASSEMBLY_template +$(COMMON_DIR)/$1: $($1_SNIPPETS) + @echo "Assembling file $$@ from snippets" + @$(RM) $1 + $(ASSEMBLE_TOOL) -o $1 $($1_SNIPPETS) + @$(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" + @$(RM) $$@ + $(ASSEMBLE_TOOL) -o $$@ $($1_SNIPPETS) +endef +$(foreach asy, $(ASSEMBLIES), \ + $(eval $(call ASSEMBLY_template,$(strip $(asy)))))