help-make
[Top][All Lists]
Advanced

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

Re: $(eval) and shell variables help


From: Paul D. Smith
Subject: Re: $(eval) and shell variables help
Date: Wed, 20 Nov 2002 15:58:18 -0500

%% "Anoni" <address@hidden> writes:

  a> I am using $(eval) to dynamically generate a set of rules (one for
  a> each source file/targets) and need to prevent the Make from
  a> updating the target (using touch) if there is an error detected
  a> from a command I executed as part of the rule.  Is there a way to
  a> do this?

Your question doesn't have anything to do with eval; it would be the
same question if you had written out the rules by hand instead of
dynamically generating them... do you see that?  It's an important
thing to grok.

So, let's hypothesize you had written this rule:

  foo:
        @some_command; \
         touch $@

Now you want to change this so that the touch does not run if
some_command fails.

Much of this depends on what some_command actually is; if it's a single
command invocation you can do something simple like:

   @some_command && touch $@

Really, though, this is not a make question at all: it's a shell
scripting question.  All versions of make (on UNIX) invoke sh (the
Bourne shell), so that's where you want to look to get help with how to
write the scripts.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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