aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2014-05-28 13:38:41 -0400
committerCory Fields <cory-nospam-@coryfields.com>2014-06-05 16:05:17 -0400
commit65e8ba4dbed519a3be6d497063c3441550c4b3d6 (patch)
treef05cfb485fd966979014972cfbb249526466cdbe /src
parent5795aaca26d23d315f80ee0b45f1e1fa939e5cfd (diff)
downloadbitcoin-65e8ba4dbed519a3be6d497063c3441550c4b3d6.tar.xz
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.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am21
-rw-r--r--src/Makefile.include17
-rw-r--r--src/Makefile.qt.include387
-rw-r--r--src/Makefile.qttest.include52
-rw-r--r--src/Makefile.test.include87
5 files changed, 546 insertions, 18 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index a49ad58716..e7d121b4d6 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 2fc6cd7775..d3d3d6385a 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 0000000000..dcb3f37f50
--- /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 0000000000..0d08a636e9
--- /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 0000000000..4a70b0f9e9
--- /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)