summaryrefslogtreecommitdiff
path: root/Makefile.old
blob: d0c6bd87dbae4d9c9a87dc817ca12a4ccfa4ce05 (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
CODE   = account.cc  \
	 amount.cc   \
	 autoxact.cc \
	 balance.cc  \
	 binary.cc   \
	 config.cc   \
	 datetime.cc \
	 debug.cc    \
	 format.cc   \
	 ledger.cc   \
	 option.cc   \
	 parser.cc   \
	 qif.cc      \
	 quotes.cc   \
	 textual.cc  \
	 valexpr.cc  \
	 value.cc    \
	 walk.cc

OBJS   = $(patsubst %.cc,%.o,$(CODE))

#CXX    = cc
CXX    = g++

CFLAGS = -Wall -ansi -pedantic
#DFLAGS = -O3 -fomit-frame-pointer -DDEBUG_LEVEL=0
DFLAGS = -g -DDEBUG_LEVEL=4 -DDO_CLEANUP
#DFLAGS = -g -DDEBUG_LEVEL=2 -pg

INCS   = -I/sw/include \
	 -I/usr/include/gcc/darwin/3.3/c++ \
	 -I/usr/include/gcc/darwin/3.3/c++/ppc-darwin
LIBS   = -L/sw/lib -lgmp -lpcre

ifdef GNUCASH
CODE   := $(CODE)   gnucash.cc
OBJS   := $(OBJS)   gnucash.o
CFLAGS := $(CFLAGS) -DREAD_GNUCASH=1
INCS   := $(INCS)   -I/usr/include/httpd/xml
LIBS   := $(LIBS)   -L/sw/lib -lxmlparse
endif

all: make.deps ledger

docs: ledger.info ledger.pdf

libledger.a: $(OBJS)
	ar rv $@ $?
	ranlib $@

ledger: libledger.a main.o
	$(CXX) $(CFLAGS) $(INCS) $(DFLAGS) -o $@ main.o -L. -lledger $(LIBS)

valexpr: libledger.a valexpr.cc
	$(CXX) $(CFLAGS) $(INCS) $(DFLAGS) -DTEST -o $@ valexpr.cc \
		-L. -lledger $(LIBS)

ledger.info: ledger.texi
	makeinfo $<

ledger.pdf: ledger.texi
	texi2pdf $<

%.o: %.cc
	$(CXX) $(CFLAGS) $(INCS) $(DFLAGS) -c -o $@ $<

clean:
	rm -f ledger valexpr libledger.a *.o *.elc *~ .\#*
	rm -f *.aux *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr
	rm -f .gdb_history gmon.out out

distclean fullclean: clean
	rm -f *.info *.html *.pdf *.elc make.deps TAGS

rebuild: clean deps all

deps: make.deps

make.deps: Makefile.old
	cc -M $(INCS) $(CODE) main.cc > $@

include make.deps