Dependency on gedcom.h
[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)
20
21 ansel_module:
22         cd ansel && $(MAKE)
23
24 .PHONY: clean
25 clean:
26         rm -f core gedcom_parse *.o
27         cd gedcom && $(MAKE) clean
28         cd ansel && $(MAKE) clean
29
30 # Test of parser
31
32 test:   all
33         @export GCONV_PATH=./ansel; \
34         export LD_LIBRARY_PATH=gedcom/.libs; \
35         for file in t/*.ged; do \
36           echo "=== testing $$file"; \
37           ./gedcom_parse -2 $$file; \
38         done
39
40 testmem:        DMALLOC_CFLAGS=-DMALLOC
41 testmem:        DMALLOC_LOADLIBES=-ldmalloc
42 testmem:        clean test