[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Nested calls of make in secondary expansions cause "command not foun
Re: Nested calls of make in secondary expansions cause "command not found"
Fri, 31 May 2019 08:51:48 -0400
On Fri, 2019-05-31 at 11:50 +1000, Robert Prije wrote:
> $$(make bar)
> @echo "echo bar"
> (tabs seem to have been lost. Please insert as necessary)
> results in the following error:
> $ make foo
> $(make bar)
> /bin/sh: make:: command not found
> make: *** [Makefile:2: foo] Error 127
> strace confirms that make really is trying to find a file named
> "make" including the "" suffix.
If you change the makefile to simply run the command and print the
output, instead of trying to execute it, you'll see the problem.
By default when make recurses it prints a note about this to stdout so
the user knows that a new makefile has been invoked:
make: Entering directory '/tmp'
make: Leaving directory '/tmp'
If you want to avoid these messages, you need to use the
--no-print-directory option; write your makefile with:
$$($(MAKE) --no-print-directory bar)
@echo "echo bar"
(you should always use $(MAKE), never just make, when invoking make