* Paolo Bonzini wrote on Thu, Jul 30, 2009 at 08:41:52AM CEST: > GCC has this: > > # write_entries_to_file - writes each entry in a list [...]
> Maybe you can unfunctionize it and do something like > > write_entries_to_file = echo $(DISTFILES) | tr ' ' '\n' > DISTFILES.list > > write_entries_to_file_split = 50 > write_entries_to_file_gnu = $(shell :>dist.lst) \ > $(foreach range, \ > $(shell i=1; while test $$i -le $(words $(DISTFILES)); do \ > echo $$i; i=`expr $$i + $(write_entries_to_file_split)`; done), \ > $(shell echo $(wordlist $(range), \ > $(shell expr $(range) + $(write_entries_to_file_split) - 1), > $(DISTFILES)) \ > | tr ' ' '\n' >> dist.lst)) > > # Hoping non-GNU make does nothing with this??? Surely GNU make > # expands unknown function to nothing... Well, some non-GNU make implementations are really picky about everything they don't grok, so basically, we have to comment out GNU make-specific stuff completely, or put it in GNUmakefile or so. I'm not very fond of introducing more GNU make-specific code into Automake, although in the end we might have to anyway. After all, automake is supposed to generate portable makefiles. Testing ${MAKE-make} at configure time works, but users don't generally use ./configure MAKE=gmake and I expect that we might receive bug reports about broken makefiles if after the above, someone accidentally types 'make' instead of 'gmake'. > $(eval write_entries_to_file = $$(write_entries_to_file_gnu)) Another idea might be to introduce an Automake option gnu-make that generally allows Automake to assume only GNU make is used. However, that could even hurt packages like the one this bug report came from, if, say, originally only the 'dist' rule required special treatment, but we create makefiles that require GNU make in order to be successfully parsed at all. Also, it would make it harder to dismiss "why does automake barf over this GNU make-specific construct in my Makefile.am?" questions. ;-) Cheers, Ralf