X-Git-Url: https://git.dlugolecki.net.pl/?a=blobdiff_plain;f=Makefile;h=87673b74dd56cab60bfe4e9a30ebd7c5e3ff5d3f;hb=089594310eef568bb8a7f3941b9149173c0b5fcd;hp=a0ca68a43b05f52a477724d01a50b41ddb55e4a0;hpb=5d770d0f89235b28f9c75ea43df29ce48a94ffa5;p=gedcom-parse.git diff --git a/Makefile b/Makefile index a0ca68a..87673b7 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,43 @@ # $Id$ # $Name$ -CFLAGS=-Wall -pedantic +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 -gedcom_parse: standalone.o lex.gedcom_.o gedcom.tab.o - cc standalone.o lex.gedcom_.o gedcom.tab.o -o gedcom_parse +all: ansel_module libgedcom gedcom_parse -lex.gedcom_.c: gedcom.lex gedcom.tab.h gedcom.h - flex -8 -Pgedcom_ gedcom.lex +gedcom_parse: standalone.o + $(CC) $(LDFLAGS) $(LDFLAGS_GEDCOM) -lgedcom $^ $(LOADLIBES) $(LDLIBS) -o $@ -gedcom.tab.c gedcom.tab.h: gedcom.y gedcom.h - bison --debug --defines --name-prefix=gedcom_ gedcom.y +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