help-make
[Top][All Lists]
Advanced

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

Re: variable value lost with "include" directive


From: Aditya Kher
Subject: Re: variable value lost with "include" directive
Date: Fri, 6 Oct 2006 15:16:51 +0530

No, they're carried through.  You can verify this by adding this line
to ../../bin/Makefile right after the VPATH appending:

$(warning VPATH=${VPATH})

That was helpful.

Is the '../include' directory relative to the directory in which you
invoked gmake?  If not, that's your problem.  'include' does not
change the base directory from which make interprets relative paths.


Yes. it was a gotcha. Thanks. But lets say, if

the bin/Makefile is going to be included from directories foo/Makefile
and boo_internal/Makefile:

some_dir
  |
  |
 +--bin/Makefile
  |
  |
 +--foo/Makefile
  |
  |
 +--boo/Makefile
  |      |
  |      +--boo_internal/Makefile
  |
 +---coo

Then is the only place to specify the VPATH is in
boo_internal/Makefile, boo/Makefile and NOT in bin/Makefile? Beacuse
as you correctly mentioned
"'include' does not  change the base directory from which make
interprets relative paths."

(frankly I would like to specify the VPATH in bin/Makefile since- the
paths are related to stuff that is processed in bin/Makefile. The
paths do not make sense in Makefiles that call the bin/Makefiles)

Ideas?
-aditya




reply via email to

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