# This file is (c) 1998-2001 Ted Faber (address@hidden) see COPYRIGHT # for the full copyright and limitations of liabilities. prefix = /usr/local exec_prefix = ${prefix} BINDIR = ${exec_prefix}/bin DEFINESDIR = ${prefix}/share/grap EXAMPLEDIR = ${prefix}/share/examples/grap DOCDIR = ${prefix}/share/doc/grap MANDIR = ${prefix}/man/man1 PROGS=grap INSTALL=/usr/bin/install -c INSTALL_PROGRAM=${INSTALL} INSTALL_DATA=${INSTALL} -m 644 RM=rm -f RMDIR=rm -rf MKDIR=mkdir LEX=flex YACC=bison -y CXX=g++ 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= g++ MKDEPFLAGS=-MM ${CXXFLAGS} ${SOURCES} >> .depend; SOURCES=grap.cc grap_lex.cc *.cc DISTDIR=grap-1.27 CXXFLAGS +=-Wall -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=-O0 NO_UNDEF=-Wno-unused 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 grap.1: grap.doc sed "s#DEFINES_FILE#${DEFINESDIR}/grap.defines#g; s#EXAMPLES#${DOCDIR}/examples#g;" < 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 ${BINDIR} || true ${INSTALL} -d ${MANDIR} || true ${INSTALL} -d ${DEFINESDIR} || true ${INSTALL} -d ${EXAMPLEDIR} || true ${INSTALL_PROGRAM} grap ${BINDIR} ${INSTALL_DATA} grap.1 ${MANDIR} ${INSTALL_DATA} grap*.defines ${DEFINESDIR} ${INSTALL_DATA} examples/*.d examples/example.ms examples/*.result examples/Makefile ${EXAMPLEDIR} #BSD ports may not want these installed install-docs: ${INSTALL} -d ${DOCDIR} || true ${INSTALL_DATA} README CHANGES COPYRIGHT grap.man ${DOCDIR} deinstall: ${RM} ${BINDIR}/grap ${RM} ${MANDIR}/grap.1 ${RM} ${DEFINESDIR}/grap*.defines ${DOCDIR}/README ${DOCDIR}/CHANGES ${DOCDIR}/COPYRIGHT ${DOCDIR}/grap.man ${RM} ${EXAMPLEDIR}/*.d ${EXAMPLEDIR}/*.ms ${EXAMPLEDIR}/*result ${RMDIR} ${DOCDIR}/examples ${RMDIR} ${DOCDIR} ${RMDIR} ${DEFINESDIR} ${RMDIR} ${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