From 65beb8792cbdc76a974f434652eca5314017dab3 Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Thu, 17 Dec 2009 01:43:31 +0000 Subject: [PATCH] build system cleanup; test system separation into white-box, black-box, and public tests --- Makefile | 3 ++- Makefile.subdir | 3 +++ src/Makefile | 1 - src/context/Makefile | 1 - src/expr/Makefile | 1 - src/main/Makefile | 1 - src/parser/Makefile | 1 - src/parser/cvc/Makefile | 1 - src/parser/smt/Makefile | 1 - src/prop/Makefile | 1 - src/prop/minisat/Makefile | 1 - src/smt/Makefile | 1 - src/theory/Makefile | 1 - src/theory/uf/Makefile | 1 - src/util/Makefile | 1 - test/Makefile | 1 - test/regress/Makefile | 1 - test/unit/Makefile | 1 - test/unit/Makefile.am | 27 +++++++++++++++++++++------ test/unit/Makefile.in | 36 ++++++++++++++++++++++++------------ 20 files changed, 50 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index 01bf537bc..aa8ebf232 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ -builddir = builds +topdir = . +srcdir = . include Makefile.subdir diff --git a/Makefile.subdir b/Makefile.subdir index 6aa62bf28..da450345b 100644 --- a/Makefile.subdir +++ b/Makefile.subdir @@ -1,3 +1,6 @@ +include $(topdir)/builds/current +builddir = $(topdir)/builds/$(CURRENT_BUILD)/$(srcdir) + .PHONY: _default_build_ _default_build_: all %: diff --git a/src/Makefile b/src/Makefile index e119c83d7..dc23e2272 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,4 @@ topdir = .. srcdir = src -builddir = $(topdir)/builds/$(srcdir) include $(topdir)/Makefile.subdir diff --git a/src/context/Makefile b/src/context/Makefile index 5286dd3ac..44ac0f2e6 100644 --- a/src/context/Makefile +++ b/src/context/Makefile @@ -1,5 +1,4 @@ topdir = ../.. srcdir = src/context -builddir = $(topdir)/builds/$(srcdir) include $(topdir)/Makefile.subdir diff --git a/src/expr/Makefile b/src/expr/Makefile index b661835a5..eff3b332e 100644 --- a/src/expr/Makefile +++ b/src/expr/Makefile @@ -1,5 +1,4 @@ topdir = ../.. srcdir = src/expr -builddir = $(topdir)/builds/$(srcdir) include $(topdir)/Makefile.subdir diff --git a/src/main/Makefile b/src/main/Makefile index 686674906..5e936ee06 100644 --- a/src/main/Makefile +++ b/src/main/Makefile @@ -1,5 +1,4 @@ topdir = ../.. srcdir = src/main -builddir = $(topdir)/builds/$(srcdir) include $(topdir)/Makefile.subdir diff --git a/src/parser/Makefile b/src/parser/Makefile index 1ea7edf5d..cef81750e 100644 --- a/src/parser/Makefile +++ b/src/parser/Makefile @@ -1,5 +1,4 @@ topdir = ../.. srcdir = src/parser -builddir = $(topdir)/builds/$(srcdir) include $(topdir)/Makefile.subdir diff --git a/src/parser/cvc/Makefile b/src/parser/cvc/Makefile index c91554a47..cbcc0a493 100644 --- a/src/parser/cvc/Makefile +++ b/src/parser/cvc/Makefile @@ -1,5 +1,4 @@ topdir = ../../.. srcdir = src/parser/cvc -builddir = $(topdir)/builds/$(srcdir) include $(topdir)/Makefile.subdir diff --git a/src/parser/smt/Makefile b/src/parser/smt/Makefile index aa3e74236..7e97ed357 100644 --- a/src/parser/smt/Makefile +++ b/src/parser/smt/Makefile @@ -1,5 +1,4 @@ topdir = ../../.. srcdir = src/parser/smt -builddir = $(topdir)/builds/$(srcdir) include $(topdir)/Makefile.subdir diff --git a/src/prop/Makefile b/src/prop/Makefile index 79fe1084b..08f0c693c 100644 --- a/src/prop/Makefile +++ b/src/prop/Makefile @@ -1,5 +1,4 @@ topdir = ../.. srcdir = src/prop -builddir = $(topdir)/builds/$(srcdir) include $(topdir)/Makefile.subdir diff --git a/src/prop/minisat/Makefile b/src/prop/minisat/Makefile index 49512a1cd..e8b442ac1 100644 --- a/src/prop/minisat/Makefile +++ b/src/prop/minisat/Makefile @@ -1,5 +1,4 @@ topdir = ../../.. srcdir = src/prop/minisat -builddir = $(topdir)/builds/$(srcdir) include $(topdir)/Makefile.subdir diff --git a/src/smt/Makefile b/src/smt/Makefile index 84a43ff39..7103b6d21 100644 --- a/src/smt/Makefile +++ b/src/smt/Makefile @@ -1,5 +1,4 @@ topdir = ../.. srcdir = src/smt -builddir = $(topdir)/builds/$(srcdir) include $(topdir)/Makefile.subdir diff --git a/src/theory/Makefile b/src/theory/Makefile index 2a4a03491..da7d0e6b9 100644 --- a/src/theory/Makefile +++ b/src/theory/Makefile @@ -1,5 +1,4 @@ topdir = ../.. srcdir = src/theory -builddir = $(topdir)/$(builds)/$(srcdir) include $(topdir)/Makefile.subdir diff --git a/src/theory/uf/Makefile b/src/theory/uf/Makefile index 524ff2009..c3c641384 100644 --- a/src/theory/uf/Makefile +++ b/src/theory/uf/Makefile @@ -1,5 +1,4 @@ topdir = ../../.. srcdir = src/theory/uf -builddir = $(topdir)/builds/$(srcdir) include $(topdir)/Makefile.subdir diff --git a/src/util/Makefile b/src/util/Makefile index 0bd2f197b..ea9087049 100644 --- a/src/util/Makefile +++ b/src/util/Makefile @@ -1,5 +1,4 @@ topdir = ../.. srcdir = src/util -builddir = $(topdir)/builds/$(srcdir) include $(topdir)/Makefile.subdir diff --git a/test/Makefile b/test/Makefile index 80f8a1dd5..ba9d12788 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,5 +1,4 @@ topdir = .. srcdir = test -builddir = $(topdir)/builds/$(srcdir) include $(topdir)/Makefile.subdir diff --git a/test/regress/Makefile b/test/regress/Makefile index c4e305306..2946f5217 100644 --- a/test/regress/Makefile +++ b/test/regress/Makefile @@ -1,5 +1,4 @@ topdir = ../.. srcdir = test/regress -builddir = $(topdir)/builds/$(srcdir) include $(topdir)/Makefile.subdir diff --git a/test/unit/Makefile b/test/unit/Makefile index f3f3767aa..190a41bb0 100644 --- a/test/unit/Makefile +++ b/test/unit/Makefile @@ -1,5 +1,4 @@ topdir = ../.. srcdir = test/unit -builddir = $(topdir)/builds/$(srcdir) include $(topdir)/Makefile.subdir diff --git a/test/unit/Makefile.am b/test/unit/Makefile.am index 0a1239b81..ca85a779f 100644 --- a/test/unit/Makefile.am +++ b/test/unit/Makefile.am @@ -2,13 +2,20 @@ if HAVE_CXXTESTGEN AM_CPPFLAGS = \ -I. "-I@CXXTEST@" "-I@top_srcdir@/src/include" "-I@top_srcdir@/src" -AM_LDFLAGS = \ +AM_CXXFLGAS_WHITE = -fno-access-control +AM_CXXFLGAS_BLACK = +AM_CXXFLGAS_PUBLIC = +AM_LDFLAGS_WHITE = \ @abs_top_builddir@/src/context/libcontext.la \ @abs_top_builddir@/src/expr/libexpr.la \ @abs_top_builddir@/src/smt/libsmt.la \ @abs_top_builddir@/src/theory/libtheory.la \ @abs_top_builddir@/src/util/libutil.la \ @abs_top_builddir@/src/prop/minisat/libminisat.la +AM_LDFLAGS_BLACK = \ + $(AM_LDFLAGS_WHITE) +AM_LDFLAGS_PUBLIC = \ + @abs_top_builddir@/src/libcvc4.la TESTS_WHITE = \ expr/node_white @@ -16,9 +23,12 @@ TESTS_WHITE = \ TESTS_BLACK = \ expr/node_black +TESTS_PUBLIC = + TESTS = \ $(TESTS_WHITE) \ - $(TESTS_BLACK) + $(TESTS_BLACK) \ + $(TESTS_PUBLIC) lib_LTLIBRARIES = libdummy.la libdummy_la_SOURCES = expr/node_black.cpp @@ -30,13 +40,18 @@ $(TESTS:%=%.cpp): %.cpp: %.h $(TESTS_WHITE): %: %.cpp # get these in here somehow # $(TEST_CPPFLAGS) $(TEST_CXXFLAGS) $(TEST_LDFLAGS) - $(LTCXXCOMPILE) -c -fno-access-control -o $@.lo $< - $(CXXLINK) $@.lo + $(LTCXXCOMPILE) $(AM_CXXFLAGS_WHITE) -c -o $@.lo $< + $(CXXLINK) $(AM_LDFLAGS_WHITE) $@.lo $(TESTS_BLACK): %: %.cpp # get these in here somehow # $(TEST_CPPFLAGS) $(TEST_CXXFLAGS) $(TEST_LDFLAGS) - $(LTCXXCOMPILE) -c -o $@.lo $< - $(CXXLINK) $@.lo + $(LTCXXCOMPILE) $(AM_CXXFLAGS_BLACK) -c -o $@.lo $< + $(CXXLINK) $(AM_LDFLAGS_BLACK) $@.lo +$(TESTS_PUBLIC): %: %.cpp +# get these in here somehow +# $(TEST_CPPFLAGS) $(TEST_CXXFLAGS) $(TEST_LDFLAGS) + $(LTCXXCOMPILE) $(AM_CXXFLAGS_PUBLIC) -c -o $@.lo $< + $(CXXLINK) $(AM_LDFLAGS_PUBLIC) $@.lo MOSTLYCLEANFILES = $(TESTS) $(TESTS:%=%.cpp) diff --git a/test/unit/Makefile.in b/test/unit/Makefile.in index d5c49cc78..5432c809e 100644 --- a/test/unit/Makefile.in +++ b/test/unit/Makefile.in @@ -35,6 +35,9 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ +@HAVE_CXXTESTGEN_FALSE@TESTS = no_cxxtest +@HAVE_CXXTESTGEN_TRUE@TESTS = $(TESTS_WHITE) $(TESTS_BLACK) \ +@HAVE_CXXTESTGEN_TRUE@ $(am__EXEEXT_1) subdir = test/unit DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -98,6 +101,7 @@ ETAGS = etags CTAGS = ctags am__tty_colors = \ red=; grn=; lgn=; blu=; std= +am__EXEEXT_1 = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -238,7 +242,10 @@ top_srcdir = @top_srcdir@ @HAVE_CXXTESTGEN_TRUE@AM_CPPFLAGS = \ @HAVE_CXXTESTGEN_TRUE@ -I. "-I@CXXTEST@" "-I@top_srcdir@/src/include" "-I@top_srcdir@/src" -@HAVE_CXXTESTGEN_TRUE@AM_LDFLAGS = \ +@HAVE_CXXTESTGEN_TRUE@AM_CXXFLGAS_WHITE = -fno-access-control +@HAVE_CXXTESTGEN_TRUE@AM_CXXFLGAS_BLACK = +@HAVE_CXXTESTGEN_TRUE@AM_CXXFLGAS_PUBLIC = +@HAVE_CXXTESTGEN_TRUE@AM_LDFLAGS_WHITE = \ @HAVE_CXXTESTGEN_TRUE@ @abs_top_builddir@/src/context/libcontext.la \ @HAVE_CXXTESTGEN_TRUE@ @abs_top_builddir@/src/expr/libexpr.la \ @HAVE_CXXTESTGEN_TRUE@ @abs_top_builddir@/src/smt/libsmt.la \ @@ -246,19 +253,19 @@ top_srcdir = @top_srcdir@ @HAVE_CXXTESTGEN_TRUE@ @abs_top_builddir@/src/util/libutil.la \ @HAVE_CXXTESTGEN_TRUE@ @abs_top_builddir@/src/prop/minisat/libminisat.la +@HAVE_CXXTESTGEN_TRUE@AM_LDFLAGS_BLACK = \ +@HAVE_CXXTESTGEN_TRUE@ $(AM_LDFLAGS_WHITE) + +@HAVE_CXXTESTGEN_TRUE@AM_LDFLAGS_PUBLIC = \ +@HAVE_CXXTESTGEN_TRUE@ @abs_top_builddir@/src/libcvc4.la + @HAVE_CXXTESTGEN_TRUE@TESTS_WHITE = \ @HAVE_CXXTESTGEN_TRUE@ expr/node_white @HAVE_CXXTESTGEN_TRUE@TESTS_BLACK = \ @HAVE_CXXTESTGEN_TRUE@ expr/node_black - -# force a user-visible failure for "make check" -@HAVE_CXXTESTGEN_FALSE@TESTS = no_cxxtest -@HAVE_CXXTESTGEN_TRUE@TESTS = \ -@HAVE_CXXTESTGEN_TRUE@ $(TESTS_WHITE) \ -@HAVE_CXXTESTGEN_TRUE@ $(TESTS_BLACK) - +@HAVE_CXXTESTGEN_TRUE@TESTS_PUBLIC = @HAVE_CXXTESTGEN_TRUE@lib_LTLIBRARIES = libdummy.la @HAVE_CXXTESTGEN_TRUE@libdummy_la_SOURCES = expr/node_black.cpp @HAVE_CXXTESTGEN_TRUE@libdummy_la_LIBADD = @abs_top_builddir@/src/libcvc4.la @@ -675,13 +682,18 @@ uninstall-am: uninstall-libLTLIBRARIES @HAVE_CXXTESTGEN_TRUE@$(TESTS_WHITE): %: %.cpp # get these in here somehow # $(TEST_CPPFLAGS) $(TEST_CXXFLAGS) $(TEST_LDFLAGS) -@HAVE_CXXTESTGEN_TRUE@ $(LTCXXCOMPILE) -c -fno-access-control -o $@.lo $< -@HAVE_CXXTESTGEN_TRUE@ $(CXXLINK) $@.lo +@HAVE_CXXTESTGEN_TRUE@ $(LTCXXCOMPILE) $(AM_CXXFLAGS_WHITE) -c -o $@.lo $< +@HAVE_CXXTESTGEN_TRUE@ $(CXXLINK) $(AM_LDFLAGS_WHITE) $@.lo @HAVE_CXXTESTGEN_TRUE@$(TESTS_BLACK): %: %.cpp # get these in here somehow # $(TEST_CPPFLAGS) $(TEST_CXXFLAGS) $(TEST_LDFLAGS) -@HAVE_CXXTESTGEN_TRUE@ $(LTCXXCOMPILE) -c -o $@.lo $< -@HAVE_CXXTESTGEN_TRUE@ $(CXXLINK) $@.lo +@HAVE_CXXTESTGEN_TRUE@ $(LTCXXCOMPILE) $(AM_CXXFLAGS_BLACK) -c -o $@.lo $< +@HAVE_CXXTESTGEN_TRUE@ $(CXXLINK) $(AM_LDFLAGS_BLACK) $@.lo +@HAVE_CXXTESTGEN_TRUE@$(TESTS_PUBLIC): %: %.cpp +# get these in here somehow +# $(TEST_CPPFLAGS) $(TEST_CXXFLAGS) $(TEST_LDFLAGS) +@HAVE_CXXTESTGEN_TRUE@ $(LTCXXCOMPILE) $(AM_CXXFLAGS_PUBLIC) -c -o $@.lo $< +@HAVE_CXXTESTGEN_TRUE@ $(CXXLINK) $(AM_LDFLAGS_PUBLIC) $@.lo # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. -- 2.30.2