[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: -n option not working under selected circumstances
From: |
Paul Smith |
Subject: |
Re: -n option not working under selected circumstances |
Date: |
Thu, 21 Jan 2010 11:35:10 -0500 |
On Thu, 2010-01-21 at 18:17 +0100, gabriele balducci wrote:
> t1 :
> rm -f ./mom && touch ./mom && echo "$(MAKE)"
>
> All works as if the `-n' option is not honored when the variable
> $(MAKE) (and apparently only that) is referenced in a target's shell
> line:
>
> make -n t1 will create ./mom (while it should not)
This is not a bug in make, per se, it's an error in the makefile. This
behavior is documented in the manual, where it says:
The `-n', `-t', and `-q' options do not affect command lines
that
begin with `+' characters or contain the strings `$(MAKE)' or
`${MAKE}'. Note that only the line containing the `+' character
or the strings `$(MAKE)' or `${MAKE}' is run regardless of these
options.
The makefile needs to not use the MAKE variable in a context where it
would do bad things given -n.