summaryrefslogtreecommitdiff
path: root/Makefile.am
blob: c7cf5deb6f125bf54b5d9a5f1598dadfccff80d5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
lib_LIBRARIES = libledger.a
libledger_a_CXXFLAGS =
libledger_a_SOURCES = \
	amount.cc      \
	balance.cc     \
	binary.cc      \
	config.cc      \
	datetime.cc    \
	derive.cc      \
	format.cc      \
	journal.cc     \
	mask.cc        \
	option.cc      \
	parser.cc      \
	qif.cc	       \
	quotes.cc      \
	textual.cc     \
	valexpr.cc     \
	value.cc       \
	walk.cc
if HAVE_XMLPARSE
libledger_a_SOURCES += gnucash.cc xml.cc
endif
if HAVE_BOOST_PYTHON
libledger_a_CXXFLAGS += -DUSE_BOOST_PYTHON=1
libledger_a_SOURCES  += py_eval.cc
endif
if DEBUG
libledger_a_CXXFLAGS += -DDEBUG_LEVEL=4
libledger_a_SOURCES  += debug.cc
endif

pkginclude_HEADERS = \
	acconf.h     \
	amount.h     \
	balance.h    \
	binary.h     \
	config.h     \
	datetime.h   \
	debug.h      \
	derive.h     \
	error.h      \
	format.h     \
	gnucash.h    \
	journal.h    \
	ledger.h     \
	mask.h       \
	option.h     \
	parser.h     \
	py_eval.h    \
	pyledger.h   \
	qif.h	     \
	quotes.h     \
	textual.h    \
	timing.h     \
	util.h	     \
	valexpr.h    \
	value.h      \
	walk.h       \
	xml.h

######################################################################

bin_PROGRAMS = ledger
ledger_CXXFLAGS =
ledger_SOURCES = main.cc
if HAVE_BOOST_PYTHON
ledger_CXXFLAGS += -DUSE_BOOST_PYTHON=1
ledger_LDADD = $(LIBOBJS) libledger.a -lboost_python -lpython$(PYTHON_VERSION)
else
ledger_LDADD = $(LIBOBJS) libledger.a
endif
if DEBUG
ledger_CXXFLAGS += -DDEBUG_LEVEL=4
endif

info_TEXINFOS = ledger.texi

######################################################################

if HAVE_BOOST_PYTHON

noinst_PROGRAMS = ledger.so

if HAVE_XMLPARSE
HAVE_XMLPARSE_VALUE = true
else
HAVE_XMLPARSE_VALUE = false
endif

ledger.so: py_eval.cc libledger.a
	CFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS) -L." \
	HAVE_XMLPARSE="$(HAVE_XMLPARSE_VALUE)" \
	    python setup.py build --build-lib=.

install-exec-hook:
	CFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS) -L." \
	HAVE_XMLPARSE="$(HAVE_XMLPARSE_VALUE)" \
	    python setup.py install --prefix=$(prefix)

endif

all-clean: maintainer-clean
	rm -fr	*~ .*~ .\#* *.html *.info *.pdf *.a *.so *.o *.lo *.la \
		*.elc *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.pyc \
		.gdb_history gmon.out h out TAGS ledger valexpr .deps \
		build AUTHORS COPYING INSTALL Makefile aclocal.m4 autom4te \
		acconf.h acconf.h.in  config.guess config.sub configure \
		depcomp install-sh missing stamp texinfo.tex Makefile.in