# GNU Makefile for tr2latex on *NIX machines # CC chooses your C compiler CC = gcc # PREFIX sets your base directory PREFIX = /usr/local #PREFIX = /opt/tr2latex # TEXDIR gives the path where the tex library resides (fonts, macros ...) TEXDIR = $(PREFIX)/share/texmf-local #TEXDIR = $(PREFIX)/texlive/texmf-local # flags for compiling C sources CFLAGS += -Wall -O2 ############################################################################## # nothing to configure beyond this point all: tr2latex tr2latex: tr2latex.o tr.o subs.o $(CC) -o $@ $^ tr2latex.o: tr2latex.c setups.h protos.h tr.o: tr.c setups.h protos.h subs.o: subs.c protos.h setups.h simil.h greek.h macros.h maths.h flip.h forbid.h special.h install: tr2latex install -m 755 -d $(PREFIX)/bin install -m 755 -d $(PREFIX)/share/man/man1 install -m 755 -d $(TEXDIR)/macros install -m 0755 tr2latex $(PREFIX)/bin/tr2latex install -m 0444 tr2latex.man $(PREFIX)/share/man/man1/tr2latex.1 install -m 0444 troffman.sty troffms.sty $(TEXDIR)/macros uninstall: rm -f $(PREFIX)/bin/tr2latex $(PREFIX)/share/man/man1/tr2latex.1 $(TEXDIR)/macros/troffman.sty $(TEXDIR)/macros/troffms.sty clean: -rm -f *.o core tr2latex *~ TAGS tags testfile.tex *.pdf *.aux *.log *.toc *.zip test: testfile.tex testfile.pdf diffs.pdf testfile.tex: testfile tr2latex ./tr2latex $< > $@ %.pdf: %.tex pdflatex $< tr2latex.zip: clean $(RM) ../$@ cd .. ; zip -9 -x 'tr2latex/.svn/*' -r $@ tr2latex/ mv -f ../$@ .