X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=Makefile;h=87673b74dd56cab60bfe4e9a30ebd7c5e3ff5d3f;hb=089594310eef568bb8a7f3941b9149173c0b5fcd;hp=737ba42c068430686d1eb522196773136b0d8875;hpb=be41e74e82065afc92849a2ce5a1c51f69ded908;p=gedcom-parse.git diff --git a/Makefile b/Makefile index 737ba42..87673b7 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,43 @@ # $Id$ # $Name$ -gedcom_parse: standalone.o lex.gedcom_.o gedcom.tab.o - cc standalone.o lex.gedcom_.o gedcom.tab.o -o gedcom_parse +DMALLOC_CFLAGS= +DMALLOC_LOADLIBES= +CFLAGS=-g -W -Wall -pedantic $(DMALLOC_CFLAGS) +CPPFLAGS=-I ./include +YFLAGS=--debug --defines +LFLAGS=-8 +LOADLIBES=$(DMALLOC_LOADLIBES) +LDFLAGS_GEDCOM=-Lgedcom/.libs -lex.gedcom_.c: gedcom.lex gedcom.tab.h gedcom.h - flex -8 -Pgedcom_ gedcom.lex +all: ansel_module libgedcom gedcom_parse -gedcom.tab.c gedcom.tab.h: gedcom.y gedcom.h - bison --debug --defines --name-prefix=gedcom_ gedcom.y +gedcom_parse: standalone.o + $(CC) $(LDFLAGS) $(LDFLAGS_GEDCOM) -lgedcom $^ $(LOADLIBES) $(LDLIBS) -o $@ +libgedcom: + cd gedcom && $(MAKE) DMALLOC_CFLAGS=$(DMALLOC_CFLAGS) \ + DMALLOC_LOADLIBES=$(DMALLOC_LOADLIBES) + +ansel_module: + cd ansel && $(MAKE) + +.PHONY: clean clean: - rm -f core gedcom_parse *.o lex.gedcom_.c gedcom.tab.* gedcom.output + rm -f core gedcom_parse *.o logfile + cd gedcom && $(MAKE) clean + cd ansel && $(MAKE) clean + +# Test of parser + +test: all + @export GCONV_PATH=./ansel; \ + export LD_LIBRARY_PATH=gedcom/.libs; \ + for file in t/*.ged; do \ + echo "=== testing $$file"; \ + ./gedcom_parse -2 $$file; \ + done + +testmem: DMALLOC_CFLAGS=-DMALLOC +testmem: DMALLOC_LOADLIBES=-ldmalloc +testmem: clean test