On 2010-07-14 14:52Z, Leandro Lucarella wrote: > Long story short, I have a program that when executed from a shell it > takes about 3 seconds to complete, but when executed via make, it takes > 5 seconds.
I trivially modified your very clear testcase here: > http://www.llucax.com.ar/blog/blog/post/-7a56a111 to run a unit-test program of my own, but didn't see any penalty: $echo 'all:' > Makefile $echo -e '\t$C' >> Makefile $make C="./elapsed_time ./zero_test-a" ./elapsed_time ./zero_test -a Elapsed time: 43 milliseconds $./elapsed_time ./zero_test -a Elapsed time: 43 milliseconds > Is there anything make does to the environment (in a general sense, not > only environment variables) before executing commands that could cause > a difference like this? To diagnose this further, you might try echoing the precise time - before you start 'make' - just before running your test program - just after running your test program - right after 'make' ends My first guess would be that the difference you observe is shell startup time. I realize that you have evidence that argues against that (because only one test program seems to be affected). But you have already measured running your program directly: /usr/bin/time -f%e ./voronoi -n 30000 and it wouldn't hurt to run sh -c '/usr/bin/time -f%e ./voronoi -n 30000' just to see whether that takes remarkably longer. If you have defined a $SHELL variable in the environment, 'make' will use that instead of '/bin/sh'. _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
