natch wrote:
That solution looks beautiful. Unfortunately, I'm forced to use Make
3.79.1 which doesn't understand eval. Any other suggestions?
OK. What you could do is write the rules out to a Makefile that you
generate during Makefile parsing and then include that Makefile. (Yes,
this is a hack).
DIRECTORIES := a b c group/d group/e
HTML_FILES := $(addsuffix /index.html,$(DIRECTORIES))
SPECIAL_MAKEFILE := include-me
define copy-rule
echo "$1 : $(subst /,_,$1) ; cp $1 $(subst /,_,$1)" >> $(SPECIAL_MAKEFILE)
endef
$(shell rm -f $(SPECIAL_MAKEFILE))
$(foreach d,$(HTML_FILES),$(shell $(call copy-rule,$d)))
include include-me
And if you want to get really fancy you could make a rule for include-me
that does the $(foreach) bit.
John.
--
John Graham-Cumming
[EMAIL PROTECTED]
Home: http://www.jgc.org/
POPFile: http://getpopfile.org/
Sign up for my Spam and Anti-spam Newsletter
at http://www.jgc.org/
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make