1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
# This file is (c) 1998-2001 Ted Faber (faber@lunabase.org) see COPYRIGHT
# for the full copyright and limitations of liabilities.
prefix = @prefix@
exec_prefix = @exec_prefix@
BINDIR = @bindir@
DEFINESDIR = @datadir@/misc
EXAMPLEDIR = @datadir@/doc/examples/grap
DOCDIR = @datadir@/doc/grap
MANDIR = @mandir@/man1
PROGS=grap
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
INSTALL_DATA=@INSTALL_DATA@
RM=rm -f
RMDIR=rm -rf
MKDIR=mkdir
LEX=@LEX@
YACC=@YACC@
CXX=@CXX@
LD=${CXX}
LIBOBJS=@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=@MKDEPFLAGS@;
SOURCES=grap.cc grap_lex.cc *.cc
VERSION=1.22
DISTDIR=grap-${VERSION}
CXXFLAGS +=@GXXFLAGS@ @DEFS@
# To suppress optimization of certain files under g++ where
# optimization is costly at compilation time and of minimial use at
# runtime.
SUPPRESS_OPT=@SUPPRESS_OPT@
NO_UNDEF=@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$@ $<
y.tab.h grap.cc: grap.y
${YACC} -d grap.y
mv y.tab.c 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
# Only grap_parse.cc needs to have the version defined.
grap_parse.o: grap_parse.cc
${CXX} ${CXXFLAGS} -DVERSION="\"${VERSION}\"" -DOS_VERSION=\""@OS_VERSION@"\" -c grap_parse.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: @INSTALL_DEPS@
#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 ${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
|