Refine inter-library dependency build specification.

Specifically, the "CPPFLAGS" are for users only.  We must never modify
these flags to build a product.  The appropriate system-internal flags
are the "AM_CPPFLAGS".

Moreover, the "LIBS" variable is an implementation detail that should
not be directly modified by a particular build system.  Inter-library
link dependencies should be specified in the <library>_LDFLAGS.  See,
for instance,
http://www.gnu.org/software/automake/manual/html_node/Libtool-Flags.html
This commit is contained in:
Bård Skaflestad 2012-04-10 16:13:12 +02:00
parent b1bce20707
commit ac34424424

View File

@ -3,13 +3,16 @@ ACLOCAL_AMFLAGS = -I m4
# Recurse to build examples after libraries
SUBDIRS = . tests examples
CPPFLAGS += $(BOOST_CPPFLAGS)
LIBS += $(BOOST_LDFLAGS) \
$(BOOST_FILESYSTEM_LIB) \
$(BOOST_SYSTEM_LIB) \
$(BOOST_DATE_TIME_LIB) \
$(BOOST_UNIT_TEST_FRAMEWORK_LIB) \
$(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
AM_CPPFLAGS = \
$(BOOST_CPPFLAGS)
libopmcore_la_LDFLAGS = \
$(BOOST_LDFLAGS) \
$(BOOST_FILESYSTEM_LIB) \
$(BOOST_SYSTEM_LIB) \
$(BOOST_DATE_TIME_LIB) \
$(BOOST_UNIT_TEST_FRAMEWORK_LIB) \
$(LAPACK_LIBS) $(BLAS_LIBS) $(LIBS) $(FLIBS)
# Declare libraries
lib_LTLIBRARIES = libopmcore.la