9 CFLAGS=-g -W -Wall -pedantic $(DMALLOC_CFLAGS)
10 YFLAGS=--debug --defines
12 LOADLIBES=$(DMALLOC_LOADLIBES)
14 all: ansel_module gedcom_parse
16 gedcom_parse: standalone.o lex.gedcom_1byte_.o lex.gedcom_hilo_.o \
17 lex.gedcom_lohi_.o gedcom.tab.o message.o multilex.o \
19 $(CC) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
24 lex.gedcom_1byte_.c: gedcom_1byte.lex gedcom.tab.h gedcom.h multilex.h \
25 gedcom_lex_common.c encoding.h
26 $(LEX) $(LFLAGS) -Pgedcom_1byte_ gedcom_1byte.lex
28 lex.gedcom_hilo_.c: gedcom_hilo.lex gedcom.tab.h gedcom.h multilex.h \
29 gedcom_lex_common.c encoding.h
30 $(LEX) $(LFLAGS) -Pgedcom_hilo_ gedcom_hilo.lex
32 lex.gedcom_lohi_.c: gedcom_lohi.lex gedcom.tab.h gedcom.h multilex.h \
33 gedcom_lex_common.c encoding.h
34 $(LEX) $(LFLAGS) -Pgedcom_lohi_ gedcom_lohi.lex
36 gedcom.tab.c gedcom.tab.h: gedcom.y gedcom.h
37 $(YACC) $(YFLAGS) --name-prefix=gedcom_ gedcom.y
41 rm -f core gedcom_parse lexer_* *.o lex.gedcom_* \
42 gedcom.tab.* gedcom.output
43 cd ansel && $(MAKE) clean
47 lexer_1byte: lex.gedcom_1byte_.test.o message.o encoding.o
48 $(CC) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
50 lex.gedcom_1byte_.test.o: lex.gedcom_1byte_.c
51 $(CC) -DLEXER_TEST -c $(CPPFLAGS) $(CFLAGS) $^ -o $@
53 test_1byte: lexer_1byte
54 cat t/allged.ged | ./lexer_1byte
56 lexer_hilo: lex.gedcom_hilo_.test.o message.o encoding.o
57 $(CC) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
59 lex.gedcom_hilo_.test.o: lex.gedcom_hilo_.c
60 $(CC) -DLEXER_TEST -c $(CPPFLAGS) $(CFLAGS) $^ -o $@
63 cat t/uhlcl.ged | ./lexer_hilo
65 lexer_lohi: lex.gedcom_lohi_.test.o message.o encoding.o
66 $(CC) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
68 lex.gedcom_lohi_.test.o: lex.gedcom_lohi_.c
69 $(CC) -DLEXER_TEST -c $(CPPFLAGS) $(CFLAGS) $^ -o $@
72 cat t/ulhcl.ged | ./lexer_lohi
77 @export GCONV_PATH=./ansel; \
78 for file in t/*.ged; do \
79 echo "=== testing $$file"; \
80 ./gedcom_parse -2 $$file; \
83 testmem: DMALLOC_CFLAGS=-DMALLOC
84 testmem: DMALLOC_LOADLIBES=-ldmalloc