help-make
[Top][All Lists]
Advanced

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

Re: how to enfore execution of some commands.


From: Noel Yap
Subject: Re: how to enfore execution of some commands.
Date: Thu, 18 Dec 2003 09:53:39 -0500

Cristian Zoicas wrote:
> Solution 2 (is this the correct one ?)
> --------------------------------------
> 
> To  put the  following statments  in the  file Makefile.mak before the
> statment including "generated.mak"
> 
> ifneq ($(MAKECMDGOALS),main_target)
> 
> include print_start_message
> 
> print_start_message:
> 
>        echo "Makefile executed at" `date` > build.log
> 
> endif
> 
> when  "Makefile" will be  executed, it  will try  to include  the file
> "print_start_message". This file does not  exist  and make will try to
> regenerate it. It  will find a rule to generate it  and this rule will
> print some messages  in the file "build.log" but  it will not generate
> any makefile "print_start_message".

I see a couple of improvements here:
1. "include print_start_message" really should be "-include 
print_start_message" so that no warning message is generated.
2. using $(shell) is much clearer than the "include"-"rule" thing.

HTH,
Noel
-- 
NOTICE: If received in error, please destroy and notify sender.  Sender does 
not waive confidentiality or privilege, and use is prohibited.




reply via email to

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