##################################################################### # project name BASE = saga-programming-guide ##################################################################### # executeables TEX = latex COL = | cat | awk -- '$(AWK_COLOR)' PDFTEX = pdflatex SPELL = ispell PSBOOK = psbook DVIPS = dvips BIBTEX = bibtex MAKEINDEX = makeindex MAKE_IND = $(MAKEINDEX) -s gind.ist PSNUP_PAT = '4:0L@.7(21cm,0)+1L@.7(21cm,14.85cm),2R@.7(0,14.85cm)+3R@.7(0,29.70cm)' PSNUP = pstops $(PSNUP_PAT) COMBINE_TEX = ./combine_tex.pl TEX2HTML = latex2html AWK_COLOR = # /^\(/ { next } AWK_COLOR += /^ *$$/ { next } AWK_COLOR += # /^:/ { next } AWK_COLOR += # /^\)/ { next } AWK_COLOR += # /^Chapter/ { next } AWK_COLOR += # /^\\OT/ { next } AWK_COLOR += # /^ *\[/ { next } AWK_COLOR += # /^ * $@ ##################################################################### # short targets ifdef PRIVATE_MAKE_STUFF s: show d: slides f: figs b: bib a: again t: touch e: edit p: print p2: print2 endif pdf: $(BASE).pdf ps: $(BASE).ps ps2: $(BASE).ps2 dvi: $(BASE).dvi tex: $(BASE).tex ind: $(BASE).ind bbl: $(BASE).bbl aux: $(BASE).aux ##################################################################### # targets figs: $(TEX_FIGS) $(PDF_FIGS) spell: @$(SPELL) $(TEXFILES) print: $(BASE).ps @$(LPR) $(BASE).ps touch: @$(TOUCH) $(TEXFILES) $(BIBFILES) edit: @$(ENV) $(EDITOR) $(BASE).tex & @echo "name: $(EDITOR)" #-------------------------------------------------- # if an xdvi starts, it creates an XDVI_LOCK file. # if this exists, it does not start a new process. # if xdvi finishes, it removes the XDVI_LOCK file. # ifdef PRIVATE_MAKE_STUFF show: $(BASE).dvi @if [ ! -r $(XDVI_LOCK) ]; then \ ($(TOUCH) $(XDVI_LOCK) ; \ $(ENV) $(XDVI) $(BASE).dvi ; \ $(RM) $(XDVI_LOCK) ; \ )& \ fi -@$(GVIM) --servername XDVI-$(BASE) --remote-send ":call XDVI_jump()i" slides: $(BASE).pdf @if [ ! -r $(ACRO_LOCK) ]; then \ ($(TOUCH) $(ACRO_LOCK) && \ $(ACRO) $(BASE).pdf && \ $(RM) $(ACRO_LOCK) ; \ )& \ fi endif again: $(MAKE) -W $(BASE).tex $(filter-out again, $(MAKECMDGOALS)) fine: @$(MAKE) distclean @$(MAKE) dvi again @$(MAKE) ind @$(MAKE) bib @$(MAKE) again dvi @$(MAKE) again dvi -@$(MAKE) again pdf @$(MAKE) again pdf @$(MAKE) ps clean: # figclean @$(RM) $(INCTEX) $(BASE).m* \ *.{aux,blg,bbl,log,toc,err,idx,bak,ilg,ind,lof,lot,out,lod} \ *.{bmt,loe,glo} \ .*.sw[po] *~ distclean: @$(MAKE) clean @$(RM) $(BASE).{bak,dvi,ps,pdf,tex.bak} @$(RM) $(XDVI_LOCK) $(ACRO_LOCK) makelog figclean: @$(RM) $(TEX_FIGS) $(PDF_FIGS) bib: -@for file in $(AUXS) ; do $(BIBTEX) $$file ; done html: @$(COMBINE_TEX) $(BASE).tex combined.tex @$(TEX2HTML) combined.tex ##################################################################### # dependencies $(BASE).aux: $(BASE).dvi $(BASE).log: $(BASE).dvi $(BASE).toc: $(BASE).dvi $(BASE).idx: $(BASE).dvi test: @echo INCTEX: $(INCTEX) log: @cvs log | grep lines | sort -n