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: Cristian Zoicas
Subject: Re: how to enfore execution of some commands.
Date: Thu, 18 Dec 2003 16:08:42 +0100 (MET)


> >
> > 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".
>

Thank you very much for your answer.

> 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.

Good point.


>
> 2. using $(shell) is much clearer than the "include"-"rule" thing.
>

:)))

If you do this way (I've tried) then the $(shell) statement is executed
two times  because of the regeneration of the file "generated.mak" even
if the statement is found in the file "Makefile".

I asked some weeks on this mailing list ago why the $(shell) statement is
executed two times and I found that this behavior is by design.

>
> 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]