Re: Negating --no-print-directory

Paul Smith <[email protected]>
Newsgroups gmane.comp.gnu.make.bugs
Organization GNU's Not UNIX!
Message-ID <[email protected]>
On Mon, 2025-02-10 at 03:40 +0900, Masahiro Yamada wrote:
> ifeq ($(SUBMAKE),)
> MAKEFLAGS += --no-print-directory
> MAKEFLAGS += -rR
> all:
>         @echo in top: MAKEFLAGS=$(MAKEFLAGS)
>         $(MAKE) -w SUBMAKE=1
> else
> all:
>         @echo in submake: MAKEFLAGS=$(MAKEFLAGS)
> endif
> 
> 
> $ make
> in top: MAKEFLAGS=rR --no-print-directory --print-directory
> make SUBMAKE=1
> in submake: MAKEFLAGS=rR --no-print-directory -- SUBMAKE=1

You don't specify which version of GNU Make you're using, but this
works as expected in the current release:

  ~$ make --version
  GNU Make 4.4.1
    ...

  ~$ make
  in top: MAKEFLAGS=rR --no-print-directory
  make -w SUBMAKE=1
  make[1]: Entering directory '/tmp/foo'
  in submake: MAKEFLAGS=rRw -- SUBMAKE=1
  make[1]: Leaving directory '/tmp/foo'
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.