What is the correct way to cause jobserver information to be passed to
child processes? I tried this Makefile:

all:
    @echo Jobserver present? $(filter jobserver,$(.FEATURES))
    +@sh -c "echo \"make toplevel MAKEFLAGS=${MAKEFLAGS}\""
    +@sh -c "echo \"child toplevel MAKEFLAGS=$${MAKEFLAGS}\""
    +$(MAKE) recursive

recursive:
    +@sh -c "echo \"make recursive MAKEFLAGS=${MAKEFLAGS}\""
    +@sh -c "echo \"child recursive MAKEFLAGS=$${MAKEFLAGS}\""

# Makefile ends

The actual output is:

make -j
Jobserver present? jobserver
make toplevel MAKEFLAGS= -j
child toplevel MAKEFLAGS= -j
make recursive
make[1]: Entering directory '/home/buster/projects/make-bug'
make recursive MAKEFLAGS=w -j
child recursive MAKEFLAGS=w -j
make[1]: Leaving directory '/home/buster/projects/make-bug'

I expected to see something like "--jobserver-auth=3,4" in all the
"MAKEFLAGS" lines except possibly the first ("make toplevel
MAKEFLAGS").

I tried this on a Debian-like system with Make 4.3 and a Windows
system with (native, MinGW64) Make 4.4.1, with the same results.

Reply via email to