Correction for dmalloc testability.
[gedcom-parse.git] / Makefile
1 # $Id$
2 # $Name$
3
4 DMALLOC_CFLAGS=
5 DMALLOC_LOADLIBES=
6 CFLAGS=-g -W -Wall -pedantic $(DMALLOC_CFLAGS)
7 CPPFLAGS=-I ./include
8 YFLAGS=--debug --defines
9 LFLAGS=-8
10 LOADLIBES=$(DMALLOC_LOADLIBES)
11 LDFLAGS_GEDCOM=-Lgedcom/.libs
12
13 all:    ansel_module libgedcom gedcom_parse
14
15 gedcom_parse:   standalone.o
16         $(CC) $(LDFLAGS) $(LDFLAGS_GEDCOM) -lgedcom $^ $(LOADLIBES) $(LDLIBS) -o $@
17
18 libgedcom:
19         cd gedcom && $(MAKE) DMALLOC_CFLAGS=$(DMALLOC_CFLAGS) \
20         DMALLOC_LOADLIBES=$(DMALLOC_LOADLIBES)
21
22 ansel_module:
23         cd ansel && $(MAKE)
24
25 .PHONY: clean
26 clean:
27         rm -f core gedcom_parse *.o logfile
28         cd gedcom && $(MAKE) clean
29         cd ansel && $(MAKE) clean
30
31 # Test of parser
32
33 test:   all
34         @export GCONV_PATH=./ansel; \
35         export LD_LIBRARY_PATH=gedcom/.libs; \
36         for file in t/*.ged; do \
37           echo "=== testing $$file"; \
38           ./gedcom_parse -2 $$file; \
39         done
40
41 testmem:        DMALLOC_CFLAGS=-DMALLOC
42 testmem:        DMALLOC_LOADLIBES=-ldmalloc
43 testmem:        clean test