On Wed, Jul 14, 2010 at 2:03 PM, Leandro Lucarella <[email protected]> wrote:
> Just to clarify, I included the shell in the command invocation to try
> different shells:
>
> all:
> bash -c 'program'
>
> For example.
This may not do what you think though - the result *could* be to execute
/bin/sh -c "bash -c 'program'"
The way to change shells is to set "SHELL := /bin/bash" in the Makefile.
Also, you should consider the "fast path" optimization which removes
the shell entirely - your test case may be being optimized in this
way. There's no particular reason to think it's a problem but it is a
thing you can easily vary and measure. Append a ";" to the command
line to defeat the optimization and guarantee a shell.
I would also experiment using the following little Makefile:
% cat Makefile
all: ; $(SHELL)
Now when you type "make" you will have reproduced the exact[*]
environment within which your test is executed, but interactively.
This makes it easy to do things like running it from the command line
while still "within make", comparing the environment from inside and
out, etc.
[*] It may not be quite exact because, depending on shell, an
interactive invocation may drag in different config files from a
non-interactive one. But I gather you've already ruled out shell
startup issues.
David Boyce
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make