|
From: Nicholas N. <nj...@ca...> - 2003-04-09 12:48:23
|
Hi,
I have a question about automake.
The Memcheck and Addrcheck skins share some code, in two files.
These shared files are stored in the memcheck/ directory. Previously, I
was having Addrcheck's ac_main.c #include the .c files directly. But this
is kind of nasty.
So I want to change it so it simply links them in when vgskin_addrcheck.so
is being made. I've done this using an "LDADD" variable in
addrcheck/Makefile.am, like so:
vgskin_addrcheck_so_SOURCES = ac_main.c
vgskin_addrcheck_so_LDFLAGS = -shared
vgskin_addrcheck_so_LDADD = \
mac_leakcheck.c \
mac_needs.c
This works, on one condition -- that mac_leakcheck.o and mac_needs.o have
been built beforehand. I can force this by changing the order of the
SUBDIRS variable in to the top-level Makefile.am so that Memcheck is built
ahead of Addrcheck, but this seems a bit ad hoc. I want a nice way to
specify in addrcheck/Makefile.am "please compile these files first".
I tried changing the SUBDIRS variable in addrcheck/Makefile.am to this:
SUBDIRS = ../memcheck . docs tests
but automake doesn't like the "..".
Does anyone know if there's a way with automake to force the
pre-compilation of files in other directories that aren't subdirectories
of the current one?
Thanks.
N
|
|
From: Nicholas N. <nj...@ca...> - 2003-04-09 13:08:11
|
On Wed, 9 Apr 2003, Nicholas Nethercote wrote:
> vgskin_addrcheck_so_SOURCES = ac_main.c
> vgskin_addrcheck_so_LDFLAGS = -shared
> vgskin_addrcheck_so_LDADD = \
> mac_leakcheck.c \
> mac_needs.c
[sigh] that should read
vgskin_addrcheck_so_SOURCES = ac_main.c
vgskin_addrcheck_so_LDFLAGS = -shared
vgskin_addrcheck_so_LDADD = \
../memcheck/mac_leakcheck.o \
../memcheck/mac_needs.o
N
|