help-make
[Top][All Lists]
Advanced

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

RE: include and reparsing Makefile


From: Warlich, Christof
Subject: RE: include and reparsing Makefile
Date: Wed, 17 Apr 2013 11:55:46 +0000

> 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".
Yes, that's what I expected.

> 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.
Ah, silly me .... that make sense. I think I had the misconception that the
- before the include statement is needed because reparse.mk is _initially_
not there.

Anyhow, thanks a lot for your help.

-----Original Message-----
From: Paul Smith [mailto:address@hidden 
Sent: Mittwoch, 17. April 2013 12:51
To: Warlich, Christof
Cc: address@hidden
Subject: Re: include and reparsing Makefile

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]