On Wed, 2010-12-08 at 14:20 -0500, Chris Cross wrote: > > Trying to understand how $(error) works. The manual says "error is > generated whenever this function is evaluated." With the makefile below I > would expect to see output from line1 of the recipe but only see output > from $(error). > # error.mk > .PHONY: target > > target: > @echo recipe line 1 > $(error debug exit recipe line 2) > > $ make -f error.mk > error.mk:5: *** debug exit recipe line 2. Stop.
That's because make evaluates the entire recipe just before it starts the first line of the recipe; it doesn't evaluate the lines one at a time as it's about to execute that line. -- ------------------------------------------------------------------------------- Paul D. Smith <[email protected]> Find some GNU make tips at: http://www.gnu.org http://make.mad-scientist.net "Please remain calm...I may be mad, but I am a professional." --Mad Scientist _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
