I am using $(eval) to dynamically generate a set of rules (one for each source file/targets) and need to prevent the Make from updating the target (using touch) if there is an error detected from a command I executed as part of the rule. Is there a way to do this?
Thanks. ----- Original Message ----- From: "Paul D. Smith" <[EMAIL PROTECTED]> To: "Anoni" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, November 20, 2002 12:38 PM Subject: Re: $(eval) and shell variables help > %% "Anoni" <[EMAIL PROTECTED]> writes: > > a> How do you get the value of a shell variable (e.g, exit number) in an > a> $(eval) context? > > I think you're confused about what eval does. > > It does not _run_ a makefile. It only evaluates it: reads it in so that > it's now part of make's internal database. > > a> define TEMPLATE > > a> $(1) : blah blah...; \ > a> @some_command; \ > a> exit_status=...; \ > a> if [ ... != 0 ]; then \ > a> exit 1; \ > a> fi; \ > a> touch $$@; > a> endef > > a> $(foreach t,$(targets),$(eval $(call TEMPLATE,$(t)))) > > This identical to writing the contents of the TEMPLATE variable out by > hand, once for each word in $(targets). > > Neither more nor less. > > Maybe if you described what you were actually trying to do we could give > you better advice. > > -- > -------------------------------------------------------------------------- ----- > Paul D. Smith <[EMAIL PROTECTED]> 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 > > > _______________________________________________ > Help-make mailing list > [EMAIL PROTECTED] > http://mail.gnu.org/mailman/listinfo/help-make > _______________________________________________ Help-make mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/help-make
