MACRODIR = /usr/local/lib/texmf/tex/latex/contrib/supported/monster CONFIGDIR = /usr/local/lib/texmf/tex/latex/config # CONFIGDIR = $(MACRODIR) # CONFIGDIR = ~/lib/texmf DOCDIR = /usr/local/lib/texmf/doc/latex/contrib/supported/monster INSTALL = install INSTALLOPTS = -m 644 # That is use mode rwxr-xr-x. LATEX = latex BIBTEX = bibtex MAKEINDEX = makeindex $(makeindex_opts) export makeindex_opts = -s gind.ist # INDEXSTYLE is colon-separated path that should lead to gind.ist. # If it is not set in your environment already, you should set it here. # export INDEXSTYLE = ## END OF USER CONFIGURATION link-files = relsize.sty moreverb.sty url.sty relsize.sty moreverb.sty url.sty: ln -sf ../../other/misc/$@ . part-1 = templates/part-1.dtx part-2 = templates/part-2.dtx part-3 = templates/part-3.dtx parts = $(part-1) $(part-2) $(part-3) extractor = templates/extractor.ins driver = templates/driver.tex dist-configs = abbrevs compsci slemph titles configs = $(distconfigs) \ bits monster myletter dist-bibstyles = bibstyles = $(dist-bibstyles) \ achicago dist-packages = abbrevs compsci lips moredefs slemph titles packages = $(dist-packages) \ achicago attrib bits blkcntrl dblefig newclude dialogue epigraph footnote quotes \ margins new-margins nimbus-cmb nimbus-mdtb verse dist-classes = classes = $(dist-classes) \ tkd tkd-attendance tkd-roster myletter macros = $(packages) $(classes) $(bibstyles) dist-macros = $(dist-packages) $(dist-classes) $(dist-bibstyles) ############ macros.dvi = $(addsuffix .dvi, $(macros)) configs.cfg = $(addsuffix .cfg, $(configs)) classes.cls = $(addsuffix .cls, $(classes)) classes.clq = $(addsuffix .clq, $(classes)) classes.ins = $(addsuffix .ins, $(classes)) classes.dvi = $(addsuffix .dvi, $(classes)) classes.tex = $(addsuffix .tex, $(classes)) packages.sty = $(addsuffix .sty, $(packages)) packages.stq = $(addsuffix .stq, $(packages)) packages.ins = $(addsuffix .ins, $(packages)) packages.dvi = $(addsuffix .dvi, $(packages)) packages.tex = $(addsuffix .tex, $(packages)) ########## dist-macros.sty.install = $(addsuffix .sty.install, $(dist-packages)) dist-macros.stq = $(addsuffix .stq, $(dist-packages)) dist-macros.stq.install = $(addsuffix .stq.install, $(dist-packages)) dist-macros.cls.install = $(addsuffix .cls.install, $(dist-classes)) dist-macros.clq = $(addsuffix .clq, $(dist-classes)) dist-macros.clq.install = $(addsuffix .clq.install, $(dist-classes)) dist-macros.dvi = $(addsuffix .dvi, $(dist-macros)) dist-macros.dvi.install = $(addsuffix .dvi.install, $(dist-macros)) dist-macros.clean = $(addsuffix .clean, $(dist-macros)) dist-configs.cfg = $(addsuffix .cfg, $(dist-configs)) dist-packages.sty = $(addsuffix .sty, $(dist-packages)) dist-packages.ins = $(addsuffix .ins, $(dist-packages)) dist-packages.tex = $(addsuffix .tex, $(dist-packages)) dist-packages.dvi = $(addsuffix .dvi, $(dist-packages)) dist-classes.sty = $(addsuffix .sty, $(dist-classes)) dist-classes.ins = $(addsuffix .ins, $(dist-classes)) dist-classes.tex = $(addsuffix .tex, $(dist-classes)) dist-classes.dvi = $(addsuffix .dvi, $(dist-classes)) ########## home = monster dist-files = $(dist-configs.cfg) \ $(dist-packages.ins) $(dist-packages.tex) $(dist-packages.sty) \ $(dist-classes.ins) $(dist-classes.tex) $(dist-classes.sty) \ README COPYING Makefile define transform sed -e 's/__NAME__/$*/g' endef define transform-cls $(transform) -e 's/__SUFFIX__/cls/g' \ -e 's/__QSUFFIX__/clq/g' \ -e 's/__TYPE__/class/g' \ -e 's/__CAP-TYPE__/Class/g' endef define transform-sty $(transform) -e 's/__SUFFIX__/sty/g' \ -e 's/__QSUFFIX__/stq/g' \ -e 's/__TYPE__/package/g' \ -e 's/__CAP-TYPE__/Package/g' endef define latex-lil $(LATEX) $* $(MAKEINDEX) $*.idx $(LATEX) $* endef define latex-libll $(LATEX) $* $(MAKEINDEX) $*.idx $(BIBTEX) $* $(LATEX) $* $(LATEX) $* endef .PHONY: default help install-stq install-doc install-sty install .PHONY: all dvi stq sty macros.dvi dist-macros.dvi .PHONY: clean devclean .PHONY: distribution bst default help: @echo ;\ echo ----------------------;\ echo FRANKENSTEIN\'S TARGETS;\ echo ----------------------;\ echo ;\ echo ----------------;\ echo For the End User;\ echo ----------------;\ echo ;\ echo ::: Look over the first few lines of the Makefile before making anything.;\ echo ;\ echo For each package X, there are the following targets:;\ echo;\ echo " X.sty.install = install X" ;\ echo " X.stq = build quick version of X";\ echo " X.stq.install = build and install quick version of X";\ echo " X.dvi = build documentation of X";\ echo " X.dvi.install = build and install documentation of X";\ echo " X.clean = delete non-distributed X files";\ echo ;\ echo The \"quick\" version of a package is stripped of comments.;\ echo ;\ echo Leaving off the initial \`X.\' means do the same for each available X.;\ echo For example, the \`dvi\' target builds all the documentation.;\ echo ;\ echo The target \'all\' is an abbreviation for \`stq.install\', ;\ echo \`dvi.install\', and \`clean\'.;\ echo @echo ------ @echo For Me @echo ------ @echo @echo \`make macros\' makes documented package or class files @echo " with .sty or .cls extensions." @echo \`make qmacros\' makes quick-loading package or class files @echo " with .stq or .clq extensions." @echo \`make dvi\' makes the documentation with .dvi extensions. @echo @echo \`make install-qmacros\' installs the .stq and .clq files @echo " into MACRODIR which defaults to $(MACRODIR)." @echo \`make install-macros\' installs the .sty and .cls files @echo " into MACRODIR." @echo \`make install-dvi\' installs the .dvi files into $(DOCDIR) @echo " which defaults to $(DOCDIR)." @echo \`make install\' does both @echo @echo \'make distribution\' makes an archive of certain files. @echo @echo \'make clean\' cleans up. @echo .PHONY: sty.install stq stq.install dvi dvi.install all clean \ $(macros.sty.install) $(macros.stq.install) \ $(macros.dvi.instal) $(macros.clean) define install-cfg for x in $(dist-configs); do \ if [ "$$x" = "$*" ]; then \ if [ -f $*.cfg ]; then \ mkdir -p $(CONFIGDIR); \ $(INSTALL) $(INSTALLOPTS) $*.cfg $(CONFIGDIR); \ else \ echo I cannot find the configuration file $*.cfg!; \ fi; \ fi; \ done endef %.sty.install: %.sty mkdir -p $(MACRODIR) $(INSTALL) $(INSTALLOPTS) $< $(MACRODIR) $(install-cfg) %.stq: %.ins %.sty $(LATEX) $< %.stq.install: %.stq mkdir -p $(MACRODIR) $(INSTALL) $(INSTALLOPTS) $< $(MACRODIR)/$*.sty $(install-cfg) %.cls.install: %.cls mkdir -p $(MACRODIR) $(INSTALL) $(INSTALLOPTS) $< $(MACRODIR) $(install-cfg) %.clq: %.ins %.cls $(LATEX) $< %.clq.install: %.clq mkdir -p $(MACRODIR) $(INSTALL) $(INSTALLOPTS) $< $(MACRODIR)/$*.cls $(install-cfg) $(dist-packages.dvi): %.dvi: %.tex %.sty $(LATEX) $< $(MAKEINDEX) $*.idx if [ -f $*.bib ]; then \ $(BIBTEX) $*; \ $(LATEX) $*; \ fi $(LATEX) $* $(dist-classes.dvi): %.dvi: %.tex %.cls $(LATEX) $< $(MAKEINDEX) $*.idx if [ -f $*.bib ]; then \ $(BIBTEX) $*; \ $(LATEX) $*; \ fi $(LATEX) $* %.dvi.install: %.dvi mkdir -p $(DOCDIR) $(INSTALL) $(INSTALLOPTS) $< $(DOCDIR) all: stq.install clq.install dvi.install clean ifneq ($(USER),swift) sty.install: $(dist-macros.sty.install) stq: $(dist-macros.stq) stq.install: $(dist-macros.stq.install) cls.install: $(dist-macros.cls.install) clq: $(dist-macros.clq) clq.install: $(dist-macros.clq.install) dvi: $(dist-macros.dvi) dvi.install: $(dist-macros.dvi.install) clean: $(dist-macros.clean) %.clean: rm -f $*.{log,idx,ind,aux,dvi,vrb,stq,bib,blg} else sty.install: $(macros.sty.install) stq: $(macros.stq) stq.install: $(macros.stq.install) cls.install: $(macros.cls.install) clq: $(macros.clq) clq.install: $(macros.clq.install) dvi: $(macros.dvi) dvi.install: $(macros.dvi.install) clean: $(macros.clean) # Unfortunately this will preserve %.t? also. .PRECIOUS: $(packages.tex) $(packages.ins) $(packages.sty) .PRECIOUS: $(classes.tex) $(classes.ins) $(classes.cls) %.t1: %.dtx awk '/^% \\CheckSum{[0-9]+}/,/% \\part{Implementation}/' $*.dtx > $@ %.t2: %.dtx sed -n '/^\\def\\fileinfo{.*}/,/\\def\\docdate{.*}/p' $*.dtx > $@ %.t3: %.dtx awk '/^% \\part{Implementation}/,/^% \\Finale/ {if ($$0 !~ /^% \\part{Implementation}/) print}' $*.dtx\ | sed '/\\def\\fileinfo{.*}/,/\\def\\docdate{.*}/d' > $@ %.sty: %.t1 %.t2 %.t3 $(parts) cat $(part-1) $*.t1 $(part-2) $*.t2 $(part-3) $*.t3 \ | $(transform-sty) > $@ %.cls: %.t1 %.t2 %.t3 $(parts) cat $(part-1) $*.t1 $(part-2) $*.t2 $(part-3) $*.t3 \ | $(transform-cls) > $@ $(packages.tex): %.tex: $(driver) $(transform-sty) $(driver) > $@ $(classes.tex): %.tex: $(driver) $(transform-cls) $(driver) > $@ $(packages.ins): %.ins: $(extractor) $(transform-sty) $(extractor) > $@ $(classes.ins): %.ins: $(extractor) $(transform-cls) $(extractor) > $@ bst: ../../bibtex/bst/$(bibstyle).bst ../../bibtex/bst/$(bibstyle).bst: $(bibstyle)-bst.dtx tex $(bibstyle)-bst.ins sed 's/\\endinput//' $(bibstyle).bst > ../../bibtex/bst/$(bibstyle).bst ########## macros: $(packages.sty) $(classes.cls) qmacros: $(packages.stq) $(classes.clq) macros.dvi: $(macros.dvi) dist-macros.dvi: $(dist-macros.dvi) distribution: $(dist-files) $(link-files) rm -f $(home).tgz cd ..; \ tar czf $(home).tgz \ $(addprefix $(home)/, $(dist-files)) \ $(addprefix $(home)/, $(link-files)); \ mv $(home).tgz $(home) clean: for x in $(macros); do \ rm -f $$x.{aux,idx,blg,glo,toc,log,lof,lot,ind,ps,t1,t2,t3,vrb}; \ done dev.clean: clean for x in $(macros); do \ rm -f $$x.{tex,ins,sty,stq,cls,clq,dvi}; \ done endif