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