summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am277
1 files changed, 194 insertions, 83 deletions
diff --git a/Makefile.am b/Makefile.am
index bb483b26..06d0a12d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,23 +1,44 @@
+BUILT_SOURCES =
+CLEANFILES =
+EXTRA_DIST = LICENSE doc test contrib scripts setup.py \
+ acprep valgrind.sh version
+
+ESC_srcdir=`echo "$(srcdir)" | sed 's/\//\\\\\//g'`
+ESC_builddir=`echo "$(top_builddir)" | sed 's/\//\\\\\//g'`
+ESC_distdir=`echo "$(distdir)" | sed 's/\//\\\\\//g'`
+
+dist-hook:
+ rm -fr .git
+
lib_LTLIBRARIES = libamounts.la libledger.la
-libamounts_la_CXXFLAGS =
+libamounts_la_CPPFLAGS =
libamounts_la_SOURCES = \
amount.cc \
+ commodity.cc \
balance.cc \
- datetime.cc \
- value.cc
+ value.cc \
+ times.cc \
+ utils.cc
+if HAVE_EXPAT
+libamounts_la_CPPFLAGS += -DHAVE_EXPAT=1
+endif
+if HAVE_XMLPARSE
+libamounts_la_CPPFLAGS += -DHAVE_XMLPARSE=1
+endif
+if HAVE_LIBOFX
+libamounts_la_CPPFLAGS += -DHAVE_LIBOFX=1
+endif
if HAVE_BOOST_PYTHON
-libamounts_la_CXXFLAGS += -DUSE_BOOST_PYTHON=1
+libamounts_la_CPPFLAGS += -DUSE_BOOST_PYTHON=1
endif
if DEBUG
-libamounts_la_CXXFLAGS += -DDEBUG_LEVEL=4
-libamounts_la_SOURCES += debug.cc
+libamounts_la_CPPFLAGS += -DDEBUG_MODE
endif
-libledger_la_CXXFLAGS =
+libledger_la_CPPFLAGS = $(libamounts_la_CPPFLAGS)
libledger_la_SOURCES = \
binary.cc \
- config.cc \
csv.cc \
derive.cc \
emacs.cc \
@@ -25,45 +46,40 @@ libledger_la_SOURCES = \
journal.cc \
mask.cc \
option.cc \
- parser.cc \
+ parsexp.cc \
qif.cc \
- quotes.cc \
reconcile.cc \
report.cc \
- startup.cc \
+ session.cc \
textual.cc \
valexpr.cc \
walk.cc \
xml.cc
+# quotes.cc this is currently not being included
if HAVE_EXPAT
-libledger_la_CXXFLAGS += -DHAVE_EXPAT=1
libledger_la_SOURCES += gnucash.cc
endif
if HAVE_XMLPARSE
-libledger_la_CXXFLAGS += -DHAVE_XMLPARSE=1
libledger_la_SOURCES += gnucash.cc
endif
if HAVE_LIBOFX
-libledger_la_CXXFLAGS += -DHAVE_LIBOFX=1
libledger_la_SOURCES += ofx.cc
endif
-if DEBUG
-libledger_la_CXXFLAGS += -DDEBUG_LEVEL=4
-endif
-libledger_la_LDFLAGS = -release 2.6.1
+
+libledger_la_LDFLAGS = -release 2.7.0
pkginclude_HEADERS = \
acconf.h \
\
amount.h \
+ commodity.h \
balance.h \
- datetime.h \
+ balpair.h \
value.h \
- debug.h \
- util.h \
+ times.h \
+ utils.h \
\
binary.h \
- config.h \
csv.h \
derive.h \
emacs.h \
@@ -75,42 +91,44 @@ pkginclude_HEADERS = \
mask.h \
option.h \
parser.h \
+ parsexp.h \
qif.h \
quotes.h \
reconcile.h \
report.h \
textual.h \
- timing.h \
valexpr.h \
walk.h \
xml.h
-######################################################################
+if USE_PCH
+nodist_libledger_la_SOURCES = system.hh.gch
-bin_PROGRAMS = ledger
-ledger_CXXFLAGS =
-ledger_SOURCES = main.cc
-ledger_LDADD = $(LIBOBJS) libamounts.la libledger.la
-if HAVE_EXPAT
-ledger_CXXFLAGS += -DHAVE_EXPAT=1
-endif
-if HAVE_XMLPARSE
-ledger_CXXFLAGS += -DHAVE_XMLPARSE=1
-endif
-if HAVE_LIBOFX
-ledger_CXXFLAGS += -DHAVE_LIBOFX=1
-endif
-if DEBUG
-ledger_CXXFLAGS += -DDEBUG_LEVEL=4
-endif
-ledger_LDFLAGS = -static # for the sake of command-line speed
+BUILT_SOURCES += system.hh.gch
+CLEANFILES += system.hh.gch system.hh
-info_TEXINFOS = ledger.texi
+$(top_builddir)/system.hh.gch: $(srcdir)/system.hh $(top_builddir)/acconf.h
+ echo "#include \"$(srcdir)/system.hh\"" > $(top_builddir)/system.hh
+ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(libledger_la_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
+ -g -o $@ $(srcdir)/system.hh
+endif
######################################################################
-lisp_LISP = ledger.el timeclock.el
-dist_lisp_LISP = ledger.el timeclock.el
+bin_PROGRAMS = ledger
+
+ledger_CPPFLAGS = $(libledger_la_CPPFLAGS)
+ledger_SOURCES = main.cc
+ledger_LDADD = $(LIBOBJS) libamounts.la libledger.la
+ledger_LDFLAGS = -static # for the sake of command-line speed
+
+info_TEXINFOS = ledger.texi
+
+dist_lisp_LISP = ledger.el timeclock.el
+
+DISTCLEANFILES = ledger.elc timeclock.elc
######################################################################
@@ -118,59 +136,152 @@ if HAVE_BOOST_PYTHON
noinst_PROGRAMS = amounts.so
+CLEANFILES += amounts.so
+
+clean-local:
+ rm -fr build
+
+PYLIBS = amounts gmp
+
amounts.so: amounts.cc libamounts.la
- CFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS) -L. -L.libs" \
- python setup.py build --build-lib=.
+ CFLAGS="$(CPPFLAGS) $(DEFAULT_INCLUDES) $(libamounts_la_CPPFLAGS)" \
+ LDFLAGS="$(LDFLAGS) -L. -L.libs" \
+ PYLIBS="$(PYLIBS)" SRCDIR="$(srcdir)" \
+ python $(srcdir)/setup.py build --build-lib=.
install-exec-hook:
- CFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS) -L. -L.libs" \
- python setup.py install --prefix=$(prefix)
+ CFLAGS="$(CPPFLAGS) $(DEFAULT_INCLUDES) $(libamounts_la_CPPFLAGS)" \
+ LDFLAGS="$(LDFLAGS) -L. -L.libs" \
+ PYLIBS="$(PYLIBS)" SRCDIR="$(srcdir)" \
+ python $(srcdir)/setup.py install --prefix=$(prefix)
endif
######################################################################
-TESTS = alltests
+TESTS = UnitTests
+if HAVE_BOOST_PYTHON
+TESTS += PyUnitTests
+endif
-CXXTEST_DIR = /usr/local/cxxtest
-TESTGEN = $(CXXTEST_DIR)/cxxtestgen.py
-TESTSUITES = tests/*.h
+check_PROGRAMS = $(TESTS)
-AM_CXXFLAGS =
-if HAVE_EXPAT
-AM_CXXFLAGS += -DHAVE_EXPAT=1
-endif
-if HAVE_XMLPARSE
-AM_CXXFLAGS += -DHAVE_XMLPARSE=1
-endif
-if HAVE_LIBOFX
-AM_CXXFLAGS += -DHAVE_LIBOFX=1
-endif
-if DEBUG
-AM_CXXFLAGS += -DDEBUG_LEVEL=4
-endif
+nodist_UnitTests_SOURCES = test/UnitTests.cc \
+ \
+ test/utility/t_utils.cc \
+ test/utility/t_times.cc \
+ test/numerics/t_commodity.cc \
+ test/numerics/t_amount.cc \
+ test/numerics/t_balance.cc
+
+UnitTests_CPPFLAGS = -I$(srcdir)/test $(libledger_la_CPPFLAGS)
+UnitTests_LDFLAGS = $(LIBADD_DL)
+UnitTests_LDADD = $(lib_LTLIBRARIES) -lcppunit
+
+nodist_PyUnitTests_SOURCES = test/python/PyUnitTests.py
+
+# jww (2007-05-10): This rule will not be triggered on systems that
+# define an EXEEXT.
+PyUnitTests: $(srcdir)/test/python/PyUnitTests.py
+ cat $(srcdir)/test/python/PyUnitTests.py \
+ | sed "s/%srcdir%/$(ESC_srcdir)/g" \
+ | sed "s/%builddir%/$(ESC_builddir)/g" > $@
+ chmod 755 $@
+
+fullcheck: check
+ MallocGuardEdges=1 \
+ MallocScribble=1 \
+ MallocPreScribble=1 \
+ MallocCheckHeapStart=100 \
+ MallocCheckHeapEach=100 \
+ DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib \
+ $(srcdir)/valgrind.sh $(top_builddir)/UnitTests$(EXEEXT) --verify
-alltests.cc: $(TESTSUITES)
- test -f $(TESTGEN) && python $(TESTGEN) -o $@ --error-printer $(TESTSUITES)
+###############################################################################
-alltests: alltests.cc ledger
- $(CXXCOMPILE) -I$(CXXTEST_DIR) -lexpat -lgmp -lpcre -o $@ \
- alltests.cc -L. -L.libs -lamounts -lledger
+DISTCLEANFILES += Doxyfile.gen
-runtests: alltests
- LD_LIBRARY_PATH=.libs ./alltests && tests/regress && tests/regtest
+alldocs: ledger.info ledger.pdf doxygen-docs
-verify: runtests
- python tests/runtests.py
+$(top_builddir)/Doxyfile.gen: $(srcdir)/Doxyfile
+ cat $(srcdir)/Doxyfile \
+ | sed "s/%srcdir%/$(ESC_srcdir)/g" \
+ | sed "s/%builddir%/$(ESC_builddir)/g" > $@
+
+doxygen-docs: $(top_builddir)/Doxyfile.gen
+ doxygen $(top_builddir)/Doxyfile.gen
######################################################################
-all-clean: maintainer-clean
- rm -fr *~ .*~ .\#* *.html *.info *.pdf *.a *.so *.o *.lo *.la \
- *.elc *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr \
- .gdb_history gmon.out h out TAGS ledger valexpr .deps \
- .libs build AUTHORS COPYING INSTALL Makefile acconf.h \
- acconf.h.in aclocal.m4 autom4te config.guess config.sub \
- configure depcomp install-sh libtool ltconfig ltmain.sh \
- missing stamp texinfo.tex Makefile.in mkinstalldirs \
- elisp-comp elc-stamp py-compile
+clean-backupfiles:
+ rm -fr *~ \
+ .*~ \
+ .\#*
+
+clean-documentation:
+ rm -fr *.aux \
+ *.cp \
+ *.fn \
+ *.info \
+ *.ky \
+ *.log \
+ *.pdf \
+ *.pg \
+ *.toc \
+ *.tp \
+ *.vr
+
+clean-buildproducts:
+ rm -fr *.Plo \
+ *.Po \
+ *.a \
+ *.elc \
+ *.gcno \
+ *.gdca \
+ *.la \
+ *.lo \
+ *.o \
+ *.so \
+ .deps \
+ .libs \
+ build
+
+clean-debugdata:
+ rm -fr .gdb_history \
+ TAGS \
+ gmon.out \
+ h \
+ out
+
+clean-autoconf:
+ rm -fr Makefile \
+ Makefile.in \
+ acconf.h \
+ acconf.h.in \
+ aclocal.m4 \
+ autom4te.cache \
+ compile \
+ config.guess \
+ config.sub \
+ configure \
+ depcomp \
+ elc-stamp \
+ elc-temp \
+ elisp-comp \
+ install-sh \
+ libtool \
+ ltconfig \
+ ltmain.sh \
+ missing \
+ mkinstalldirs \
+ py-compile \
+ stamp \
+ texinfo.tex \
+ ylwrap
+
+scour: maintainer-clean \
+ clean-buildproducts \
+ clean-backupfiles \
+ clean-debugdata \
+ clean-documentation \
+ clean-autoconf