build: quit abusing AM_CPPFLAGS

Now that the build is non-recursive, adding to AM_CPPFLAGS means adding to
_all_ cppflags.

Logical groups of includes have been added instead, and are used individually
by various targets.
This commit is contained in:
Cory Fields 2014-06-05 15:24:48 -04:00
parent 56c157d5e0
commit f4d81129f0
4 changed files with 21 additions and 25 deletions

View file

@ -1,11 +1,6 @@
AM_CPPFLAGS = $(INCLUDES) \ AM_CPPFLAGS = $(INCLUDES)
-I$(builddir)/obj \
$(BDB_CPPFLAGS) \
$(BOOST_CPPFLAGS) $(BOOST_INCLUDES)
AM_CPPFLAGS += $(LEVELDB_CPPFLAGS)
AM_LDFLAGS = $(PTHREAD_CFLAGS) AM_LDFLAGS = $(PTHREAD_CFLAGS)
AM_CPPFLAGS += -I$(builddir)
if EMBEDDED_LEVELDB if EMBEDDED_LEVELDB
LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include
@ -22,11 +17,14 @@ $(LIBLEVELDB) $(LIBMEMENV):
OPT="$(CXXFLAGS) $(CPPFLAGS)" OPT="$(CXXFLAGS) $(CPPFLAGS)"
endif endif
BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS)
noinst_LIBRARIES = \ noinst_LIBRARIES = \
libbitcoin_server.a \ libbitcoin_server.a \
libbitcoin_common.a \ libbitcoin_common.a \
libbitcoin_cli.a libbitcoin_cli.a
if ENABLE_WALLET if ENABLE_WALLET
BITCOIN_INCLUDES += $(BDB_CPPFLAGS)
noinst_LIBRARIES += libbitcoin_wallet.a noinst_LIBRARIES += libbitcoin_wallet.a
endif endif
@ -106,6 +104,7 @@ obj/build.h: FORCE
$(abs_top_srcdir) $(abs_top_srcdir)
version.o: obj/build.h version.o: obj/build.h
libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES)
libbitcoin_server_a_SOURCES = \ libbitcoin_server_a_SOURCES = \
addrman.cpp \ addrman.cpp \
alert.cpp \ alert.cpp \
@ -130,6 +129,7 @@ libbitcoin_server_a_SOURCES = \
$(JSON_H) \ $(JSON_H) \
$(BITCOIN_CORE_H) $(BITCOIN_CORE_H)
libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES)
libbitcoin_wallet_a_SOURCES = \ libbitcoin_wallet_a_SOURCES = \
db.cpp \ db.cpp \
crypter.cpp \ crypter.cpp \
@ -139,6 +139,7 @@ libbitcoin_wallet_a_SOURCES = \
walletdb.cpp \ walletdb.cpp \
$(BITCOIN_CORE_H) $(BITCOIN_CORE_H)
libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES)
libbitcoin_common_a_SOURCES = \ libbitcoin_common_a_SOURCES = \
base58.cpp \ base58.cpp \
allocators.cpp \ allocators.cpp \
@ -184,8 +185,8 @@ if TARGET_WINDOWS
bitcoind_SOURCES += bitcoind-res.rc bitcoind_SOURCES += bitcoind-res.rc
endif endif
AM_CPPFLAGS += $(BDB_CPPFLAGS)
bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS)
bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES)
# bitcoin-cli binary # # bitcoin-cli binary #
bitcoin_cli_LDADD = \ bitcoin_cli_LDADD = \
@ -193,6 +194,7 @@ bitcoin_cli_LDADD = \
libbitcoin_common.a \ libbitcoin_common.a \
$(BOOST_LIBS) $(BOOST_LIBS)
bitcoin_cli_SOURCES = bitcoin-cli.cpp bitcoin_cli_SOURCES = bitcoin-cli.cpp
bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES)
# #
if TARGET_WINDOWS if TARGET_WINDOWS

View file

@ -1,8 +1,3 @@
AM_CPPFLAGS += -I$(srcdir) \
-I$(builddir)/qt \
-I$(builddir)/qt/forms \
$(PROTOBUF_CFLAGS) \
$(QR_CFLAGS)
bin_PROGRAMS += qt/bitcoin-qt bin_PROGRAMS += qt/bitcoin-qt
noinst_LIBRARIES += qt/libbitcoinqt.a noinst_LIBRARIES += qt/libbitcoinqt.a
@ -319,8 +314,12 @@ RES_MOVIES = $(wildcard qt/res/movies/spinner-*.png)
BITCOIN_RC = qt/res/bitcoin-qt-res.rc BITCOIN_RC = qt/res/bitcoin-qt-res.rc
qt_libbitcoinqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ BITCOIN_QT_INCLUDES = -I$(builddir)/qt -I$(srcdir)/qt -I$(srcdir)/qt/forms \
-I$(srcdir)/qt/forms $(QT_DBUS_INCLUDES) -I$(builddir)/qt/forms
qt_libbitcoinqt_a_CPPFLAGS = $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
$(QT_INCLUDES) $(QT_DBUS_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS)
qt_libbitcoinqt_a_SOURCES = $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(QT_FORMS_UI) \ qt_libbitcoinqt_a_SOURCES = $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(QT_FORMS_UI) \
$(QT_QRC) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(QT_QRC) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES)
@ -341,8 +340,9 @@ $(QT_MOC): $(PROTOBUF_H)
$(QT_MOC_CPP): $(PROTOBUF_H) $(QT_MOC_CPP): $(PROTOBUF_H)
# bitcoin-qt binary # # bitcoin-qt binary #
qt_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ qt_bitcoin_qt_CPPFLAGS = $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
-I$(srcdir)/qt/forms $(QT_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS)
qt_bitcoin_qt_SOURCES = qt/bitcoin.cpp qt_bitcoin_qt_SOURCES = qt/bitcoin.cpp
if TARGET_DARWIN if TARGET_DARWIN
qt_bitcoin_qt_SOURCES += $(BITCOIN_MM) qt_bitcoin_qt_SOURCES += $(BITCOIN_MM)

View file

@ -1,8 +1,3 @@
AM_CPPFLAGS += -I$(srcdir) \
-I$(srcdir)/qt \
-I$(builddir)/qt \
$(PROTOBUF_CFLAGS) \
$(QR_CFLAGS)
bin_PROGRAMS += qt/test/test_bitcoin-qt bin_PROGRAMS += qt/test/test_bitcoin-qt
TESTS += qt/test/test_bitcoin-qt TESTS += qt/test/test_bitcoin-qt
@ -17,7 +12,8 @@ TEST_QT_H = \
qt/test/paymentrequestdata.h \ qt/test/paymentrequestdata.h \
qt/test/paymentservertests.h qt/test/paymentservertests.h
qt_test_test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) $(QT_TEST_INCLUDES) qt_test_test_bitcoin_qt_CPPFLAGS = $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \
$(QT_INCLUDES) $(QT_TEST_INCLUDES)
qt_test_test_bitcoin_qt_SOURCES = \ qt_test_test_bitcoin_qt_SOURCES = \
qt/test/test_main.cpp \ qt/test/test_main.cpp \

View file

@ -1,5 +1,3 @@
AM_CPPFLAGS += -I$(builddir)/test/
TESTS += test/test_bitcoin TESTS += test/test_bitcoin
bin_PROGRAMS += test/test_bitcoin bin_PROGRAMS += test/test_bitcoin
TEST_SRCDIR = test TEST_SRCDIR = test
@ -62,7 +60,7 @@ BITCOIN_TESTS += \
endif endif
test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES)
test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(TESTDEFS) test_test_bitcoin_CPPFLAGS = $(BITCOIN_INCLUDES) -I$(builddir)/test/ $(TESTDEFS)
test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \
$(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB)
if ENABLE_WALLET if ENABLE_WALLET