# makefile for program ltx2x --- LaTeX to X autotagger
# November 1999
#
##################### Change the following for your setup
# The compiler
CC = gcc
# We use flex (or equivalent, but not lex) to generate the lexer
LEX = flex
# and the options
LEXFLAGS = -v
# We use bison (or equivalent) to generate the parser
YACC = bison
# and the options
YACCFLAGS = -y -d -v
# Libraries to be used
LIBS = -ly -ll -lm
# The root directory for the installation (e.g., /usr/local )
ROOTDIR = /opt/GNU/gnu
# Where to place the running code (e.g. /usr/local/bin )
BINDIR = ${ROOTDIR}/bin
# Where to place the manpage (e.g., /usr/local/man/man1 )
MANEXT = 1
MANDIR = ${ROOTDIR}/man/man${MANEXT}
# Just in case you want to change the name of the binary
# (and then you should also change the man page and documentation).
# So, do not change this.
PROG = ltx2x
# Where to place the user documentation (e.g., /usr/local/doc/ltx2x )
DOCDIR = ${ROOTDIR}/doc/${PROG}
# Where to place the example command tables (e.g., /usr/local/lib/config/ltx2x )
CTDIR = ${ROOTDIR}/lib/config/${PROG}
# The code checking program
LINT = lint
# Code checking program options
LINTOPTS = -achqux
# Assume getopt is present on the system
GETOPTC =
GETOPTO =
GETOPTH =
# If you do not have getopt already on your system, uncomment the next three linws
# GETOPTC = getopt.c
# GETOPTO = getopt.o
# GETOPTO = getopt.h
# The file copy command (copy but do not delete original)
COPY = cp
# The file move command (move and delete original)
MOVE = mv
# The file delete command
DELETE = rm
# The make directory (hierarchy) command
MAKEDIR = mkdirhier
# The stream editor command
SED = sed
# Command to write to the terminal (stdout)
ECHO = echo
################### You should not have to change anything after this
################### but read on just in case
# only call make install if BINDIR has been set
install : ltx2x
${MAKEDIR} ${BINDIR}
${COPY} ${PROG} ${BINDIR}
# Edit the file man to replace DOCUMENTDIR by the actual directory
# where the user manual is to be placed, and CTDIR by the location
# of the example command table files.
# Then copy the manpage to the proper place
manpage :
${SED} 's!DOCUMENTDIR!${DOCDIR}!; s!CTDIR!${CTDIR}!' man > tman
${MAKEDIR} ${MANDIR}
${COPY} tman ${MANDIR}/${PROG}.${MANEXT}
# Copy the user manuals to the proper place
doc :
${MAKEDIR} ${DOCDIR}
${COPY} ltx2x.tex ${DOCDIR}/${PROG}.tex
${COPY} ltx2x.ps ${DOCDIR}/${PROG}.ps
${COPY} ltx2x.txt ${DOCDIR}/${PROG}.txt
${COPY} ltx2x.html ${DOCDIR}/${PROG}.html
# Copy the example command tables to their final location
ctables :
${MAKEDIR} ${CTDIR}
${COPY} ltx2x.ct ${CTDIR}/ltx2x.ct
${COPY} detex.ct ${CTDIR}/detex.ct
${COPY} remcom.ct ${CTDIR}/remcom.ct
${COPY} l2h.ct ${CTDIR}/l2h.ct
${COPY} bye.ct ${CTDIR}/bye.ct
# Do almost everything except clean up
all : ltx2x install manpage doc ctables
# call make clean to remove the compiled program, the object files,
# info from YACC, and the edited version of the manpage
clean :
- ${DELETE} ${PROG}
- ${DELETE} *.o
- ${DELETE} y.output
- ${DELETE} tman
#### For the printct program (best to do this after the ltx2x program)
# call make installprintct to move the printct binary to its final location
installprintct :
${COPY} printct ${BINDIR}
# call make cleanprintct to remove the compiled program and its object file
cleanprintct :
- ${DELETE} printct
- ${DELETE} printct.o
- ${DELETE} srchenv.o
- ${DELETE} getopt.o