# This file is (c) 1998-2001 Ted Faber (faber@lunabase.org) see COPYRIGHT # for the full copyright and limitations of liabilities. # Allow staged install. Set this to install in a temporary location to make # sure this all works, or make a tar file. DESTDIR needs to end with a / if # prefix is not absolute. DESTDIR= prefix = exec_prefix = ${prefix} datarootdir=${prefix}/share datadir=${datarootdir} BINDIR = ${exec_prefix}/bin DEFINESDIR = ${datarootdir}/grap EXAMPLEDIR = ${datarootdir}/examples/grap DOCDIR = ${datarootdir}/doc/grap MANDIR = ${datarootdir}/man/man1 PROGS=grap INSTALL=/usr/bin/install -c -o root -g wheel INSTALL_PROGRAM=install -s -o root -g wheel -m 555 INSTALL_DATA=install -o root -g wheel -m 444 RM=rm -f RMDIR=rm -rf MKDIR=mkdir LEX=flex YACC=bison -y CXX=c++ LD=${CXX} LIBOBJS= PREMKDEP= grep "^\#" grap.y > grap.cc ; grep "^\#" grap_lex.l > grap_lex.cc; touch y.tab.h POSTMKDEP=${RM} grap.cc grap_lex.cc y.tab.h MKDEP= mkdep MKDEPFLAGS=-f .depend -MM ${CFLAGS} ${SOURCES}; SOURCES=grap.cc grap_lex.cc *.cc DISTDIR=grap-1.41 CXXFLAGS += -DHAVE_CONFIG_H # To suppress optimization of certain files under g++ where # optimization is costly at compilation time and of minimial use at # runtime. SUPPRESS_OPT= NO_UNDEF= OBJS=grap.o grap_lex.o grap_draw.o grap_pic.o grap_parse.o grap_tokenizer.o \ ${LIBOBJS} CLEANFILES=y.output VERYCLEANFILES=grap.cc grap_lex.cc y.tab.h SPOTLESSFILES=grap.1 grap.ps grap.man include Makefile.common grap: ${OBJS} ${CXX} ${CXXFLAGS} ${LDFLAGS} ${OBJS} ${LDLIBS} -o grap .l.cc: ${LEX} -o$@ $< grap.cc: grap.y ${YACC} -d grap.y mv y.tab.c grap.cc y.tab.h: grap.cc grap_lex.cc: grap_lex.l y.tab.h # Under g++ the memory overhead for optimization of grap_tokenizer is # high. Compilation time becomes prohibitive and the function is only # called once per execution, so this rule disables optimization for # that file under g++ by default. If --optimize-grap_tokenizer is # given to configure, no attempt to suppress optimization is made. grap_tokenizer.o: grap_tokenizer.cc ${CXX} ${CXXFLAGS} ${SUPPRESS_OPT} -c grap_tokenizer.cc # flex defines an unused static function. This rule supresses that # warning under g++. grap_lex.o: grap_lex.cc ${CXX} ${CXXFLAGS} ${NO_UNDEF} -c grap_lex.cc y.output: grap.y ${YACC} -v grap.y grap.man: grap.1 groff -mdoc -Tascii grap.1 > grap.man grap.ps: grap.1 groff -mdoc grap.1 > grap.ps # This used to be more complex. The stub's here so that the grap.doc # records in my CVS stay where they are. grap.1: grap.doc cp grap.doc grap.1 # The || true lines allow make to continue on systems where install -d # fails on existing directories. install: all grap.defines grap.1 install-docs strip grap || true ${INSTALL} -d ${DESTDIR}${BINDIR} || true ${INSTALL} -d ${DESTDIR}${MANDIR} || true ${INSTALL} -d ${DESTDIR}${DEFINESDIR} || true ${INSTALL} -d ${DESTDIR}${EXAMPLEDIR} || true ${INSTALL_PROGRAM} grap ${DESTDIR}${BINDIR} ${INSTALL_DATA} grap.1 ${DESTDIR}${MANDIR} ${INSTALL_DATA} grap*.defines ${DESTDIR}${DEFINESDIR} ${INSTALL_DATA} examples/*.d examples/example.ms \ examples/*.result examples/Makefile ${DESTDIR}${EXAMPLEDIR} #BSD ports may not want these installed install-docs: ${INSTALL} -d ${DESTDIR}${DOCDIR} || true ${INSTALL_DATA} README CHANGES COPYRIGHT grap.man ${DESTDIR}${DOCDIR} deinstall: ${RM} ${DESTDIR}${BINDIR}/grap ${RM} ${DESTDIR}${MANDIR}/grap.1 ${RM} ${DESTDIR}${DEFINESDIR}/grap*.defines ${DESTDIR}${DOCDIR}/README \ ${DESTDIR}${DOCDIR}/CHANGES ${DESTDIR}${DOCDIR}/COPYRIGHT \ ${DESTDIR}${DOCDIR}/grap.man ${RM} ${DESTDIR}${EXAMPLEDIR}/*.d ${DESTDIR}${EXAMPLEDIR}/*.ms \ ${DESTDIR}${EXAMPLEDIR}/*result ${RMDIR} ${DESTDIR}${DOCDIR}/examples ${RMDIR} ${DESTDIR}${DOCDIR} ${RMDIR} ${DESTDIR}${DEFINESDIR} ${RMDIR} ${DESTDIR}${EXAMPLEDIR} check: grap grap.defines examples/example.ms cd examples && \ if ../grap -d ../grap.defines example.ms > /dev/null; then \ echo "pass";\ exit 0; \ else \ echo "fail"; \ exit 1; \ fi dist: grap.man grap.ps include .depend