On Monday, 6 November, Martin Sebor ([EMAIL PROTECTED]) wrote: > I must be missing something but I don't see why the trap special > builtin wouldn't work the same in a make rule as in shell. Could > someone enlighten me? I expect the make output below to be 1 but > I get 0 instead. > > $ (trap 'echo $?' EXIT && exit 1) > 1 > $ echo "foo:; trap 'echo \$\$?' EXIT && exit 1" > mf \ > && gmake -f mf foo > trap 'echo $?' EXIT && exit 1 > 0 > gmake: *** [foo] Error 1
It works for me. Maybe it's your shell? Remember that make uses /bin/sh to run all of its commands. On my system /bin/sh is really bash but maybe your /bin/sh is something else. Also, what version of make are you using? $ echo "foo:; trap 'echo \$\$?' EXIT && exit 1" | make -f - trap 'echo $?' EXIT && exit 1 1 make: *** [foo] Error 1 -- ------------------------------------------------------------------------------- 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://lists.gnu.org/mailman/listinfo/help-make
