[bug #68018] target-specific MAKEFLAGS ends up wrong if commandline overrides present
anonymous <[email protected]> Wed, 1 Apr 2026 14:46:18 -0400 (EDT)
| Newsgroups | gmane.comp.gnu.make.bugs |
|---|---|
| Message-ID | <[email protected]> |
--8323329-1714636915-1775069178=:1903180
Content-Type: TEXT/plain; CHARSET=utf-8
Content-Transfer-Encoding: QUOTED-PRINTABLE
Content-Disposition: inline
Follow-up Comment #2, bug #68018 (group make):=0A=0AThe expectation was tha=
t sub-make(s) under that target won't print=0Adirectories.=0A=0AIf you look=
at the output ('good') it works that way. The problem is that if=0Athere a=
re any commandline variables defined then the construction of the=0Avariabl=
e goes wrong:=0A=0A'MAKEFLAGS:<--no-print-directory>' vs=0A'MAKEFLAGS:< -- =
foo=3Dbar --no-print-directory>'=0A=0AThe --no-print-directory is not in th=
e "flags" part, but after the --, in the=0A"targets/variables" part.=0A=0AH=
ere is a simpler test case and comparison with 4.3 and 4.4.1:=0A=0A=0A$ cat=
Makefile=0Awithdir:=0A=09@$(MAKE) test=0A=0Awithoutdir: MAKEFLAGS +=3D --n=
o-print-directory=0Awithoutdir:=0A=09@$(MAKE) test=0A=0Atest:=0A=09@echo in=
submake=0A=0A# Make 4.3=0A=0A$ make withdir=0Amake[1]: Entering directory =
'/home/x/makefilebug'=0Ain submake=0Amake[1]: Leaving directory '/home/x/ma=
kefilebug'=0A$ make withoutdir=0Ain submake=0A$ make withoutdir var=3D1=0Am=
ake[1]: Entering directory '/home/x/makefilebug'=0Ain submake=0Amake[1]: Le=
aving directory '/home/x/makefilebug'=0A=0A# Make 4.4.1=0A=0A$ make withdir=
=0Amake[1]: Entering directory '/home/x/makefilebug'=0Ain submake=0Amake[1]=
: Leaving directory '/home/x/makefilebug'=0A$ make withoutdir=0Ain submake=
=0A$ make withoutdir var=3D1=0Amake[1]: Entering directory '/home/x/makefil=
ebug'=0Amake[1]: *** No rule to make target '--no-print-directory'. Stop.=
=0Amake[1]: Leaving directory '/home/x/makefilebug'=0Amake: *** [Makefile:6=
: withoutdir] Error 2=0A=0A=0ANote that even with 4.3, the presence of a co=
mmandline variable breaks this=0Abehavior (it does print the directory), bu=
t at least it does not fail with an=0Aerror trying to interpret "--no-print=
-directory" as a target name like 4.4.1.=0A=0AI'm not saying that my expect=
ation is fully correct, but nevertheless the=0Ashown construct has been wor=
king with previous versions (or at least it was=0Anot causing an error exit=
).=0A=0A=0A _______________________________________________________=0A=
=0AReply to this item at:=0A=0A <https://savannah.gnu.org/bugs/?68018>=0A=
=0A_______________________________________________=0AMessage sent via Savan=
nah=0Ahttps://savannah.gnu.org/=0A
--8323329-1714636915-1775069178=:1903180
Content-Type: APPLICATION/pgp-signature; name=signature.asc
-----BEGIN PGP SIGNATURE-----
iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCac1n+gAKCRCqLAuaBUf3
Tp+KAQDtM3MT+PjJBnME1XyIMwZfIbo2L+cDKtP+t7o8mWesEAD+KYJf7eSnFjSg
pWnwJuICNErXR/ndz721abEyVo/CKw8=
=MPif
-----END PGP SIGNATURE-----
--8323329-1714636915-1775069178=:1903180--