Greetings,
I'd like to build two libtool libs from the same sources using different
CFLAGS. Following the "ctags/etags" example on the info page, I did the
following:
lib_LTLIBRARIES = libtwo2.la libtwo.la
# Yes, I know _OBJECTS isn't kosher, but don't see another way to do
it...
libtwo2_la_OBJECTS = twostep2.lo overhead2.lo boundary2.lo
libtwo2_la_LDFLAGS = -version-info 0:0:0 $(BLAS_LIBS)
libtwo_la_SOURCES = twostep.c overhead.c boundary.c
libtwo_la_LDFLAGS = -version-info 0:0:0 $(BLAS_LIBS)
# This is from the automake info page, generating multiple .os from each
.c:
# (adapted for libtool :-)
twostep.lo: $(srcdir)/twostep.c twostep2.lo
$(LTCOMPILE) $(INCLUDES) -c $<
twostep2.lo: $(srcdir)/twostep.c
$(LTCOMPILE) $(INCLUDES) -DSHIFT=2 -c $< && mv twostep.lo twostep2.lo
&& mv twostep.o twostep2.o
overhead.lo: $(srcdir)/overhead.c overhead2.lo
$(LTCOMPILE) $(INCLUDES) -c $<
overhead2.lo: $(srcdir)/overhead.c
$(LTCOMPILE) $(INCLUDES) -DSHIFT=2 -c $< && mv overhead.lo overhead2.lo
&& mv overhead.o overhead2.o
boundary.lo: $(srcdir)/boundary.c boundary2.lo
$(LTCOMPILE) $(INCLUDES) -c $<
boundary2.lo: $(srcdir)/boundary.c
$(LTCOMPILE) $(INCLUDES) -DSHIFT=2 -c $< && mv boundary.lo boundary2.lo
&& mv boundary.o boundary2.o
The problem, of course, is that twostep2_la_OBJECTS is not kosher, but
it works, and there's no other way to generate the .lo files and have
them built into a library. The ctags example has the .o files in LDADD;
doing that results in no .lo objects. Putting .los into LDADD, LIBADD
or DEPENDENCIES doesn't work- it dies looking for twostep.lo.c etc.
I'd leave it as is, but make dist won't allow it.
What can I do?
-Adam P.