Subject: Re: make's .CURDIR availably anywhere else?
To: None <netbsd-users@NetBSD.ORG>
From: Peter Simons <simons@rhein.de>
List: netbsd-users
Date: 01/30/1998 07:24:37
-----BEGIN PGP SIGNED MESSAGE-----
Peter Simons <simons@rhein.de> writes:
> the .CURDIR variable defined by make(1) is immensely useful for me
> when constructing larger projects [...]
Sorry for following up to my own post, but I'd like to clarify on this
subject: Actually .CURDIR is not useful to me at all, as I have found
out after actually using it. :-)
So maybe someone can help me nonetheless. I have the following setup:
my_program
my_program/test.c
my_program/Makefile
my_program/liba
my_program/liba/a.c
my_program/liba/Makefile.inc
my_program/libb
my_program/libb/b.c
my_program/libb/Makefile.inc
In both subdirectories of the project, I'll need to build a liba.a and
libb.a respectively and link it with test.o, to form the main binary.
Usually people build the Makefiles to work recursively in this case,
but that's something I want to avoid. I want the Makefile in the top
of the tree to include the other Makefiles so that I have all the
build and dependency information in just one file, technically
speaking.
The problem with .CURDIR is, that it will always be pointing at
"my_program" and never at "my_program/liba", since it isn't
reevaluated when including another Makefile.
It seems that VPATH is designed to archieve what I have in mind but
then VPATH is again not compatible between BSD make and GNU make.
*sigh*
Does anyone have any ideas how to do this trick?
-peter
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: latin1
iQCVAwUBNNFyJQ9HL1s0103BAQHXrwQAp+OjHdBJdXLa/xNQIR3cKP6ihPgJCFX4
FitKhrRqN6JFBg+NGQOYJuecgZXE0Ot3KCfjEjGDnMhf9+aM0cQZ0la9M4JDFhU6
eMIhF3ZJUEDHluK4CTUdmuQzwlX1Sk6ITOTTnqpXEWKY1E5REmGyf9JqdUnVnVvP
KqbXgeWuC0Q=
=rLoQ
-----END PGP SIGNATURE-----