DESTDIR=/usr/local MANEXT=1 BINDIR=$(DESTDIR)/bin LIBDIR=$(DESTDIR)/lib/a2ac MANDIR=$(DESTDIR)/man/man$(MANEXT) TEXFONTDIR=$(DESTDIR)/share/texmf/fonts CC=cc INSTALL=install MKDIR=mkdir -p INSTPROGFLAGS=-s -m755 INSTEXECFLAGS=-m755 INSTDATAFLAGS=-m644 CFLAGS=-O LFLAGS=-lm all: a2ac mkfnt a2ac.$(MANEXT) a2ac: a2ac.c $(CC) $(CFLAGS) $? -o $@ $(LFLAGS) mkfnt: mkfnt.sh sed -e "s|@BINDIR@|$(BINDIR)|;\ s|@LIBDIR@|$(LIBDIR)|;\ s|@MANDIR@|$(MANDIR)|;\ s|@MANEXT@|$(MANEXT)|;\ s|@TEXFONTDIR@|$(TEXFONTDIR)|" mkfnt.sh > mkfnt; chmod a+x mkfnt install: all install.man @if [ -d $(BINDIR) ]; then \ set +x; else (set -x; $(MKDIR) $(BINDIR)); fi $(INSTALL) $(INSTPROGFLAGS) a2ac $(BINDIR)/a2ac @if [ -d $(LIBDIR) ]; then \ set +x; else (set -x; $(MKDIR) $(LIBDIR)); fi for m in a2ac-cz.txt a2ac-eng.txt cscorr.tab* test8z.tex *.enc; do \ $(INSTALL) $(INSTDATAFLAGS) $$m $(LIBDIR)/$$m; \ done for m in mkfnt mkallfnt; do \ $(INSTALL) $(INSTEXECLAGS) $$m $(LIBDIR)/$$m; \ done a2ac.$(MANEXT): a2ac.man sed -e "s|@BINDIR@|$(BINDIR)|;\ s|@LIBDIR@|$(LIBDIR)|;\ s|@MANDIR@|$(MANDIR)|;\ s|@MANEXT@|$(MANEXT)|" a2ac.man > a2ac.$(MANEXT) install.man: a2ac.$(MANEXT) @if [ -d $(MANDIR) ]; then \ set +x; else (set -x; $(MKDIR) $(MANDIR)); fi $(INSTALL) $(INSTDATAFLAGS) a2ac.$(MANEXT) $(MANDIR)/a2ac.$(MANEXT) clean: rm -f *.o *~ *.bak core a.out a2ac a2ac.$(MANEXT) mkfnt