help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: include and reparsing Makefile


From: Paul Smith
Subject: Re: include and reparsing Makefile
Date: Wed, 17 Apr 2013 06:50:43 -0400

On Wed, 2013-04-17 at 06:18 +0000, Warlich, Christof wrote:

> nothing:
> reparse.mk: mayOrMayNotExist ; @echo would remake $@
> -include reparse.mk
> 
> When I call make while the file mayOrMayNotExist does exist, I get:
> 
> $ touch mayOrMayNotExist
> $ make
> would remake reparse.mk
> make: Nothing to be done for `nothing'
> 
> But when the file mayOrMayNotExist  does _not_ exist, I only get
> 
> $ rm -f mayOrMayNotExist
> $ make
> make: Nothing to be done for `nothing'.

If mayOrMayNotExist exists then make has a rule that knows how to build
reparse.mk.  Since mayOrMayNotExist is newer than reparse.mk (you just
touched it), make will run the rule then re-exec itself.

It's not clear from your message whether you understand that part; if
not see the GNU make manual section "How Makefiles are Remade".

If mayOrMayNotExist does not exist then the rule to remake reparse.mk
fails because the prerequisite does not exist and make doesn't know how
to create it.

However, because you requested the "-include" form, rather than just
"include", the normal error message is suppressed and the build proceeds
without any message.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]