From 65e8ba4dbed519a3be6d497063c3441550c4b3d6 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 28 May 2014 13:38:41 -0400 Subject: [PATCH 1/8] build: Switch to non-recursive make Build logic moves from individual Makefile.am's to include files, which the main src/Makefile.am includes. This avoids having to manage a gigantic single Makefile. TODO: Move the rules from the old Makefile.include to where they actually belong and nuke the old file. --- configure.ac | 5 +- src/Makefile.am | 21 +- src/Makefile.include | 17 +- src/Makefile.qt.include | 387 ++++++++++++++++++++++++++++++++++++ src/Makefile.qttest.include | 52 +++++ src/Makefile.test.include | 87 ++++++++ 6 files changed, 550 insertions(+), 19 deletions(-) create mode 100644 src/Makefile.qt.include create mode 100644 src/Makefile.qttest.include create mode 100644 src/Makefile.test.include diff --git a/configure.ac b/configure.ac index 3a8d33a5a..d8521ad3a 100644 --- a/configure.ac +++ b/configure.ac @@ -666,6 +666,9 @@ AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin]) AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin]) AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows]) AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet == xyes]) +AM_CONDITIONAL([ENABLE_TESTS],[test x$use_tests == xyes]) +AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt == xyes]) +AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$use_tests$bitcoin_enable_qt_test = xyesyes]) AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes]) AM_CONDITIONAL([USE_LCOV],[test x$use_lcov == xyes]) AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno]) @@ -695,7 +698,7 @@ AC_SUBST(LEVELDB_TARGET_FLAGS) AC_SUBST(BUILD_TEST) AC_SUBST(BUILD_QT) AC_SUBST(BUILD_TEST_QT) -AC_CONFIG_FILES([Makefile src/Makefile src/test/Makefile src/qt/Makefile src/qt/test/Makefile share/setup.nsi share/qt/Info.plist]) +AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist]) AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh]) AC_CONFIG_FILES([qa/pull-tester/build-tests.sh],[chmod +x qa/pull-tester/build-tests.sh]) AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index a49ad5871..e7d121b4d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,6 +11,7 @@ noinst_LIBRARIES += libbitcoin_wallet.a endif bin_PROGRAMS = +TESTS = if BUILD_BITCOIND bin_PROGRAMS += bitcoind @@ -20,8 +21,6 @@ if BUILD_BITCOIN_CLI bin_PROGRAMS += bitcoin-cli endif -SUBDIRS = . $(BUILD_QT) $(BUILD_TEST) -DIST_SUBDIRS = . qt test .PHONY: FORCE # bitcoin core # BITCOIN_CORE_H = \ @@ -188,16 +187,24 @@ leveldb/%.a: CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \ OPT="$(CXXFLAGS) $(CPPFLAGS)" -qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_common_a_SOURCES) $(libbitcoin_cli_a_SOURCES) - @test -n $(XGETTEXT) || echo "xgettext is required for updating translations" - @cd $(top_srcdir); XGETTEXT=$(XGETTEXT) share/qt/extract_strings_qt.py - CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno DISTCLEANFILES = obj/build.h -EXTRA_DIST = leveldb Makefile.include +EXTRA_DIST = leveldb clean-local: -$(MAKE) -C leveldb clean rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno + +if ENABLE_TESTS +include Makefile.test.include +endif + +if ENABLE_QT +include Makefile.qt.include +endif + +if ENABLE_QT_TESTS +include Makefile.qttest.include +endif diff --git a/src/Makefile.include b/src/Makefile.include index 2fc6cd777..d3d3d6385 100644 --- a/src/Makefile.include +++ b/src/Makefile.include @@ -12,23 +12,18 @@ AM_CPPFLAGS = $(INCLUDES) \ AM_CPPFLAGS += $(LEVELDB_CPPFLAGS) AM_LDFLAGS = $(PTHREAD_CFLAGS) -LIBBITCOIN_SERVER=$(top_builddir)/src/libbitcoin_server.a -LIBBITCOIN_WALLET=$(top_builddir)/src/libbitcoin_wallet.a -LIBBITCOIN_COMMON=$(top_builddir)/src/libbitcoin_common.a -LIBBITCOIN_CLI=$(top_builddir)/src/libbitcoin_cli.a -LIBBITCOINQT=$(top_builddir)/src/qt/libbitcoinqt.a - -$(LIBBITCOIN): - $(MAKE) -C $(top_builddir)/src $(@F) +LIBBITCOIN_SERVER=libbitcoin_server.a +LIBBITCOIN_WALLET=libbitcoin_wallet.a +LIBBITCOIN_COMMON=libbitcoin_common.a +LIBBITCOIN_CLI=libbitcoin_cli.a +LIBBITCOINQT=qt/libbitcoinqt.a if EMBEDDED_LEVELDB $(LIBLEVELDB) $(LIBMEMENV): $(MAKE) -C $(top_builddir)/src leveldb/$(@F) +$(LIBLEVELDB): $(LIBMEMENV) endif -$(LIBBITCOINQT): - $(MAKE) -C $(top_builddir)/src/qt $(@F) - .mm.o: $(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $< diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include new file mode 100644 index 000000000..dcb3f37f5 --- /dev/null +++ b/src/Makefile.qt.include @@ -0,0 +1,387 @@ +AM_CPPFLAGS += -I$(top_srcdir)/src \ + -I$(top_builddir)/src/qt \ + -I$(top_builddir)/src/qt/forms \ + $(PROTOBUF_CFLAGS) \ + $(QR_CFLAGS) +bin_PROGRAMS += qt/bitcoin-qt +noinst_LIBRARIES += qt/libbitcoinqt.a + +# bitcoin qt core # +QT_TS = \ + qt/locale/bitcoin_ach.ts \ + qt/locale/bitcoin_af_ZA.ts \ + qt/locale/bitcoin_ar.ts \ + qt/locale/bitcoin_be_BY.ts \ + qt/locale/bitcoin_bg.ts \ + qt/locale/bitcoin_bs.ts \ + qt/locale/bitcoin_ca_ES.ts \ + qt/locale/bitcoin_ca.ts \ + qt/locale/bitcoin_ca@valencia.ts \ + qt/locale/bitcoin_cmn.ts \ + qt/locale/bitcoin_cs.ts \ + qt/locale/bitcoin_cy.ts \ + qt/locale/bitcoin_da.ts \ + qt/locale/bitcoin_de.ts \ + qt/locale/bitcoin_el_GR.ts \ + qt/locale/bitcoin_en.ts \ + qt/locale/bitcoin_eo.ts \ + qt/locale/bitcoin_es_CL.ts \ + qt/locale/bitcoin_es_DO.ts \ + qt/locale/bitcoin_es_MX.ts \ + qt/locale/bitcoin_es.ts \ + qt/locale/bitcoin_es_UY.ts \ + qt/locale/bitcoin_et.ts \ + qt/locale/bitcoin_eu_ES.ts \ + qt/locale/bitcoin_fa_IR.ts \ + qt/locale/bitcoin_fa.ts \ + qt/locale/bitcoin_fi.ts \ + qt/locale/bitcoin_fr_CA.ts \ + qt/locale/bitcoin_fr.ts \ + qt/locale/bitcoin_gl.ts \ + qt/locale/bitcoin_gu_IN.ts \ + qt/locale/bitcoin_he.ts \ + qt/locale/bitcoin_hi_IN.ts \ + qt/locale/bitcoin_hr.ts \ + qt/locale/bitcoin_hu.ts \ + qt/locale/bitcoin_id_ID.ts \ + qt/locale/bitcoin_it.ts \ + qt/locale/bitcoin_ja.ts \ + qt/locale/bitcoin_ka.ts \ + qt/locale/bitcoin_kk_KZ.ts \ + qt/locale/bitcoin_ko_KR.ts \ + qt/locale/bitcoin_ky.ts \ + qt/locale/bitcoin_la.ts \ + qt/locale/bitcoin_lt.ts \ + qt/locale/bitcoin_lv_LV.ts \ + qt/locale/bitcoin_mn.ts \ + qt/locale/bitcoin_ms_MY.ts \ + qt/locale/bitcoin_nb.ts \ + qt/locale/bitcoin_nl.ts \ + qt/locale/bitcoin_pam.ts \ + qt/locale/bitcoin_pl.ts \ + qt/locale/bitcoin_pt_BR.ts \ + qt/locale/bitcoin_pt_PT.ts \ + qt/locale/bitcoin_ro_RO.ts \ + qt/locale/bitcoin_ru.ts \ + qt/locale/bitcoin_sah.ts \ + qt/locale/bitcoin_sk.ts \ + qt/locale/bitcoin_sl_SI.ts \ + qt/locale/bitcoin_sq.ts \ + qt/locale/bitcoin_sr.ts \ + qt/locale/bitcoin_sv.ts \ + qt/locale/bitcoin_th_TH.ts \ + qt/locale/bitcoin_tr.ts \ + qt/locale/bitcoin_uk.ts \ + qt/locale/bitcoin_ur_PK.ts \ + qt/locale/bitcoin_uz@Cyrl.ts \ + qt/locale/bitcoin_vi.ts \ + qt/locale/bitcoin_vi_VN.ts \ + qt/locale/bitcoin_zh_CN.ts \ + qt/locale/bitcoin_zh_HK.ts \ + qt/locale/bitcoin_zh_TW.ts + +QT_FORMS_UI = \ + qt/forms/aboutdialog.ui \ + qt/forms/addressbookpage.ui \ + qt/forms/askpassphrasedialog.ui \ + qt/forms/coincontroldialog.ui \ + qt/forms/editaddressdialog.ui \ + qt/forms/helpmessagedialog.ui \ + qt/forms/intro.ui \ + qt/forms/openuridialog.ui \ + qt/forms/optionsdialog.ui \ + qt/forms/overviewpage.ui \ + qt/forms/receivecoinsdialog.ui \ + qt/forms/receiverequestdialog.ui \ + qt/forms/rpcconsole.ui \ + qt/forms/sendcoinsdialog.ui \ + qt/forms/sendcoinsentry.ui \ + qt/forms/signverifymessagedialog.ui \ + qt/forms/transactiondescdialog.ui + +QT_MOC_CPP = \ + qt/moc_addressbookpage.cpp \ + qt/moc_addresstablemodel.cpp \ + qt/moc_askpassphrasedialog.cpp \ + qt/moc_bitcoinaddressvalidator.cpp \ + qt/moc_bitcoinamountfield.cpp \ + qt/moc_bitcoingui.cpp \ + qt/moc_bitcoinunits.cpp \ + qt/moc_clientmodel.cpp \ + qt/moc_coincontroldialog.cpp \ + qt/moc_coincontroltreewidget.cpp \ + qt/moc_csvmodelwriter.cpp \ + qt/moc_editaddressdialog.cpp \ + qt/moc_guiutil.cpp \ + qt/moc_intro.cpp \ + qt/moc_macdockiconhandler.cpp \ + qt/moc_macnotificationhandler.cpp \ + qt/moc_monitoreddatamapper.cpp \ + qt/moc_notificator.cpp \ + qt/moc_openuridialog.cpp \ + qt/moc_optionsdialog.cpp \ + qt/moc_optionsmodel.cpp \ + qt/moc_overviewpage.cpp \ + qt/moc_peertablemodel.cpp \ + qt/moc_paymentserver.cpp \ + qt/moc_qvalidatedlineedit.cpp \ + qt/moc_qvaluecombobox.cpp \ + qt/moc_receivecoinsdialog.cpp \ + qt/moc_receiverequestdialog.cpp \ + qt/moc_recentrequeststablemodel.cpp \ + qt/moc_rpcconsole.cpp \ + qt/moc_sendcoinsdialog.cpp \ + qt/moc_sendcoinsentry.cpp \ + qt/moc_signverifymessagedialog.cpp \ + qt/moc_splashscreen.cpp \ + qt/moc_trafficgraphwidget.cpp \ + qt/moc_transactiondesc.cpp \ + qt/moc_transactiondescdialog.cpp \ + qt/moc_transactionfilterproxy.cpp \ + qt/moc_transactiontablemodel.cpp \ + qt/moc_transactionview.cpp \ + qt/moc_utilitydialog.cpp \ + qt/moc_walletframe.cpp \ + qt/moc_walletmodel.cpp \ + qt/moc_walletview.cpp + +BITCOIN_MM = \ + qt/macdockiconhandler.mm \ + qt/macnotificationhandler.mm + +QT_MOC = \ + qt/bitcoin.moc \ + qt/intro.moc \ + qt/overviewpage.moc \ + qt/rpcconsole.moc + +QT_QRC_CPP = qt/qrc_bitcoin.cpp +QT_QRC = qt/bitcoin.qrc + +PROTOBUF_CC = qt/paymentrequest.pb.cc +PROTOBUF_H = qt/paymentrequest.pb.h +PROTOBUF_PROTO = qt/paymentrequest.proto + +BITCOIN_QT_H = \ + qt/addressbookpage.h \ + qt/addresstablemodel.h \ + qt/askpassphrasedialog.h \ + qt/bitcoinaddressvalidator.h \ + qt/bitcoinamountfield.h \ + qt/bitcoingui.h \ + qt/bitcoinunits.h \ + qt/clientmodel.h \ + qt/coincontroldialog.h \ + qt/coincontroltreewidget.h \ + qt/csvmodelwriter.h \ + qt/editaddressdialog.h \ + qt/guiconstants.h \ + qt/guiutil.h \ + qt/intro.h \ + qt/macdockiconhandler.h \ + qt/macnotificationhandler.h \ + qt/monitoreddatamapper.h \ + qt/notificator.h \ + qt/openuridialog.h \ + qt/optionsdialog.h \ + qt/optionsmodel.h \ + qt/overviewpage.h \ + qt/paymentrequestplus.h \ + qt/paymentserver.h \ + qt/peertablemodel.h \ + qt/qvalidatedlineedit.h \ + qt/qvaluecombobox.h \ + qt/receivecoinsdialog.h \ + qt/receiverequestdialog.h \ + qt/recentrequeststablemodel.h \ + qt/rpcconsole.h \ + qt/sendcoinsdialog.h \ + qt/sendcoinsentry.h \ + qt/signverifymessagedialog.h \ + qt/splashscreen.h \ + qt/trafficgraphwidget.h \ + qt/transactiondesc.h \ + qt/transactiondescdialog.h \ + qt/transactionfilterproxy.h \ + qt/transactionrecord.h \ + qt/transactiontablemodel.h \ + qt/transactionview.h \ + qt/utilitydialog.h \ + qt/walletframe.h \ + qt/walletmodel.h \ + qt/walletmodeltransaction.h \ + qt/walletview.h \ + qt/winshutdownmonitor.h + +RES_ICONS = \ + qt/res/icons/add.png \ + qt/res/icons/address-book.png \ + qt/res/icons/bitcoin.ico \ + qt/res/icons/bitcoin.png \ + qt/res/icons/bitcoin_testnet.ico \ + qt/res/icons/bitcoin_testnet.png \ + qt/res/icons/clock1.png \ + qt/res/icons/clock2.png \ + qt/res/icons/clock3.png \ + qt/res/icons/clock4.png \ + qt/res/icons/clock5.png \ + qt/res/icons/configure.png \ + qt/res/icons/connect0_16.png \ + qt/res/icons/connect1_16.png \ + qt/res/icons/connect2_16.png \ + qt/res/icons/connect3_16.png \ + qt/res/icons/connect4_16.png \ + qt/res/icons/debugwindow.png \ + qt/res/icons/edit.png \ + qt/res/icons/editcopy.png \ + qt/res/icons/editpaste.png \ + qt/res/icons/export.png \ + qt/res/icons/filesave.png \ + qt/res/icons/history.png \ + qt/res/icons/key.png \ + qt/res/icons/lock_closed.png \ + qt/res/icons/lock_open.png \ + qt/res/icons/overview.png \ + qt/res/icons/qrcode.png \ + qt/res/icons/quit.png \ + qt/res/icons/receive.png \ + qt/res/icons/remove.png \ + qt/res/icons/send.png \ + qt/res/icons/synced.png \ + qt/res/icons/toolbar.png \ + qt/res/icons/toolbar_testnet.png \ + qt/res/icons/transaction0.png \ + qt/res/icons/transaction2.png \ + qt/res/icons/transaction_conflicted.png \ + qt/res/icons/tx_inout.png \ + qt/res/icons/tx_input.png \ + qt/res/icons/tx_output.png \ + qt/res/icons/tx_mined.png + +BITCOIN_QT_CPP = \ + qt/bitcoinaddressvalidator.cpp \ + qt/bitcoinamountfield.cpp \ + qt/bitcoingui.cpp \ + qt/bitcoinunits.cpp \ + qt/clientmodel.cpp \ + qt/csvmodelwriter.cpp \ + qt/guiutil.cpp \ + qt/intro.cpp \ + qt/monitoreddatamapper.cpp \ + qt/notificator.cpp \ + qt/optionsdialog.cpp \ + qt/optionsmodel.cpp \ + qt/peertablemodel.cpp \ + qt/qvalidatedlineedit.cpp \ + qt/qvaluecombobox.cpp \ + qt/rpcconsole.cpp \ + qt/splashscreen.cpp \ + qt/trafficgraphwidget.cpp \ + qt/utilitydialog.cpp \ + qt/winshutdownmonitor.cpp + +if ENABLE_WALLET +BITCOIN_QT_CPP += \ + qt/addressbookpage.cpp \ + qt/addresstablemodel.cpp \ + qt/askpassphrasedialog.cpp \ + qt/coincontroldialog.cpp \ + qt/coincontroltreewidget.cpp \ + qt/editaddressdialog.cpp \ + qt/openuridialog.cpp \ + qt/overviewpage.cpp \ + qt/paymentrequestplus.cpp \ + qt/paymentserver.cpp \ + qt/receivecoinsdialog.cpp \ + qt/receiverequestdialog.cpp \ + qt/recentrequeststablemodel.cpp \ + qt/sendcoinsdialog.cpp \ + qt/sendcoinsentry.cpp \ + qt/signverifymessagedialog.cpp \ + qt/transactiondesc.cpp \ + qt/transactiondescdialog.cpp \ + qt/transactionfilterproxy.cpp \ + qt/transactionrecord.cpp \ + qt/transactiontablemodel.cpp \ + qt/transactionview.cpp \ + qt/walletframe.cpp \ + qt/walletmodel.cpp \ + qt/walletmodeltransaction.cpp \ + qt/walletview.cpp +endif + +RES_IMAGES = \ + qt/res/images/about.png \ + qt/res/images/splash.png \ + qt/res/images/splash_testnet.png + +RES_MOVIES = $(wildcard qt/res/movies/spinner-*.png) + +BITCOIN_RC = qt/res/bitcoin-qt-res.rc + +qt_libbitcoinqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ + -I$(top_srcdir)/src/qt/forms $(QT_DBUS_INCLUDES) +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) + +nodist_qt_libbitcoinqt_a_SOURCES = $(QT_MOC_CPP) $(QT_MOC) $(PROTOBUF_CC) \ + $(PROTOBUF_H) $(QT_QRC_CPP) + +# forms/foo.h -> forms/ui_foo.h +QT_FORMS_H=$(join $(dir $(QT_FORMS_UI)),$(addprefix ui_, $(notdir $(QT_FORMS_UI:.ui=.h)))) + +# Most files will depend on the forms and moc files as includes. Generate them +# before anything else. +$(QT_MOC): $(QT_FORMS_H) +$(qt_libbitcoinqt_a_OBJECTS) $(qt_bitcoin_qt_OBJECTS) : | $(QT_MOC) + +#Generating these with a half-written protobuf header leads to wacky results. +#This makes sure it's done. +$(QT_MOC): $(PROTOBUF_H) +$(QT_MOC_CPP): $(PROTOBUF_H) + +# bitcoin-qt binary # +qt_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ + -I$(top_srcdir)/src/qt/forms +qt_bitcoin_qt_SOURCES = qt/bitcoin.cpp +if TARGET_DARWIN + qt_bitcoin_qt_SOURCES += $(BITCOIN_MM) +endif +if TARGET_WINDOWS + qt_bitcoin_qt_SOURCES += $(BITCOIN_RC) +endif +qt_bitcoin_qt_LDADD = qt/libbitcoinqt.a $(LIBBITCOIN_SERVER) +if ENABLE_WALLET +qt_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) +endif +qt_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ + $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) +qt_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS) + +#locale/foo.ts -> locale/foo.qm +QT_QM=$(QT_TS:.ts=.qm) + +.SECONDARY: $(QT_QM) + +qt/bitcoinstrings.cpp: $(libbitcoin_server_a_SOURCES) $(libbitcoin_common_a_SOURCES) $(libbitcoin_cli_a_SOURCES) + @test -n $(XGETTEXT) || echo "xgettext is required for updating translations" + @cd $(top_srcdir); XGETTEXT=$(XGETTEXT) share/qt/extract_strings_qt.py + +translate: qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM) + @test -n $(LUPDATE) || echo "lupdate is required for updating translations" + @QT_SELECT=$(QT_SELECT) $(LUPDATE) $^ -locations relative -no-obsolete -ts qt/locale/bitcoin_en.ts + +$(QT_QRC_CPP): $(QT_QRC) $(QT_QM) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H) + @cd $(abs_srcdir); test -f $(RCC) && QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin -o $(abs_builddir)/$@ $< || \ + echo error: could not build $@ + $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} + $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} + +CLEAN_QT = $(nodist_qt_libbitcoinqt_a_SOURCES) $(QT_QM) $(QT_FORMS_H) qt/*.gcda qt/*.gcno + +CLEANFILES += $(CLEAN_QT) + +bitcoin_qt_clean: FORCE + rm -f $(CLEAN_QT) $(qt_libbitcoinqt_a_OBJECTS) $(qt_bitcoin_qt_OBJECTS) qt/bitcoin-qt$(EXEEXT) $(LIBBITCOINQT) + +bitcoin_qt : qt/bitcoin-qt$(EXEEXT) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include new file mode 100644 index 000000000..0d08a636e --- /dev/null +++ b/src/Makefile.qttest.include @@ -0,0 +1,52 @@ +AM_CPPFLAGS += -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/qt \ + -I$(top_builddir)/src/qt \ + $(PROTOBUF_CFLAGS) \ + $(QR_CFLAGS) +bin_PROGRAMS += qt/test/test_bitcoin-qt +TESTS += qt/test/test_bitcoin-qt + +TEST_QT_MOC_CPP = qt/test/moc_uritests.cpp + +if ENABLE_WALLET +TEST_QT_MOC_CPP += qt/test/moc_paymentservertests.cpp +endif + +TEST_QT_H = \ + qt/test/uritests.h \ + qt/test/paymentrequestdata.h \ + qt/test/paymentservertests.h + +qt_test_test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) $(QT_TEST_INCLUDES) + +qt_test_test_bitcoin_qt_SOURCES = \ + qt/test/test_main.cpp \ + qt/test/uritests.cpp \ + $(TEST_QT_H) +if ENABLE_WALLET +qt_test_test_bitcoin_qt_SOURCES += \ + qt/test/paymentservertests.cpp +endif + +nodist_qt_test_test_bitcoin_qt_SOURCES = $(TEST_QT_MOC_CPP) + +qt_test_test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER) +if ENABLE_WALLET +qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) +endif +qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) \ + $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ + $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) +qt_test_test_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS) + +CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno + +CLEANFILES += $(CLEAN_BITCOIN_QT_TEST) + +test_bitcoin_qt : qt/test/test_bitcoin-qt$(EXEEXT) + +test_bitcoin_qt_check : qt/test/test_bitcoin-qt$(EXEEXT) FORCE + $(MAKE) check-TESTS TESTS=$^ + +test_bitcoin_qt_clean: FORCE + rm -f $(CLEAN_BITCOIN_QT_TEST) $(qt_test_test_bitcoin_qt_OBJECTS) diff --git a/src/Makefile.test.include b/src/Makefile.test.include new file mode 100644 index 000000000..4a70b0f9e --- /dev/null +++ b/src/Makefile.test.include @@ -0,0 +1,87 @@ +AM_CPPFLAGS += -I$(top_builddir)/src/test/ + +TESTS += test/test_bitcoin +bin_PROGRAMS += test/test_bitcoin +TEST_SRCDIR = test +TEST_BINARY=test/test_bitcoin$(EXEEXT) + +JSON_TEST_FILES = \ + test/data/script_valid.json \ + test/data/base58_keys_valid.json \ + test/data/sig_canonical.json \ + test/data/sig_noncanonical.json \ + test/data/base58_encode_decode.json \ + test/data/base58_keys_invalid.json \ + test/data/script_invalid.json \ + test/data/tx_invalid.json \ + test/data/tx_valid.json \ + test/data/sighash.json + +RAW_TEST_FILES = test/data/alertTests.raw + +GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h) + +BITCOIN_TESTS =\ + test/bignum.h \ + test/alert_tests.cpp \ + test/allocator_tests.cpp \ + test/base32_tests.cpp \ + test/base58_tests.cpp \ + test/base64_tests.cpp \ + test/bloom_tests.cpp \ + test/canonical_tests.cpp \ + test/checkblock_tests.cpp \ + test/Checkpoints_tests.cpp \ + test/compress_tests.cpp \ + test/DoS_tests.cpp \ + test/getarg_tests.cpp \ + test/key_tests.cpp \ + test/main_tests.cpp \ + test/miner_tests.cpp \ + test/mruset_tests.cpp \ + test/multisig_tests.cpp \ + test/netbase_tests.cpp \ + test/pmt_tests.cpp \ + test/rpc_tests.cpp \ + test/script_P2SH_tests.cpp \ + test/script_tests.cpp \ + test/serialize_tests.cpp \ + test/sigopcount_tests.cpp \ + test/test_bitcoin.cpp \ + test/transaction_tests.cpp \ + test/uint256_tests.cpp \ + test/util_tests.cpp \ + test/scriptnum_tests.cpp \ + test/sighash_tests.cpp + +if ENABLE_WALLET +BITCOIN_TESTS += \ + test/accounting_tests.cpp \ + test/wallet_tests.cpp \ + test/rpc_wallet_tests.cpp +endif + +test_test_bitcoin_SOURCES = $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) +test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(TESTDEFS) +test_test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ + $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) +if ENABLE_WALLET +test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) +endif +test_test_bitcoin_LDADD += $(BDB_LIBS) + +nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES) + +$(BITCOIN_TESTS): $(GENERATED_TEST_FILES) + +CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno $(GENERATED_TEST_FILES) + +CLEANFILES += $(CLEAN_BITCOIN_TEST) + +bitcoin_test: $(TEST_BINARY) + +bitcoin_test_check: $(TEST_BINARY) FORCE + $(MAKE) check-TESTS TESTS=$^ + +bitcoin_test_clean : FORCE + rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY) From be4e9aeb148420317109d173d7fb3bc56b37f434 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 28 May 2014 13:40:35 -0400 Subject: [PATCH 2/8] build: delete old Makefile.am's --- src/qt/Makefile.am | 382 ---------------------------------------- src/qt/test/Makefile.am | 46 ----- src/test/Makefile.am | 77 -------- 3 files changed, 505 deletions(-) delete mode 100644 src/qt/Makefile.am delete mode 100644 src/qt/test/Makefile.am delete mode 100644 src/test/Makefile.am diff --git a/src/qt/Makefile.am b/src/qt/Makefile.am deleted file mode 100644 index d527f790e..000000000 --- a/src/qt/Makefile.am +++ /dev/null @@ -1,382 +0,0 @@ -include $(top_srcdir)/src/Makefile.include - -AM_CPPFLAGS += -I$(top_srcdir)/src \ - -I$(top_builddir)/src/qt \ - -I$(top_builddir)/src/qt/forms \ - $(PROTOBUF_CFLAGS) \ - $(QR_CFLAGS) -bin_PROGRAMS = bitcoin-qt -noinst_LIBRARIES = libbitcoinqt.a -SUBDIRS = . $(BUILD_TEST_QT) -DIST_SUBDIRS = . test - -# bitcoin qt core # -QT_TS = \ - locale/bitcoin_ach.ts \ - locale/bitcoin_af_ZA.ts \ - locale/bitcoin_ar.ts \ - locale/bitcoin_be_BY.ts \ - locale/bitcoin_bg.ts \ - locale/bitcoin_bs.ts \ - locale/bitcoin_ca_ES.ts \ - locale/bitcoin_ca.ts \ - locale/bitcoin_ca@valencia.ts \ - locale/bitcoin_cmn.ts \ - locale/bitcoin_cs.ts \ - locale/bitcoin_cy.ts \ - locale/bitcoin_da.ts \ - locale/bitcoin_de.ts \ - locale/bitcoin_el_GR.ts \ - locale/bitcoin_en.ts \ - locale/bitcoin_eo.ts \ - locale/bitcoin_es_CL.ts \ - locale/bitcoin_es_DO.ts \ - locale/bitcoin_es_MX.ts \ - locale/bitcoin_es.ts \ - locale/bitcoin_es_UY.ts \ - locale/bitcoin_et.ts \ - locale/bitcoin_eu_ES.ts \ - locale/bitcoin_fa_IR.ts \ - locale/bitcoin_fa.ts \ - locale/bitcoin_fi.ts \ - locale/bitcoin_fr_CA.ts \ - locale/bitcoin_fr.ts \ - locale/bitcoin_gl.ts \ - locale/bitcoin_gu_IN.ts \ - locale/bitcoin_he.ts \ - locale/bitcoin_hi_IN.ts \ - locale/bitcoin_hr.ts \ - locale/bitcoin_hu.ts \ - locale/bitcoin_id_ID.ts \ - locale/bitcoin_it.ts \ - locale/bitcoin_ja.ts \ - locale/bitcoin_ka.ts \ - locale/bitcoin_kk_KZ.ts \ - locale/bitcoin_ko_KR.ts \ - locale/bitcoin_ky.ts \ - locale/bitcoin_la.ts \ - locale/bitcoin_lt.ts \ - locale/bitcoin_lv_LV.ts \ - locale/bitcoin_mn.ts \ - locale/bitcoin_ms_MY.ts \ - locale/bitcoin_nb.ts \ - locale/bitcoin_nl.ts \ - locale/bitcoin_pam.ts \ - locale/bitcoin_pl.ts \ - locale/bitcoin_pt_BR.ts \ - locale/bitcoin_pt_PT.ts \ - locale/bitcoin_ro_RO.ts \ - locale/bitcoin_ru.ts \ - locale/bitcoin_sah.ts \ - locale/bitcoin_sk.ts \ - locale/bitcoin_sl_SI.ts \ - locale/bitcoin_sq.ts \ - locale/bitcoin_sr.ts \ - locale/bitcoin_sv.ts \ - locale/bitcoin_th_TH.ts \ - locale/bitcoin_tr.ts \ - locale/bitcoin_uk.ts \ - locale/bitcoin_ur_PK.ts \ - locale/bitcoin_uz@Cyrl.ts \ - locale/bitcoin_vi.ts \ - locale/bitcoin_vi_VN.ts \ - locale/bitcoin_zh_CN.ts \ - locale/bitcoin_zh_HK.ts \ - locale/bitcoin_zh_TW.ts - -QT_FORMS_UI = \ - forms/aboutdialog.ui \ - forms/addressbookpage.ui \ - forms/askpassphrasedialog.ui \ - forms/coincontroldialog.ui \ - forms/editaddressdialog.ui \ - forms/helpmessagedialog.ui \ - forms/intro.ui \ - forms/openuridialog.ui \ - forms/optionsdialog.ui \ - forms/overviewpage.ui \ - forms/receivecoinsdialog.ui \ - forms/receiverequestdialog.ui \ - forms/rpcconsole.ui \ - forms/sendcoinsdialog.ui \ - forms/sendcoinsentry.ui \ - forms/signverifymessagedialog.ui \ - forms/transactiondescdialog.ui - -QT_MOC_CPP = \ - moc_addressbookpage.cpp \ - moc_addresstablemodel.cpp \ - moc_askpassphrasedialog.cpp \ - moc_bitcoinaddressvalidator.cpp \ - moc_bitcoinamountfield.cpp \ - moc_bitcoingui.cpp \ - moc_bitcoinunits.cpp \ - moc_clientmodel.cpp \ - moc_coincontroldialog.cpp \ - moc_coincontroltreewidget.cpp \ - moc_csvmodelwriter.cpp \ - moc_editaddressdialog.cpp \ - moc_guiutil.cpp \ - moc_intro.cpp \ - moc_macdockiconhandler.cpp \ - moc_macnotificationhandler.cpp \ - moc_monitoreddatamapper.cpp \ - moc_notificator.cpp \ - moc_openuridialog.cpp \ - moc_optionsdialog.cpp \ - moc_optionsmodel.cpp \ - moc_overviewpage.cpp \ - moc_peertablemodel.cpp \ - moc_paymentserver.cpp \ - moc_qvalidatedlineedit.cpp \ - moc_qvaluecombobox.cpp \ - moc_receivecoinsdialog.cpp \ - moc_receiverequestdialog.cpp \ - moc_recentrequeststablemodel.cpp \ - moc_rpcconsole.cpp \ - moc_sendcoinsdialog.cpp \ - moc_sendcoinsentry.cpp \ - moc_signverifymessagedialog.cpp \ - moc_splashscreen.cpp \ - moc_trafficgraphwidget.cpp \ - moc_transactiondesc.cpp \ - moc_transactiondescdialog.cpp \ - moc_transactionfilterproxy.cpp \ - moc_transactiontablemodel.cpp \ - moc_transactionview.cpp \ - moc_utilitydialog.cpp \ - moc_walletframe.cpp \ - moc_walletmodel.cpp \ - moc_walletview.cpp - -BITCOIN_MM = \ - macdockiconhandler.mm \ - macnotificationhandler.mm - -QT_MOC = \ - bitcoin.moc \ - intro.moc \ - overviewpage.moc \ - rpcconsole.moc - -QT_QRC_CPP = qrc_bitcoin.cpp -QT_QRC = bitcoin.qrc - -PROTOBUF_CC = paymentrequest.pb.cc -PROTOBUF_H = paymentrequest.pb.h -PROTOBUF_PROTO = paymentrequest.proto - -BITCOIN_QT_H = \ - addressbookpage.h \ - addresstablemodel.h \ - askpassphrasedialog.h \ - bitcoinaddressvalidator.h \ - bitcoinamountfield.h \ - bitcoingui.h \ - bitcoinunits.h \ - clientmodel.h \ - coincontroldialog.h \ - coincontroltreewidget.h \ - csvmodelwriter.h \ - editaddressdialog.h \ - guiconstants.h \ - guiutil.h \ - intro.h \ - macdockiconhandler.h \ - macnotificationhandler.h \ - monitoreddatamapper.h \ - notificator.h \ - openuridialog.h \ - optionsdialog.h \ - optionsmodel.h \ - overviewpage.h \ - paymentrequestplus.h \ - paymentserver.h \ - peertablemodel.h \ - qvalidatedlineedit.h \ - qvaluecombobox.h \ - receivecoinsdialog.h \ - receiverequestdialog.h \ - recentrequeststablemodel.h \ - rpcconsole.h \ - sendcoinsdialog.h \ - sendcoinsentry.h \ - signverifymessagedialog.h \ - splashscreen.h \ - trafficgraphwidget.h \ - transactiondesc.h \ - transactiondescdialog.h \ - transactionfilterproxy.h \ - transactionrecord.h \ - transactiontablemodel.h \ - transactionview.h \ - utilitydialog.h \ - walletframe.h \ - walletmodel.h \ - walletmodeltransaction.h \ - walletview.h \ - winshutdownmonitor.h - -RES_ICONS = \ - res/icons/add.png \ - res/icons/address-book.png \ - res/icons/bitcoin.ico \ - res/icons/bitcoin.png \ - res/icons/bitcoin_testnet.ico \ - res/icons/bitcoin_testnet.png \ - res/icons/clock1.png \ - res/icons/clock2.png \ - res/icons/clock3.png \ - res/icons/clock4.png \ - res/icons/clock5.png \ - res/icons/configure.png \ - res/icons/connect0_16.png \ - res/icons/connect1_16.png \ - res/icons/connect2_16.png \ - res/icons/connect3_16.png \ - res/icons/connect4_16.png \ - res/icons/debugwindow.png \ - res/icons/edit.png \ - res/icons/editcopy.png \ - res/icons/editpaste.png \ - res/icons/export.png \ - res/icons/filesave.png \ - res/icons/history.png \ - res/icons/key.png \ - res/icons/lock_closed.png \ - res/icons/lock_open.png \ - res/icons/overview.png \ - res/icons/qrcode.png \ - res/icons/quit.png \ - res/icons/receive.png \ - res/icons/remove.png \ - res/icons/send.png \ - res/icons/synced.png \ - res/icons/toolbar.png \ - res/icons/toolbar_testnet.png \ - res/icons/transaction0.png \ - res/icons/transaction2.png \ - res/icons/transaction_conflicted.png \ - res/icons/tx_inout.png \ - res/icons/tx_input.png \ - res/icons/tx_output.png \ - res/icons/tx_mined.png - -BITCOIN_QT_CPP = \ - bitcoin.cpp \ - bitcoinaddressvalidator.cpp \ - bitcoinamountfield.cpp \ - bitcoingui.cpp \ - bitcoinunits.cpp \ - clientmodel.cpp \ - csvmodelwriter.cpp \ - guiutil.cpp \ - intro.cpp \ - monitoreddatamapper.cpp \ - notificator.cpp \ - optionsdialog.cpp \ - optionsmodel.cpp \ - peertablemodel.cpp \ - qvalidatedlineedit.cpp \ - qvaluecombobox.cpp \ - rpcconsole.cpp \ - splashscreen.cpp \ - trafficgraphwidget.cpp \ - utilitydialog.cpp \ - winshutdownmonitor.cpp - -if ENABLE_WALLET -BITCOIN_QT_CPP += \ - addressbookpage.cpp \ - addresstablemodel.cpp \ - askpassphrasedialog.cpp \ - coincontroldialog.cpp \ - coincontroltreewidget.cpp \ - editaddressdialog.cpp \ - openuridialog.cpp \ - overviewpage.cpp \ - paymentrequestplus.cpp \ - paymentserver.cpp \ - receivecoinsdialog.cpp \ - receiverequestdialog.cpp \ - recentrequeststablemodel.cpp \ - sendcoinsdialog.cpp \ - sendcoinsentry.cpp \ - signverifymessagedialog.cpp \ - transactiondesc.cpp \ - transactiondescdialog.cpp \ - transactionfilterproxy.cpp \ - transactionrecord.cpp \ - transactiontablemodel.cpp \ - transactionview.cpp \ - walletframe.cpp \ - walletmodel.cpp \ - walletmodeltransaction.cpp \ - walletview.cpp -endif - -RES_IMAGES = \ - res/images/about.png \ - res/images/splash.png \ - res/images/splash_testnet.png - -RES_MOVIES = $(wildcard res/movies/spinner-*.png) - -BITCOIN_RC = res/bitcoin-qt-res.rc - -libbitcoinqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ - -I$(top_srcdir)/src/qt/forms $(QT_DBUS_INCLUDES) -libbitcoinqt_a_SOURCES = $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(QT_FORMS_UI) \ - $(QT_QRC) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) - -nodist_libbitcoinqt_a_SOURCES = $(QT_MOC_CPP) $(QT_MOC) $(PROTOBUF_CC) \ - $(PROTOBUF_H) $(QT_QRC_CPP) - -BUILT_SOURCES = $(nodist_libbitcoinqt_a_SOURCES) - -#Generating these with a half-written protobuf header leads to wacky results. -#This makes sure it's done. -$(QT_MOC): $(PROTOBUF_H) -$(QT_MOC_CPP): $(PROTOBUF_H) - -# bitcoin-qt binary # -bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ - -I$(top_srcdir)/src/qt/forms -bitcoin_qt_SOURCES = bitcoin.cpp -if TARGET_DARWIN - bitcoin_qt_SOURCES += $(BITCOIN_MM) -endif -if TARGET_WINDOWS - bitcoin_qt_SOURCES += $(BITCOIN_RC) -endif -bitcoin_qt_LDADD = libbitcoinqt.a $(LIBBITCOIN_SERVER) -if ENABLE_WALLET -bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) -endif -bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ - $(BOOST_LIBS) $(QT_LIBS) $(QT_DBUS_LIBS) $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) -bitcoin_qt_LDFLAGS = $(QT_LDFLAGS) - -# forms/foo.h -> forms/ui_foo.h -QT_FORMS_H=$(join $(dir $(QT_FORMS_UI)),$(addprefix ui_, $(notdir $(QT_FORMS_UI:.ui=.h)))) - -#locale/foo.ts -> locale/foo.qm -QT_QM=$(QT_TS:.ts=.qm) - -.PHONY: FORCE -.SECONDARY: $(QT_QM) - -bitcoinstrings.cpp: FORCE - $(MAKE) -C $(top_srcdir)/src qt/bitcoinstrings.cpp - -translate: bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCOIN_QT_CPP) $(BITCOIN_QT_H) $(BITCOIN_MM) - @test -n $(LUPDATE) || echo "lupdate is required for updating translations" - @QT_SELECT=$(QT_SELECT) $(LUPDATE) $^ -locations relative -no-obsolete -ts locale/bitcoin_en.ts - -$(QT_QRC_CPP): $(QT_QRC) $(QT_QM) $(QT_FORMS_H) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) $(PROTOBUF_H) - @cd $(abs_srcdir); test -f $(RCC) && QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin -o $(abs_builddir)/$@ $< || \ - echo error: could not build $@ - $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} - $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} - -CLEANFILES = $(BUILT_SOURCES) $(QT_QM) $(QT_FORMS_H) *.gcda *.gcno diff --git a/src/qt/test/Makefile.am b/src/qt/test/Makefile.am deleted file mode 100644 index 2461b5ff4..000000000 --- a/src/qt/test/Makefile.am +++ /dev/null @@ -1,46 +0,0 @@ -include $(top_srcdir)/src/Makefile.include - -AM_CPPFLAGS += -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/qt \ - -I$(top_builddir)/src/qt \ - $(PROTOBUF_CFLAGS) \ - $(QR_CFLAGS) -bin_PROGRAMS = test_bitcoin-qt -TESTS = test_bitcoin-qt - -TEST_QT_MOC_CPP = moc_uritests.cpp - -if ENABLE_WALLET -TEST_QT_MOC_CPP += moc_paymentservertests.cpp -endif - -TEST_QT_H = \ - uritests.h \ - paymentrequestdata.h \ - paymentservertests.h - -BUILT_SOURCES = $(TEST_QT_MOC_CPP) - -test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) $(QT_TEST_INCLUDES) - -test_bitcoin_qt_SOURCES = \ - test_main.cpp \ - uritests.cpp \ - $(TEST_QT_H) -if ENABLE_WALLET -test_bitcoin_qt_SOURCES += \ - paymentservertests.cpp -endif - -nodist_test_bitcoin_qt_SOURCES = $(TEST_QT_MOC_CPP) - -test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_SERVER) -if ENABLE_WALLET -test_bitcoin_qt_LDADD += $(LIBBITCOIN_WALLET) -endif -test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) \ - $(LIBMEMENV) $(BOOST_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) $(QT_LIBS) \ - $(QR_LIBS) $(PROTOBUF_LIBS) $(BDB_LIBS) -test_bitcoin_qt_LDFLAGS = $(QT_LDFLAGS) - -CLEANFILES = $(BUILT_SOURCES) *.gcda *.gcno diff --git a/src/test/Makefile.am b/src/test/Makefile.am deleted file mode 100644 index cde3a31e2..000000000 --- a/src/test/Makefile.am +++ /dev/null @@ -1,77 +0,0 @@ -include $(top_srcdir)/src/Makefile.include - -AM_CPPFLAGS += -I$(top_srcdir)/src - -bin_PROGRAMS = test_bitcoin - -TESTS = test_bitcoin - -JSON_TEST_FILES = \ - data/script_valid.json \ - data/base58_keys_valid.json \ - data/sig_canonical.json \ - data/sig_noncanonical.json \ - data/base58_encode_decode.json \ - data/base58_keys_invalid.json \ - data/script_invalid.json \ - data/tx_invalid.json \ - data/tx_valid.json \ - data/sighash.json - -RAW_TEST_FILES = data/alertTests.raw - -BUILT_SOURCES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h) - -# test_bitcoin binary # -test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(TESTDEFS) -test_bitcoin_LDADD = $(LIBBITCOIN_SERVER) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBLEVELDB) $(LIBMEMENV) \ - $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) -if ENABLE_WALLET -test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) -endif -test_bitcoin_LDADD += $(BDB_LIBS) - -test_bitcoin_SOURCES = \ - bignum.h \ - alert_tests.cpp \ - allocator_tests.cpp \ - base32_tests.cpp \ - base58_tests.cpp \ - base64_tests.cpp \ - bloom_tests.cpp \ - canonical_tests.cpp \ - checkblock_tests.cpp \ - Checkpoints_tests.cpp \ - compress_tests.cpp \ - DoS_tests.cpp \ - getarg_tests.cpp \ - key_tests.cpp \ - main_tests.cpp \ - miner_tests.cpp \ - mruset_tests.cpp \ - multisig_tests.cpp \ - netbase_tests.cpp \ - pmt_tests.cpp \ - rpc_tests.cpp \ - script_P2SH_tests.cpp \ - script_tests.cpp \ - serialize_tests.cpp \ - sigopcount_tests.cpp \ - test_bitcoin.cpp \ - transaction_tests.cpp \ - uint256_tests.cpp \ - util_tests.cpp \ - scriptnum_tests.cpp \ - sighash_tests.cpp \ - $(JSON_TEST_FILES) $(RAW_TEST_FILES) - -if ENABLE_WALLET -test_bitcoin_SOURCES += \ - accounting_tests.cpp \ - wallet_tests.cpp \ - rpc_wallet_tests.cpp -endif - -nodist_test_bitcoin_SOURCES = $(BUILT_SOURCES) - -CLEANFILES = *.gcda *.gcno $(BUILT_SOURCES) From 8b09ef7b6370800a1a9fd6f067abf1aaab5d6cfa Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 28 May 2014 13:41:35 -0400 Subject: [PATCH 3/8] build: add stub makefiles for easier subdir builds --- src/qt/Makefile | 9 +++++++++ src/qt/test/Makefile | 6 ++++++ src/test/Makefile | 6 ++++++ 3 files changed, 21 insertions(+) create mode 100644 src/qt/Makefile create mode 100644 src/qt/test/Makefile create mode 100644 src/test/Makefile diff --git a/src/qt/Makefile b/src/qt/Makefile new file mode 100644 index 000000000..b9dcf0c59 --- /dev/null +++ b/src/qt/Makefile @@ -0,0 +1,9 @@ +.PHONY: FORCE +all: FORCE + $(MAKE) -C .. bitcoin_qt test_bitcoin_qt +clean: FORCE + $(MAKE) -C .. bitcoin_qt_clean test_bitcoin_qt_clean +check: FORCE + $(MAKE) -C .. test_bitcoin_qt_check +bitcoin-qt bitcoin-qt.exe: FORCE + $(MAKE) -C .. bitcoin_qt diff --git a/src/qt/test/Makefile b/src/qt/test/Makefile new file mode 100644 index 000000000..a02f86b62 --- /dev/null +++ b/src/qt/test/Makefile @@ -0,0 +1,6 @@ +all: + $(MAKE) -C ../../ test_bitcoin_qt +clean: + $(MAKE) -C ../../ test_bitcoin_qt_clean +check: + $(MAKE) -C ../../ test_bitcoin_qt_check diff --git a/src/test/Makefile b/src/test/Makefile new file mode 100644 index 000000000..87bf73fec --- /dev/null +++ b/src/test/Makefile @@ -0,0 +1,6 @@ +all: + $(MAKE) -C .. bitcoin_test +clean: + $(MAKE) -C .. bitcoin_test_clean +check: + $(MAKE) -C .. bitcoin_test_check From 6b9f0d5554b75fcc24cbce10e16872df3e103226 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Wed, 4 Jun 2014 17:13:03 -0400 Subject: [PATCH 4/8] build: nuke Makefile.include from orbit Rules and targets no longer need to be shared between subdirectories, so this is no longer needed. --- src/Makefile.am | 48 ++++++++++++++++++++----- src/Makefile.include | 74 --------------------------------------- src/Makefile.qt.include | 21 +++++++++++ src/Makefile.test.include | 16 +++++++++ 4 files changed, 76 insertions(+), 83 deletions(-) delete mode 100644 src/Makefile.include diff --git a/src/Makefile.am b/src/Makefile.am index e7d121b4d..b3e713b9a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,27 @@ -include Makefile.include +AM_CPPFLAGS = $(INCLUDES) \ + -I$(top_builddir)/src/obj \ + $(BDB_CPPFLAGS) \ + $(BOOST_CPPFLAGS) $(BOOST_INCLUDES) +AM_CPPFLAGS += $(LEVELDB_CPPFLAGS) +AM_LDFLAGS = $(PTHREAD_CFLAGS) AM_CPPFLAGS += -I$(builddir) +if EMBEDDED_LEVELDB +LEVELDB_CPPFLAGS += -I$(top_srcdir)/src/leveldb/include +LEVELDB_CPPFLAGS += -I$(top_srcdir)/src/leveldb/helpers/memenv +LIBLEVELDB += $(top_builddir)/src/leveldb/libleveldb.a +LIBMEMENV += $(top_builddir)/src/leveldb/libmemenv.a + +# NOTE: This dependency is not strictly necessary, but without it make may try to build both in parallel, which breaks the LevelDB build system in a race +$(LIBLEVELDB): $(LIBMEMENV) + +$(LIBLEVELDB) $(LIBMEMENV): + @echo "Building LevelDB ..." && $(MAKE) -C $(@D) $(@F) CXX="$(CXX)" \ + CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \ + OPT="$(CXXFLAGS) $(CPPFLAGS)" +endif + noinst_LIBRARIES = \ libbitcoin_server.a \ libbitcoin_common.a \ @@ -179,14 +199,6 @@ if TARGET_WINDOWS bitcoin_cli_SOURCES += bitcoin-cli-res.rc endif -# NOTE: This dependency is not strictly necessary, but without it make may try to build both in parallel, which breaks the LevelDB build system in a race -leveldb/libleveldb.a: leveldb/libmemenv.a - -leveldb/%.a: - @echo "Building LevelDB ..." && $(MAKE) -C $(@D) $(@F) CXX="$(CXX)" \ - CC="$(CC)" PLATFORM=$(TARGET_OS) AR="$(AR)" $(LEVELDB_TARGET_FLAGS) \ - OPT="$(CXXFLAGS) $(CPPFLAGS)" - CLEANFILES = leveldb/libleveldb.a leveldb/libmemenv.a *.gcda *.gcno DISTCLEANFILES = obj/build.h @@ -197,6 +209,24 @@ clean-local: -$(MAKE) -C leveldb clean rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno +.rc.o: + @test -f $(WINDRES) && $(WINDRES) -i $< -o $@ || \ + echo error: could not build $@ + +.mm.o: + $(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $< + +%.pb.cc %.pb.h: %.proto + test -f $(PROTOC) && $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $( $(abs_builddir)/$@.n && mv $(abs_builddir)/$@{.n,} - $(SED) -e '/^\*\*.*by:/d' $(abs_builddir)/$@ > $(abs_builddir)/$@.n && mv $(abs_builddir)/$@{.n,} - -%.moc: %.cpp - QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< - $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} - $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} - -moc_%.cpp: %.h - QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< - $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} - $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} - -%.qm: %.ts - @test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D) - @test -f $(LRELEASE) && QT_SELECT=$(QT_SELECT) $(LRELEASE) $(abs_srcdir)/$< -qm $(abs_builddir)/$@ || \ - echo error: could not build $(abs_builddir)/$@ - -%.pb.cc %.pb.h: %.proto - test -f $(PROTOC) && $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $( $@ - @echo "static unsigned const char $(*F)[] = {" >> $@ - @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@ - @echo "};};" >> $@ - @echo "Generated $@" - -%.raw.h: %.raw - @$(MKDIR_P) $(@D) - @echo "namespace alert_tests{" > $@ - @echo "static unsigned const char $(*F)[] = {" >> $@ - @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@ - @echo "};};" >> $@ - @echo "Generated $@" diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index dcb3f37f5..0cef2d2e6 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -385,3 +385,24 @@ bitcoin_qt_clean: FORCE rm -f $(CLEAN_QT) $(qt_libbitcoinqt_a_OBJECTS) $(qt_bitcoin_qt_OBJECTS) qt/bitcoin-qt$(EXEEXT) $(LIBBITCOINQT) bitcoin_qt : qt/bitcoin-qt$(EXEEXT) + +ui_%.h: %.ui + @test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D) + @test -f $(UIC) && QT_SELECT=$(QT_SELECT) $(UIC) -o $(abs_builddir)/$@ $(abs_srcdir)/$< || echo error: could not build $(abs_builddir)/$@ + $(SED) -e '/^\*\*.*Created:/d' $(abs_builddir)/$@ > $(abs_builddir)/$@.n && mv $(abs_builddir)/$@{.n,} + $(SED) -e '/^\*\*.*by:/d' $(abs_builddir)/$@ > $(abs_builddir)/$@.n && mv $(abs_builddir)/$@{.n,} + +%.moc: %.cpp + QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< + $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} + $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} + +moc_%.cpp: %.h + QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< + $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} + $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} + +%.qm: %.ts + @test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D) + @test -f $(LRELEASE) && QT_SELECT=$(QT_SELECT) $(LRELEASE) $(abs_srcdir)/$< -qm $(abs_builddir)/$@ || \ + echo error: could not build $(abs_builddir)/$@ diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 4a70b0f9e..14288ee21 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -85,3 +85,19 @@ bitcoin_test_check: $(TEST_BINARY) FORCE bitcoin_test_clean : FORCE rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY) + +%.json.h: %.json + @$(MKDIR_P) $(@D) + @echo "namespace json_tests{" > $@ + @echo "static unsigned const char $(*F)[] = {" >> $@ + @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@ + @echo "};};" >> $@ + @echo "Generated $@" + +%.raw.h: %.raw + @$(MKDIR_P) $(@D) + @echo "namespace alert_tests{" > $@ + @echo "static unsigned const char $(*F)[] = {" >> $@ + @$(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' >> $@ + @echo "};};" >> $@ + @echo "Generated $@" From 70c71c50ce552c0358679653c04d7cc72a40222c Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 5 Jun 2014 14:17:50 -0400 Subject: [PATCH 5/8] build: Tidy up file generation output - Some file generation was still noisy, silence it. - AM_V_GEN is used rather than @ so that 'make V=1' works as intended - Cut down on file copies and moves when using sed, use pipes instead - Avoid the use of top_ and abs_ dirs where possible --- src/Makefile.am | 10 +++++----- src/Makefile.qt.include | 34 +++++++++++++++------------------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index b3e713b9a..ce12ddcdb 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -210,16 +210,16 @@ clean-local: rm -f leveldb/*/*.gcno leveldb/helpers/memenv/*.gcno .rc.o: - @test -f $(WINDRES) && $(WINDRES) -i $< -o $@ || \ - echo error: could not build $@ + @test -f $(WINDRES) + $(AM_V_GEN) $(WINDRES) -i $< -o $@ .mm.o: - $(OBJC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(AM_V_CXX) $(OBJCXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CXXFLAGS) $(QT_INCLUDES) $(CXXFLAGS) -c -o $@ $< %.pb.cc %.pb.h: %.proto - test -f $(PROTOC) && $(PROTOC) --cpp_out=$(@D) --proto_path=$(abspath $( $@.n && mv $@{.n,} - $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} + @test -f $(RCC) + $(AM_V_GEN) cd $(srcdir); QT_SELECT=$(QT_SELECT) $(RCC) -name bitcoin $< | \ + $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $(abs_builddir)/$@ CLEAN_QT = $(nodist_qt_libbitcoinqt_a_SOURCES) $(QT_QM) $(QT_FORMS_H) qt/*.gcda qt/*.gcno @@ -387,22 +386,19 @@ bitcoin_qt_clean: FORCE bitcoin_qt : qt/bitcoin-qt$(EXEEXT) ui_%.h: %.ui - @test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D) - @test -f $(UIC) && QT_SELECT=$(QT_SELECT) $(UIC) -o $(abs_builddir)/$@ $(abs_srcdir)/$< || echo error: could not build $(abs_builddir)/$@ - $(SED) -e '/^\*\*.*Created:/d' $(abs_builddir)/$@ > $(abs_builddir)/$@.n && mv $(abs_builddir)/$@{.n,} - $(SED) -e '/^\*\*.*by:/d' $(abs_builddir)/$@ > $(abs_builddir)/$@.n && mv $(abs_builddir)/$@{.n,} + @test -f $(UIC) + @$(MKDIR_P) $(@D) + $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(UIC) -o $@ $< || (echo "Error creating $@"; false) %.moc: %.cpp - QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< - $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} - $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} + $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) $< | \ + $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@ moc_%.cpp: %.h - QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) -o $@ $< - $(SED) -e '/^\*\*.*Created:/d' $@ > $@.n && mv $@{.n,} - $(SED) -e '/^\*\*.*by:/d' $@ > $@.n && mv $@{.n,} + $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(QT_INCLUDES) $(MOC_DEFS) $< | \ + $(SED) -e '/^\*\*.*Created:/d' -e '/^\*\*.*by:/d' > $@ %.qm: %.ts - @test -d $(abs_builddir)/$(@D) || $(MKDIR_P) $(abs_builddir)/$(@D) - @test -f $(LRELEASE) && QT_SELECT=$(QT_SELECT) $(LRELEASE) $(abs_srcdir)/$< -qm $(abs_builddir)/$@ || \ - echo error: could not build $(abs_builddir)/$@ + @test -f $(LRELEASE) + @$(MKDIR_P) $(@D) + $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LRELEASE) -silent $< -qm $@ From 56c157d5e087e3976ae05cad2dc08a1fcd9a2400 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 5 Jun 2014 14:22:54 -0400 Subject: [PATCH 6/8] build: avoid the use of top_ and abs_ dir paths Using them has the side effect of confusing the dependency-tracking logic. --- src/Makefile.am | 14 +++++++------- src/Makefile.qt.include | 10 +++++----- src/Makefile.qttest.include | 6 +++--- src/Makefile.test.include | 2 +- src/m4/bitcoin_qt.m4 | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index ce12ddcdb..cb1c88883 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(INCLUDES) \ - -I$(top_builddir)/src/obj \ + -I$(builddir)/obj \ $(BDB_CPPFLAGS) \ $(BOOST_CPPFLAGS) $(BOOST_INCLUDES) AM_CPPFLAGS += $(LEVELDB_CPPFLAGS) @@ -8,10 +8,10 @@ AM_LDFLAGS = $(PTHREAD_CFLAGS) AM_CPPFLAGS += -I$(builddir) if EMBEDDED_LEVELDB -LEVELDB_CPPFLAGS += -I$(top_srcdir)/src/leveldb/include -LEVELDB_CPPFLAGS += -I$(top_srcdir)/src/leveldb/helpers/memenv -LIBLEVELDB += $(top_builddir)/src/leveldb/libleveldb.a -LIBMEMENV += $(top_builddir)/src/leveldb/libmemenv.a +LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include +LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/helpers/memenv +LIBLEVELDB += $(builddir)/leveldb/libleveldb.a +LIBMEMENV += $(builddir)/leveldb/libmemenv.a # NOTE: This dependency is not strictly necessary, but without it make may try to build both in parallel, which breaks the LevelDB build system in a race $(LIBLEVELDB): $(LIBMEMENV) @@ -101,7 +101,7 @@ JSON_H = \ json/json_spirit_writer_template.h obj/build.h: FORCE - @$(MKDIR_P) $(abs_top_builddir)/src/obj + @$(MKDIR_P) $(builddir)/obj @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \ $(abs_top_srcdir) version.o: obj/build.h @@ -164,7 +164,7 @@ libbitcoin_cli_a_SOURCES = \ rpcclient.cpp \ $(BITCOIN_CORE_H) -nodist_libbitcoin_common_a_SOURCES = $(top_srcdir)/src/obj/build.h +nodist_libbitcoin_common_a_SOURCES = $(srcdir)/obj/build.h # # bitcoind binary # diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index a25699e39..f434118ab 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -1,6 +1,6 @@ -AM_CPPFLAGS += -I$(top_srcdir)/src \ - -I$(top_builddir)/src/qt \ - -I$(top_builddir)/src/qt/forms \ +AM_CPPFLAGS += -I$(srcdir) \ + -I$(builddir)/qt \ + -I$(builddir)/qt/forms \ $(PROTOBUF_CFLAGS) \ $(QR_CFLAGS) bin_PROGRAMS += qt/bitcoin-qt @@ -320,7 +320,7 @@ RES_MOVIES = $(wildcard qt/res/movies/spinner-*.png) BITCOIN_RC = qt/res/bitcoin-qt-res.rc qt_libbitcoinqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ - -I$(top_srcdir)/src/qt/forms $(QT_DBUS_INCLUDES) + -I$(srcdir)/qt/forms $(QT_DBUS_INCLUDES) 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) @@ -342,7 +342,7 @@ $(QT_MOC_CPP): $(PROTOBUF_H) # bitcoin-qt binary # qt_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ - -I$(top_srcdir)/src/qt/forms + -I$(srcdir)/qt/forms qt_bitcoin_qt_SOURCES = qt/bitcoin.cpp if TARGET_DARWIN qt_bitcoin_qt_SOURCES += $(BITCOIN_MM) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 0d08a636e..09e61cf57 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -1,6 +1,6 @@ -AM_CPPFLAGS += -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/qt \ - -I$(top_builddir)/src/qt \ +AM_CPPFLAGS += -I$(srcdir) \ + -I$(srcdir)/qt \ + -I$(builddir)/qt \ $(PROTOBUF_CFLAGS) \ $(QR_CFLAGS) bin_PROGRAMS += qt/test/test_bitcoin-qt diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 14288ee21..1e4bd4ca8 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -1,4 +1,4 @@ -AM_CPPFLAGS += -I$(top_builddir)/src/test/ +AM_CPPFLAGS += -I$(builddir)/test/ TESTS += test/test_bitcoin bin_PROGRAMS += test/test_bitcoin diff --git a/src/m4/bitcoin_qt.m4 b/src/m4/bitcoin_qt.m4 index e71ecd717..244b03a5c 100644 --- a/src/m4/bitcoin_qt.m4 +++ b/src/m4/bitcoin_qt.m4 @@ -100,7 +100,7 @@ AC_DEFUN([BITCOIN_QT_CONFIGURE],[ BITCOIN_QT_PATH_PROGS([LRELEASE], [lrelease-qt${bitcoin_qt_got_major_vers} lrelease${bitcoin_qt_got_major_vers} lrelease], $qt_bin_path) BITCOIN_QT_PATH_PROGS([LUPDATE], [lupdate-qt${bitcoin_qt_got_major_vers} lupdate${bitcoin_qt_got_major_vers} lupdate],$qt_bin_path, yes) - MOC_DEFS='-DHAVE_CONFIG_H -I$(top_srcdir)/src' + MOC_DEFS='-DHAVE_CONFIG_H -I$(srcdir)' case $host in *darwin*) BITCOIN_QT_CHECK([ From f4d81129f0858685c33e79f74084f2931b8c21b4 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 5 Jun 2014 15:24:48 -0400 Subject: [PATCH 7/8] 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. --- src/Makefile.am | 16 +++++++++------- src/Makefile.qt.include | 18 +++++++++--------- src/Makefile.qttest.include | 8 ++------ src/Makefile.test.include | 4 +--- 4 files changed, 21 insertions(+), 25 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index cb1c88883..58a50adec 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,11 +1,6 @@ -AM_CPPFLAGS = $(INCLUDES) \ - -I$(builddir)/obj \ - $(BDB_CPPFLAGS) \ - $(BOOST_CPPFLAGS) $(BOOST_INCLUDES) -AM_CPPFLAGS += $(LEVELDB_CPPFLAGS) +AM_CPPFLAGS = $(INCLUDES) AM_LDFLAGS = $(PTHREAD_CFLAGS) -AM_CPPFLAGS += -I$(builddir) if EMBEDDED_LEVELDB LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include @@ -22,11 +17,14 @@ $(LIBLEVELDB) $(LIBMEMENV): OPT="$(CXXFLAGS) $(CPPFLAGS)" endif +BITCOIN_INCLUDES=-I$(builddir) -I$(builddir)/obj $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) + noinst_LIBRARIES = \ libbitcoin_server.a \ libbitcoin_common.a \ libbitcoin_cli.a if ENABLE_WALLET +BITCOIN_INCLUDES += $(BDB_CPPFLAGS) noinst_LIBRARIES += libbitcoin_wallet.a endif @@ -106,6 +104,7 @@ obj/build.h: FORCE $(abs_top_srcdir) version.o: obj/build.h +libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_server_a_SOURCES = \ addrman.cpp \ alert.cpp \ @@ -130,6 +129,7 @@ libbitcoin_server_a_SOURCES = \ $(JSON_H) \ $(BITCOIN_CORE_H) +libbitcoin_wallet_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_wallet_a_SOURCES = \ db.cpp \ crypter.cpp \ @@ -139,6 +139,7 @@ libbitcoin_wallet_a_SOURCES = \ walletdb.cpp \ $(BITCOIN_CORE_H) +libbitcoin_common_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_common_a_SOURCES = \ base58.cpp \ allocators.cpp \ @@ -184,8 +185,8 @@ if TARGET_WINDOWS bitcoind_SOURCES += bitcoind-res.rc endif -AM_CPPFLAGS += $(BDB_CPPFLAGS) bitcoind_LDADD += $(BOOST_LIBS) $(BDB_LIBS) +bitcoind_CPPFLAGS = $(BITCOIN_INCLUDES) # bitcoin-cli binary # bitcoin_cli_LDADD = \ @@ -193,6 +194,7 @@ bitcoin_cli_LDADD = \ libbitcoin_common.a \ $(BOOST_LIBS) bitcoin_cli_SOURCES = bitcoin-cli.cpp +bitcoin_cli_CPPFLAGS = $(BITCOIN_INCLUDES) # if TARGET_WINDOWS diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index f434118ab..749b976c4 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -1,8 +1,3 @@ -AM_CPPFLAGS += -I$(srcdir) \ - -I$(builddir)/qt \ - -I$(builddir)/qt/forms \ - $(PROTOBUF_CFLAGS) \ - $(QR_CFLAGS) bin_PROGRAMS += qt/bitcoin-qt 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 -qt_libbitcoinqt_a_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ - -I$(srcdir)/qt/forms $(QT_DBUS_INCLUDES) +BITCOIN_QT_INCLUDES = -I$(builddir)/qt -I$(srcdir)/qt -I$(srcdir)/qt/forms \ + -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_QRC) $(QT_TS) $(PROTOBUF_PROTO) $(RES_ICONS) $(RES_IMAGES) $(RES_MOVIES) @@ -341,8 +340,9 @@ $(QT_MOC): $(PROTOBUF_H) $(QT_MOC_CPP): $(PROTOBUF_H) # bitcoin-qt binary # -qt_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(QT_INCLUDES) \ - -I$(srcdir)/qt/forms +qt_bitcoin_qt_CPPFLAGS = $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \ + $(QT_INCLUDES) $(PROTOBUF_CFLAGS) $(QR_CFLAGS) + qt_bitcoin_qt_SOURCES = qt/bitcoin.cpp if TARGET_DARWIN qt_bitcoin_qt_SOURCES += $(BITCOIN_MM) diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include index 09e61cf57..e0b49d024 100644 --- a/src/Makefile.qttest.include +++ b/src/Makefile.qttest.include @@ -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 TESTS += qt/test/test_bitcoin-qt @@ -17,7 +12,8 @@ TEST_QT_H = \ qt/test/paymentrequestdata.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_main.cpp \ diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 1e4bd4ca8..988830260 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -1,5 +1,3 @@ -AM_CPPFLAGS += -I$(builddir)/test/ - TESTS += test/test_bitcoin bin_PROGRAMS += test/test_bitcoin TEST_SRCDIR = test @@ -62,7 +60,7 @@ BITCOIN_TESTS += \ endif 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) \ $(BOOST_LIBS) $(BOOST_UNIT_TEST_FRAMEWORK_LIB) if ENABLE_WALLET From efe6888407186b8a468f357fa7084c0a8c3de503 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Thu, 5 Jun 2014 15:51:05 -0400 Subject: [PATCH 8/8] build: fix version dependency --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 58a50adec..3016be47b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -102,7 +102,7 @@ obj/build.h: FORCE @$(MKDIR_P) $(builddir)/obj @$(top_srcdir)/share/genbuild.sh $(abs_top_builddir)/src/obj/build.h \ $(abs_top_srcdir) -version.o: obj/build.h +libbitcoin_common_a-version.$(OBJEXT): obj/build.h libbitcoin_server_a_CPPFLAGS = $(BITCOIN_INCLUDES) libbitcoin_server_a_SOURCES = \