help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Odd effects from setting SHELL?


From: Christian Convey
Subject: Odd effects from setting SHELL?
Date: Thu, 21 Jun 2007 14:48:24 -0400

Can anyone explain why I'm seeing the following?

I've been handed a project set up like this:

/home/cjc/src/make_config.mk
/home/cjc/src/make_lib.mk
/home/cjc/src/lib_foo/Makefile
/home/cjc/src/lib_foo/x.cpp

The idea is that Makefile sets some variables such as LIBRARY_NAME,
and then "include"s the two .mk files.  Those .mk files end up
defining the "all:" target so that it will build the library whose
filename is given by LIBRARY_NAME.

When I just do this:
  cd /lib_foo; make all
everything works just fine.

But when I do *this*:
  cd /lib_foo; make SHELL=/bin/csh all
things *don't* work fine:

The "%.o: %.cpp" rule in make_lib.mk invokes gcc.  When I don't
explicitly set SHELL, gcc's current working directory is /src/lib_foo
(which is what I want.)  When I *do* set SHELL, gcc's working
directory is my home directory, /home/cjc/.  gcc is then unable to
find the source code files, and fails.

Now to make this even weirder, this happens on one computer but not on
another.  On my older Debian box (gmake 3.80), I have this problem.
On my newer Ubuntu box (gmake 3.81) I don't get this problem.

I tried using remake-3.80+dbg-0.62 (on both computers) to debug this
issue, and once again the problem is present on the older Debian
computer but everything works ok on my Ubuntu 7.04 computer.

Anyone know what might be going on?

P.S. The reason I'm setting SHELL at all is that some of the commands
within the makefiles need to redirect both stdout and stderr to
/dev/null.  tcsh and bash have different ways of doing this, so I was
trying to force the use of some particular shell by our makefiles.

Thanks,
Christian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]