automake
[Top][All Lists]
Advanced

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

AM_CONDITIONAL to choose between building library or linking directly


From: Fabrício Zimmerer Murta
Subject: AM_CONDITIONAL to choose between building library or linking directly
Date: Tue, 11 Sep 2012 15:41:53 -0300

Is that supposed not to work?

(“LIBRARY_BUILD” AM_CONDITIONAL set accordingly on configre.ac)
Makefile.am:

if LIBRARY_BUILD
lib_LTLIBRARIRES = libprog.la
libprog_la_SOURCES = a.c b.c d.c
else !LIBRARY_BUILD
bin_PROGRAMS = driver
driver_SOURCES = a.c b.c d.c driver.c
endif !LIBRARY_BUILD

if LIBRARY_BUILD
a.lo: a.c b.lo
b.lo: b.c
d.lo: d.c a.lo b.lo
else !LIBRARY_BUILD
a.o: a.c b.o
b.o: b.c
d.o: d.c a.o b.o
driver.o: driver.c a.o b.o d.o
endif !LIBRARY_BUILD

### 
With a setup like this I get errors like
Makefile.am: object ‘a.$(OBJEXT)’ created both with libtool and without
for a, b and d source files. Removing ‘a.c’ from one of the libprog_la_SOURCES 
-or- driver_SOURCES takes out the error message but also renders either the 
library or driver unbuildable...

thank ya.

p.s.: I am using fortran, so I -must- build rules manually. anyway, the problem 
part is at the ‘*_SOURCES =’ definition.


reply via email to

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