On 2013-01-03 23:05 +0100, Stefano Lattarini wrote: > On 01/03/2013 10:34 PM, Eric Blake wrote: [...] > > Hmm, that goes back to one of the questions we asked about Automake-NG - > > is it possible to write a generic makefile that merely forwards all > > requests to gmake, and where all of the real magic of Automake-NG is in > > GNUMakefile, so that even if the user types 'make all' they still end up > > running 'gmake all' under the hood? > > > For usual targets, that is easy. I don't even think that must be done > at Automake-NG level; one can simply use 'GNUmakefile.am' as Automake-NG > input file (instead of the usual 'Makefile.am'), add 'GNUmakefile' to > an AC_CONFIG_FILES invocation, and then hand-write a simple Makefile > acting as a thin wrapper: > > TARGETS = all check clean distclean dist distcheck install uninstall > .PHONY: $(TARGETS) > $(TARGETS): ; @gmake $(AM_MAKEFLAGS) $@
Unfortunately, this kind of wrapper doesn't work particularly well. If the user runs something similar to: make -j2 all install then the wrapper makefile will happily fork off two independent make instances in parallel: one running "gmake all" and one running "gmake install". The result will probably be catastrophic. Cheers, -- Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)