# RCS stuff: $Id: Makefile,v 1.3 1992/01/05 06:09:12 murf Exp $


# Makefile for gcom
# Copyright (C) 1992 Steven Michael Murphy
#
#
# This file is part of gcom, the GEDCOM file merging utility for UNIX,
# 
# 
# gcom is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# 
# gcom is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with gcom; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

CFLAGS = -g -DYYDEBUG
gcom: gedmain.o gedfuncs.o gedcom.b.tab.o gedmerge.o \
	gedwrite.o st.o errtrap.o uprintf.o mylex2.o
	cc -o gcom -g gedmain.o gedfuncs.o gedcom.b.tab.o mylex2.o gedmerge.o \
		gedwrite.o st.o errtrap.o uprintf.o
gedmain.o : gedmain.c
gedfuncs.o : gedfuncs.c
gedcom.b.tab.o : gedcom.b.tab.c
gedcom.b.tab.c gedcom.b.tab.h : gedcom.b
	bison -vd gedcom.b
gedwrite.o : gedwrite.c
mylex2.c : keys.gperf
	gperf -G -k 1,3,4 -p -S 1 -t keys.gperf > mylex2.c
mylex2.o : gedcom.b.tab.h mylex2.c
gedmerge.o : gedmerge.c
st.o : st.c
errtrap.o : errtrap.c
uprintf.o : uprintf.c

clean:
	rm *.o gcom *~ *.output *.tab.c *.tab.h lex.yy.c

tar:
	tar cvf Makefile gedcom-merge.tar gedmain.c gedfuncs.c gedcom.b gedcom.h gedwrite.c gedcom.lex mylex.c mylex2.dist gedcom.lex.big mylex2.c \
		patchlevel.h COPYING keys.gperf gedmerge.c st.c st.h errtrap.c errtrap.h uprintf.c uprintf.h gedcom.b.tab.[ch] alloca.c Gedcom-merge.doc
	compress gedcom-merge.tar
	uuencode gedcom-merge.tar.Z gedcom-merge.tar.Z > gedcom-merge.tar.Z.uue

shar:
	shar -c -f -l50 -ogcom -n gcom -a Gedcom-merge.doc Makefile gedmain.c gedfuncs.c gedcom.b gedcom.h gedwrite.c gedcom.lex mylex.c mylex2.dist gedcom.lex.big mylex2.c \
		patchlevel.h COPYING keys.gperf gedmerge.c st.c st.h errtrap.c errtrap.h uprintf.c uprintf.h gedcom.b.tab.[ch] alloca.c
