blob: 28165969c28e6637f7304a3bcbf19c71424d371b (
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
|
SUBDIRS = gdtoa
BUILT_SOURCES =
CLEANFILES =
ESC_srcdir=`echo "$(srcdir)" | sed 's/\//\\\\\//g'`
ESC_builddir=`echo "$(top_builddir)" | sed 's/\//\\\\\//g'`
ESC_distdir=`echo "$(distdir)" | sed 's/\//\\\\\//g'`
EXTRA_DIST = docs tests ledger.pdf ledger.info
#(cd $(distdir)/docs; zip -r doxygen-html.zip html; rm -fr html)
dist-hook:
rm -fr `find $(distdir) -name .svn`
lib_LTLIBRARIES = libledger.la
if HAVE_BOOST_PYTHON
lib_LTLIBRARIES += libpyledger.la
endif
AM_YFLAGS = -d
AM_LFLAGS = -o $(LEX_OUTPUT_ROOT).c
#WARNFLAGS = -H -Wall -Wextra -Wfloat-equal -Wno-endif-labels
#WARNFLAGS += -Wcast-qual -Wcast-align -Wwrite-strings -Wconversion
#WARNFLAGS += -Wconversion -Wshorten-64-to-32 -Wsign-compare
#WARNFLAGS += -Wmissing-field-initializers -pedantic-errors
libledger_la_CPPFLAGS = -I$(top_builddir)/gdtoa -I$(srcdir)/gdtoa \
-I$(srcdir)/src
libledger_la_LDFLAGS = -release 3.0
libledger_la_SOURCES = \
src/session.cc \
src/journal.cc \
src/amount.cc \
src/balance.cc \
src/commodity.cc \
src/value.cc \
src/binary.cc \
src/qif.cc \
src/textual.cc \
src/quotes.cc \
src/csv.cc \
src/derive.cc \
src/emacs.cc \
src/format.cc \
src/reconcile.cc \
src/register.cc \
src/report.cc \
src/transform.cc \
src/mask.cc \
src/times.cc \
src/utils.cc \
src/xml.cc \
src/xmlparse.cc \
src/xpath.cc
if HAVE_EXPAT
libledger_la_CPPFLAGS += -DHAVE_EXPAT=1
libledger_la_SOURCES += src/gnucash.cc
endif
if HAVE_XMLPARSE
libledger_la_CPPFLAGS += -DHAVE_XMLPARSE=1
libledger_la_SOURCES += src/gnucash.cc
endif
if HAVE_LIBOFX
libledger_la_CPPFLAGS += -DHAVE_LIBOFX=1
libledger_la_SOURCES += src/ofx.cc
endif
if DEBUG
libledger_la_CPPFLAGS += -DDEBUG_MODE
endif
if HAVE_BOOST_PYTHON
libledger_la_CPPFLAGS += -DUSE_BOOST_PYTHON=1
libledger_la_SOURCES += src/pyinterp.cc
endif
if USE_PCH
libledger_la_CXXFLAGS = $(WARNFLAGS)
nodist_libledger_la_SOURCES = system.hh.gch
BUILT_SOURCES += system.hh.gch
CLEANFILES += system.hh.gch system.hh
$(top_builddir)/system.hh.gch: $(srcdir)/src/system.hh acconf.h
echo "#include \"src/system.hh\"" > $(top_builddir)/system.hh
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(libledger_la_CPPFLAGS) \
-o $@ $(srcdir)/src/system.hh
endif
libpyledger_la_CPPFLAGS = $(libledger_la_CPPFLAGS)
libpyledger_la_LDFLAGS = -release 3.0
libpyledger_la_SOURCES = \
src/py_utils.cc \
src/py_times.cc \
src/py_amount.cc
pkginclude_HEADERS = \
src/amount.h \
src/balance.h \
src/commodity.h \
src/binary.h \
src/context.h \
src/csv.h \
src/derive.h \
src/emacs.h \
src/fdstream.hpp \
src/format.h \
src/gnucash.h \
src/journal.h \
src/ledger.h \
src/mask.h \
src/ofx.h \
src/option.h \
src/parser.h \
src/pyinterp.h \
src/pyfstream.h \
src/pyledger.h \
src/qif.h \
src/quotes.h \
src/reconcile.h \
src/register.h \
src/report.h \
src/session.h \
src/system.hh \
src/textual.h \
src/times.h \
src/transform.h \
src/utils.h \
src/value.h \
src/xml.h \
src/xpath.h
######################################################################
bin_PROGRAMS = ledger
ledger_CPPFLAGS = $(libledger_la_CPPFLAGS)
ledger_CXXFLAGS = $(WARNFLAGS)
ledger_LDADD = $(LIBOBJS) libledger.la gdtoa/libgdtoa.la $(LEXLIB)
ledger_LDFLAGS = -static # for the sake of command-line speed
ledger_SOURCES = \
src/option.cc \
src/main.cc
if HAVE_BOOST_PYTHON
ledger_LDADD += libpyledger.la
endif
info_TEXINFOS = docs/ledger.texi
######################################################################
dist_lisp_LISP = lisp/ledger.el lisp/timeclock.el
######################################################################
if HAVE_BOOST_PYTHON
noinst_PROGRAMS = ledger.so
CLEANFILES += ledger.so
clean-local:
rm -fr build
ledger_so_SOURCES = \
src/pyledger.cc \
src/py_utils.cc \
src/py_times.cc \
src/py_amount.cc
ledger_so_DEPENDENCIES = libledger.la gdtoa/libgdtoa.la libpyledger.la
PYLIBS = pyledger ledger gdtoa gmp boost_date_time \
boost_signals boost_filesystem boost_regex boost_python
if HAVE_EXPAT
PYLIBS += expat
endif
if HAVE_XMLPARSE
PYLIBS += xmlparse xmltok
endif
if HAVE_LIBOFX
PYLIBS += ofx
endif
ledger.so: $(ledger_so_SOURCES) $(ledger_so_DEPENDENCIES)
CFLAGS="$(CPPFLAGS) -I$(srcdir) $(libledger_la_CPPFLAGS)" \
LDFLAGS="$(LDFLAGS) -L. -L.libs -Lgdtoa -Lgdtoa/.libs" \
PYLIBS="$(PYLIBS)" SRCDIR="$(srcdir)" \
python $(srcdir)/setup.py build --build-lib=.
install-exec-hook:
CFLAGS="$(CPPFLAGS) -I$(srcdir) $(libledger_la_CPPFLAGS)" \
LDFLAGS="$(LDFLAGS) -L. -L.libs -Lgdtoa -Lgdtoa/.libs" \
PYLIBS="$(PYLIBS)" SRCDIR="$(srcdir)" \
python $(srcdir)/setup.py install --prefix=$(prefix)
endif
######################################################################
TESTS = UnitTests
if HAVE_BOOST_PYTHON
TESTS += PyUnitTests
endif
check_PROGRAMS = $(TESTS)
nodist_UnitTests_SOURCES = tests/UnitTests.cc \
\
tests/numerics/BasicAmount.cc \
tests/numerics/CommodityAmount.cc \
tests/numerics/DateTime.cc \
tests/numerics/Commodity.cc
UnitTests_CPPFLAGS = -I$(srcdir)/tests $(libledger_la_CPPFLAGS)
UnitTests_LDFLAGS = $(LIBADD_DL)
UnitTests_LDADD = $(lib_LTLIBRARIES) gdtoa/libgdtoa.la -lcppunit
PyUnitTests_SOURCES = tests/python/PyUnitTests.py
PyUnitTests: $(srcdir)/tests/python/PyUnitTests.py
cat $(srcdir)/tests/python/PyUnitTests.py \
| sed "s/%srcdir%/$(ESC_srcdir)/g" \
| sed "s/%builddir%/$(ESC_builddir)/g" > $@
chmod 755 $@
######################################################################
DISTCLEANFILES = Doxyfile.gen
alldocs: docs/ledger.info docs/ledger.pdf doxygen-docs
$(top_builddir)/Doxyfile.gen: $(srcdir)/docs/Doxyfile
cat $(srcdir)/docs/Doxyfile \
| sed "s/%srcdir%/$(ESC_srcdir)/g" \
| sed "s/%builddir%/$(ESC_builddir)/g" > $@
doxygen-docs: $(top_builddir)/Doxyfile.gen
doxygen $(top_builddir)/Doxyfile.gen
######################################################################
check-syntax:
g++ -I. -Itests $(CPPFLAGS) $(UnitTests_CXXFLAGS) \
-o /dev/null -S $(CHK_SOURCES)
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 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 elc-temp \
py-compile ylwrap compile
|