Follow-up Comment #2, bug #68018 (group make):

The expectation was that sub-make(s) under that target won't print
directories.

If you look at the output ('good') it works that way. The problem is that if
there are any commandline variables defined then the construction of the
variable goes wrong:

'MAKEFLAGS:<--no-print-directory>' vs
'MAKEFLAGS:< -- foo=bar --no-print-directory>'

The --no-print-directory is not in the "flags" part, but after the --, in the
"targets/variables" part.

Here is a simpler test case and comparison with 4.3 and 4.4.1:


$ cat Makefile
withdir:
        @$(MAKE) test

withoutdir: MAKEFLAGS += --no-print-directory
withoutdir:
        @$(MAKE) test

test:
        @echo in submake

# Make 4.3

$ make withdir
make[1]: Entering directory '/home/x/makefilebug'
in submake
make[1]: Leaving directory '/home/x/makefilebug'
$ make withoutdir
in submake
$ make withoutdir var=1
make[1]: Entering directory '/home/x/makefilebug'
in submake
make[1]: Leaving directory '/home/x/makefilebug'

# Make 4.4.1

$ make withdir
make[1]: Entering directory '/home/x/makefilebug'
in submake
make[1]: Leaving directory '/home/x/makefilebug'
$ make withoutdir
in submake
$ make withoutdir var=1
make[1]: Entering directory '/home/x/makefilebug'
make[1]: *** No rule to make target '--no-print-directory'.  Stop.
make[1]: Leaving directory '/home/x/makefilebug'
make: *** [Makefile:6: withoutdir] Error 2


Note that even with 4.3, the presence of a commandline variable breaks this
behavior (it does print the directory), but at least it does not fail with an
error trying to interpret "--no-print-directory" as a target name like 4.4.1.

I'm not saying that my expectation is fully correct, but nevertheless the
shown construct has been working with previous versions (or at least it was
not causing an error exit).


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68018>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to