Paul Smith wrote in <ab9601daaeb43a8fe8020490552d8057fd5a3727.ca...@mad-scientist.net>: |On Tue, 2020-10-27 at 19:12 +0100, Steffen Nurpmeso via austin-group-l |at The Open Group wrote: |> build: |> @$(_prestop); LC_ALL=C $${MAKE} -f mk-config.mk $${MAKEFLAGS} all |> |> to specify the configure-time flags to the actually working make |> instance, and that then says |> |> make[1]: warning: -j4 forced in submake: resetting jobserver mode. | |I'm sorry but I was not able to understand the bulk of your email :( | |However, for the above specifically I can solve your problem. I do |urge you to take these sorts of implementation detail questions to an |appropriate mailing list such as help-m...@gnu.org. | |Using ${MAKE} in your recipe instead of $${MAKE} would solve your |problem of course.
Ah. No, this is conscious, the evaluation has to be done by the shell. I should have posted a contained subset of the makefile but deemed it unnecessary for the parallelization related, eh, tokens. The configure script generates a file with shell assignments like "strip='/usr/ccs/bin/strip';export strip", as well as MAKEFLAGS, and this file is sourced first. So a subset would be .NOTPARALLEL: .WAIT: # Luckily BSD make supports specifying this as target, too all: config .WAIT build config: @$(_prego) build: @$(_prestop); LC_ALL=C $${MAKE} -f mk-config.mk all _prego = if CWDDIR="$(CWDDIR)" TOPDIR="$(TOPDIR)" \ SHELL="$(SHELL)" MAKE="$(MAKE)" CC="$(CC)" \ CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ $(SHELL) "$(TOPDIR)"mk/make-config.sh "$(MAKEFLAGS)"; then :;\ else exit 1; fi _prestop = $(__prestop); cd "$(OBJDIR)" && . ./mk-config.env __prestop = if [ -f "$(OBJDIR)"/mk-config.mk ]; then :; else \ echo 'Program not configured, nothing to do';\ echo 'Use one of the targets: config, all, tangerine, citron';\ exit 0;\ fi (This supports out-of-tree builds too, and has to deal with the "-e" environmental override difference of the different makes, and is therefore a bit noisy to look at. In essence "make" invokes a configure script, that generates a configuration, and then build builds in a properly configured sub-make as necessary.) |If for some reason you are forced to use $${MAKE}, you can add the |POSIX-standard (and probably even required for proper behavior in your |situation but without more information we can't be sure) "+" prefix |character to the recipe: | | build: | +@$(_prestop); LC_ALL=C $${MAKE} -f mk-config.mk $${MAKEFLAGS} all | |This will keep GNU make from resetting jobserver mode. | |Also, I should warn you that using ${MAKEFLAGS} in the command line |like that is not supported behavior. According to POSIX MAKEFLAGS is |intended to be parsed as an _environment variable_ which is formatted |in an implementation-defined way allowing a parent make to communicate |to its sub-make. The formatting of MAKEFLAGS is specifically _NOT_ |required to be valid command line option syntax. Yes, that is ok. We do not do that, actually. It is sourced and exported from the same file. That is misunderstanding. |It should not be required to add it to the command line anyway; it |should be sufficient to use: | | build: | +@$(_prestop); LC_ALL=C $${MAKE} -f mk-config.mk all | |As for the idea of standardizing parallel builds, I'm all for it but it |will be a long process to work through the different implementations to |arrive at an acceptable common subset. No, sorry, that is a misunderstanding. Like i have written, .WAIT is for now all i would like to see a word about. Today most projects use some "super-makes", like autoconf, ninja, meson, cmake, i do not use those so .., but these things, if they create makefiles, do not create all-compatible, i think. Thanks, --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)