This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: what is this shell call trying to solve?


Phil Edwards <pedwards@dmapub.dma.org> writes:

> Been playing with 1.5 and have been pretty pleased with the support for
> source files in subdirectories.  I have noticed however something which
> strikes me as odd:
>
>    % make
>    make  all-am
>    make[1]: Entering directory `/tmp/pme/foo'
>    source='/home/pme/easysems/main.cc' object='main.o' libtool=no \
>    depfile='.deps/main.Po' tmpdepfile='.deps/main.TPo' \
>    depmode=gcc3 /bin/sh /home/pme/easysems/depcomp \
> *  g++ -DHAVE_CONFIG_H -I. -I/home/pme/easysems -I. -g -O2 -c -o
> *    main.o `test -f /home/pme/easysems/main.cc ||
> *    echo '/home/pme/easysems/'`/home/pme/easysems/main.cc
>    g++  -g -O2   -o semmanip  getopt.o getopt1.o semmanip_opts.o main.o
>    make[1]: Leaving directory `/tmp/pme/foo'
>    %
>
> The call to the compiler, broken across three lines here and marked with
> '*', uses a shell expansion which doesn't make any sense.  Something is
> visibly wrong here, but I don't know what.  Everything works, but it
> looks like it's trying to test for a failure condition and... I dunno,
> do something strang in that condition.

That code is there support non-srcdir builds in the face of 'make's
with broken VPATH implementations.  If you look at the Makefile,
you'll see that it is checking to see whether 'make' said that the
source file was in $(srcdir), and if not, the 'echo' supplies the
$(srcdir).

- Hari
-- 
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]