# Generated automatically from Makefile.in by configure.
# This file is (c) 1998 Ted Faber (faber@lunabase.org) see COPYRIGHT
# for the full copyright and limitations of liabilities.

prefix = /dev/env/DJDIR
exec_prefix = ${prefix}

BINDIR = ${exec_prefix}/bin
DEFINESDIR = ${prefix}/share/grap
MANDIR = ${prefix}/man/man1

INSTALL=install -c
INSTALL_PROGRAM=${INSTALL}
INSTALL_DATA=${INSTALL} -m 644
RM=rm
RMDIR=rmdir
MKDIR=mkdir
LEX=flex
YACC=bison -y
CXX=gcc
LIBOBJS=
PERL=perl

DISTDIR=grap-1.10
SOURCES=grap.cc grap_lex.cc *.cc

CXXFLAGS += -Wall -DHAVE_CONFIG_H -DDEFINES=\"$(DEFINESDIR)/grap.def\" 
LDFLAGS += -lglib -lgpp -lstdcxx -lm

# solaris make uses these as defaults:

CCC=$(CXX)
CCFLAGS=$(CXXFLAGS)

OBJS=grap.o grap_lex.o grap_draw.o grap_pic.o grap_parse.o version.o $(LIBOBJS)

all:	grap


.l.cc:
	$(LEX) -o$@ $<

grap:	$(OBJS)
	$(CXX) $(CXXFLAGS)$(OBJS) $(LDFLAGS) $(LDLIBS) -o grap
#	if test -f grap.exe ; then mv -f grap.exe grap; fi

y.tab.h grap.cc:	grap.y
	$(YACC) -d grap.y
	mv y.tab.c grap.cc;

graplex.cc:	grap_lex.l y.tab.h


version.cc:	Makefile
	echo "char *version=\"$(DISTDIR)\";" > version.cc

y.output:	grap.y
	$(YACC) -v grap.y

grap.man:	grap.1
	groff -mdoc -Tascii grap.1 > grap.man

grap.1:	grap.doc
	perl -pe "s#DEFINES_FILE#$(DEFINESDIR)/grap.def#g; s#EXAMPLES#$(DEFINESDIR)/examples#g;" < grap.doc > grap.1 ;\

dist:	
	cd examples && ${MAKE} clean
	${MAKE} veryclean
	${MAKE} grap.man
	cd .. && tar cf - grap | (cd /tmp && tar xf -)
	cd /tmp && mv grap ${DISTDIR}
	rm /tmp/${DISTDIR}/configure.in /tmp/${DISTDIR}/Makefile /tmp/${DISTDIR}/examples/Makefile
	rm /tmp/${DISTDIR}/examples/Makefile.local /tmp/${DISTDIR}/examples/color_example.ms
	rm /tmp/${DISTDIR}/examples/.html* /tmp/${DISTDIR}/examples/.cvsignore
	rm -rf /tmp/${DISTDIR}/CVS /tmp/${DISTDIR}/examples/CVS
	rm -rf /tmp/${DISTDIR}/examples/*.ps.gz /tmp/${DISTDIR}/examples/*.pdf 
	cd /tmp && tar czf ${DISTDIR}.tar.gz ${DISTDIR}
	mv /tmp/${DISTDIR}.tar.gz . && rm -rf /tmp/${DISTDIR}

clean:
	rm -f grap $(OBJS) grap_lex.cc grap.cc  *.o y.tab.h grap.1 grap.man ${DISTDIR}.tar.gz *core* y.output

veryclean:
	${MAKE} clean
	rm -f config.log config.status config.cache config.h version.cc *.tgz

install:	grap.exe grap.def grap.1
	strip grap.exe
	$(INSTALL) -d $(BINDIR)
	$(INSTALL) -d $(MANDIR)
	$(INSTALL) -d $(DEFINESDIR)/examples
	$(INSTALL_PROGRAM) grap.exe $(BINDIR)
	$(INSTALL_DATA) grap.1 $(MANDIR)
	$(INSTALL_DATA) grap*.defines $(DEFINESDIR)
	$(INSTALL_DATA) README $(DEFINESDIR)
	$(INSTALL_DATA) CHANGES $(DEFINESDIR)
	$(INSTALL_DATA) COPYRIGHT $(DEFINESDIR)
	$(INSTALL_DATA) grap.man $(DEFINESDIR)
	$(INSTALL_DATA) examples/*.d examples/example.ms examples/*.result examples/Makefile $(DEFINESDIR)/examples

deinstall:
	$(RM) $(BINDIR)/grap
	$(RM) $(MANDIR)/grap.1
	$(RM) $(DEFINESDIR)/grap.defines $(DEFINESDIR)/README $(DEFINESDIR)/CHANGES $(DEFINESDIR)/COPYRIGHT $(DEFINESDIR)/grap.man
	$(RM) $(DEFINESDIR)/examples/*.d $(DEFINESDIR)/examples/*.ms $(DEFINESDIR)/examples/Makefile $(DEFINESDIR)/examples/*result
	$(RMDIR) $(DEFINESDIR)/examples
	$(RMDIR) $(DEFINESDIR)

cleandepend:
	${PERL} -i -ne 'print if 1 .. /^\# End of Makefile/;' Makefile

depend:	${SOURCES}
	${MAKE} cleandepend
	${CXX} -MM ${CXXFLAGS} ${SOURCES} >> Makefile


# End of Makefile
