[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Make does not throw an error for target without a recipe?
From: |
Paul Smith |
Subject: |
Re: Make does not throw an error for target without a recipe? |
Date: |
Thu, 26 Jun 2014 16:48:34 -0400 |
On Thu, 2014-06-26 at 16:19 -0400, Patrick Donnelly wrote:
> Updating makefiles....
> Considering target file 'test.mk'.
> Looking for an implicit rule for 'test.mk'.
> [...]
>
> Why is it trying to build target test.mk...???
See
http://www.gnu.org/software/make/manual/html_node/Remaking-Makefiles.html
> File 'foo' does not exist.
> Looking for an implicit rule for 'foo'.
> [...]
> No implicit rule found for 'foo'.
> Considering target file '/etc/passwd'.
> Looking for an implicit rule for '/etc/passwd'.
> [...]
> No implicit rule found for '/etc/passwd'.
> Finished prerequisites of target file '/etc/passwd'.
> No need to remake target '/etc/passwd'.
> Finished prerequisites of target file 'foo'.
> Must remake target 'foo'.
> Successfully remade target file 'foo'.
> make: Nothing to be done for 'foo'.
>
> So the interesting thing here is that Make decides it needs to remake
> `foo' but it doesn't do anything (based on strace output). Then it
> decides it was successful?
See:
http://www.gnu.org/software/make/manual/html_node/Force-Targets.html
> That doesn't make any sense... How do I get Make to fail if it can't
> make the target?
You have to give make a recipe to run. Then if the recipe fails (exits
with a non-zero error code), make will fail.
Re: Make does not throw an error for target without a recipe?,
Paul Smith <=
Re: Make does not throw an error for target without a recipe?, Paul Smith, 2014/06/26