Re: separate the notions of always-build and jobserver

2011-01-26 Thread Ralf Wildenhues
http://thread.gmane.org/gmane.comp.gnu.make.bugs/5015

* Ralf Wildenhues wrote on Tue, Sep 28, 2010 at 10:55:48PM CEST:
> Currently, 'make -n' only executes recipe commands prefixed with '+' or
> containing one of the strings ${MAKE} or $(MAKE).  Likewise, parallel
> make hands the jobserver file descriptors only to rules annotated in the
> same way.
> 
> It would be nice if these two semantics could be decoupled.

FYI, to follow up to this old message myself, according to the other
message I just sent, I intend to use the following for this:

> 1) The GCC LTO (link-time optimization) engine may exploit
> parallelization during whole-program linking by hooking into the job
> server: http://gcc.gnu.org/ml/gcc-patches/2010-08/msg02149.html

in Automake:

am__if_make_flag = \
$(if $(strip $(foreach flag,$(filter-out --%,$(MAKEFLAGS)),$(if \
  $(findstring =,$(flag)),,$(if \
$(findstring $(1),$(flag)),:,$(2),$(3))
LTOPAR = $(call am__if_make_flag,n,,+)

and prefix link recipe commands with $(LTOPAR) (if GNU make is used).

Cheers,
Ralf

___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make


separate the notions of always-build and jobserver

2010-09-28 Thread Ralf Wildenhues
Currently, 'make -n' only executes recipe commands prefixed with '+' or
containing one of the strings ${MAKE} or $(MAKE).  Likewise, parallel
make hands the jobserver file descriptors only to rules annotated in the
same way.

It would be nice if these two semantics could be decoupled.

1) The GCC LTO (link-time optimization) engine may exploit
parallelization during whole-program linking by hooking into the job
server: http://gcc.gnu.org/ml/gcc-patches/2010-08/msg02149.html

2) Autoconf's Autotest testsuites could hook into the jobserver:
http://lists.gnu.org/archive/html/autoconf-patches/2008-05/msg00028.html
(this patch hasn't made it into Autoconf, but the './testsuite --jobs'
patches have).

I can imagine more use cases, where one doesn't want 'make -n' to
actually execute the code in question, but it would be nice to be able
to hook into the jobserver when not dry running.

Of course, that means the jobserver semantics should be documented and
treated as API.

One question is whether

- jobserver file descriptors should just be passed on to every process
(could be dangerous when passed to processes not expecting it, or
otherwise messing with it in bad ways), or

- there should be a new annotation for such recipe commands.  For
example, leading '&' or '|' would be quite unlikely to occur in current
makefiles, thus be possible as recipe modifiers, although the pipe
symbol could be confused with order-only functionality.

What do you think?

Thanks,
Ralf

___
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make