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 133 134 135 136 137 138 139 140 141 142 143 144
|
# 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 = @prefix@
exec_prefix = @exec_prefix@
datarootdir=@datarootdir@
datadir=@datadir@
BINDIR = @bindir@
DEFINESDIR = @DEFINES_DIR@
EXAMPLEDIR = @EXAMPLE_DIR@
DOCDIR = @DOC_DIR@
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
DISTDIR=@PACKAGE_TARNAME@-@PACKAGE_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$@ $<
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
sed -i -e "s#/usr/local/share/grap/grap.defines#${DEFINESDIR}/grap.defines#g;" grap.1
sed -i -e "s#/usr/local/share/examples/grap#${EXAMPLEDIR}#g;" 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 ${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
|