automake
[Top][All Lists]
Advanced

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

[automake] Multiple Compilations of Same Library


From: Drummonds, Scott B
Subject: [automake] Multiple Compilations of Same Library
Date: Wed, 4 Feb 2004 14:11:58 -0800

Hi again, all,

I figured out a workaround to my conditional build problem yesterday and am now stuck on a different problem.  Given my lack of experience with automake, I'm hoping that one of you can help me out.

Remember that I want to have two versions of a given library, which I'll call libMine.a and libMineFeature.a.  The second library uses the same source as the first, but compiles each source file with "-DFEATURE".  The solution to this looks generally like this:

  libMineFeature_a_SOURCES = $(libMine_a_SOURCES)
  libMineFeature_a_CXXFLAGS = -DFEATURE

The problem with this is that first the objects of libMine.a are created without "-DFEATURE".  Then the 'make' process reuses these objects to make libMineFeature.a.  Obviously, this reuse means that libMineFeature.a was actually compiled with objects that did not have FEATURE defined.  I can 'make clean' and call 'make libMyFeature.a' successfully, but I can't have both libraries built with one call to 'make' without them sharing objects that were compiled the same way.

Ideally, I'd like to have intermediate files created from each source.  So, instead of just changing source files from ".cpp" to ".o", they would be changed to something like "-feature.o" to denote that the object file was created with the FEATURE preprocessor token defined.  However, I have no idea how to do this without putting a lot of library-specific text in Makefile.am.

Can anyone recommend a sequence of commands that I can put in my Makefile.am's that can be reused for the many libraries that I want rebuilt in this manner?  Obviously simplicity and generality are goals.

Thanks,
Scott


reply via email to

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