# <top>/configure/RULES_EXPAND

# Default settings
EXPAND_TOOL ?= $(PERL) $(TOOLS)/expandVars.pl

EXPANDFLAGS += -t $(INSTALL_LOCATION) -a $(T_A)
EXPANDFLAGS += $(addprefix -D ,$(EXPAND_VARS))

EXPANDED = $(EXPAND:%@=%)

$(EXPANDED): %: ../%@
	$(ECHO) "Expanding $< to $@"
	@$(RM) $@
	@$(EXPAND_TOOL) $(EXPANDFLAGS) $($@_EXPANDFLAGS) $< $@

clean::
	@$(RM) $(EXPANDED)

.PRECIOUS: $(EXPANDED)
