1 # Makefile included by each manual: contains the
2 # common build commands/targets ("make pdf", "make ps", "make html")
3 # common "upload-to-web" targets ("make web")
5 # The enclosing Makefile is expected to set the variables:
6 # FILE: base name of master TeX file (typically "manual")
7 # TEX: all TeX files to depend on (often just "manual.tex")
8 # DEST: destination manual name (e.g., "fem")
9 # LATEX2HTML: call to latex2html, which should be "$(L2H) <args>"
10 # DOCTITLE: title of the manual
11 # (optional) PROJECT_LINK: HTML to include at bottom of page
13 # Destination directory for local copy of files (e.g., on user machine)
16 # Destination directory for web-accessible copy of files (e.g., on PPL machines)
17 WEBDIR=/www/ppl_manuals
20 L2H=latex2html -white -antialias -local_icons \
22 -show_section_numbers \
26 DEPTEX=$(TEX) $(FILE).aux index.tex
28 .PHONY: setup html1page
30 # Default target: build postscript, pdf, and html:
37 # latex does not create dvi anymore on new linux distributions
38 #$(FILE).dvi: $(TEX) $(FILE).aux
41 $(FILE).ps: $(FILE).pdf
42 pdftops -level1 -paper letter $(FILE).pdf $(FILE).ps
43 #dvips -t letter -f $(FILE).dvi > $(FILE).ps
49 $(FILE).pdf: $(TEX) $(FILE).aux
54 html: html1page $(FILE)
56 tmpFile = tmp-navmenu.html
58 $(FILE): setup $(TEX) $(FILE).aux
59 export MANUALTITLE=$(DOCTITLE) && $(LATEX2HTML) $(FILE).tex && unset MANUALTITLE
60 ../navmenuGenerator.py $@/index.html > $(tmpFile)
61 for f in $@/*.html; do echo "Sanitizing $$f"; sed -i -e 's!'`pwd`'/!!g' $$f; ../markupSanitizer.py $$f $(tmpFile) > tmpop && cat tmpop > $$f && rm tmpop; done
64 l2h1pagecfg = ./l2h-1page-init
66 html1page: setup $(TEX) $(FILE).aux
67 cp ../dot.latex2html-init $(l2h1pagecfg)
68 sed -i -e "s|MAX_SPLIT_DEPTH[ ]*=|MAX_SPLIT_DEPTH = 0; #|g" $(l2h1pagecfg)
69 $(L2H) -init_file $(l2h1pagecfg) $(FILE).tex
70 -@mv $(FILE)/$(FILE).html $(FILE)/$(FILE)-1p.html
74 -@ln -s ../pplmanual.* .
75 -@ln -s ../dot.latex2html-init .latex2html-init
76 -@rm -fr $(FILE)/*.html $(FILE)/*.aux
78 -@/bin/cp -r ../assets fig figs $(FILE)
80 # LaTeX Index and link support
81 $(FILE).aux: $(TEX) index.tex $(FIG_TARGET)
84 index.tex: $(FILE).idx
85 makeindex -o index.tex $(FILE).idx
90 # Clean out all TeX droppings:
92 -rm -fr *.aux *.log *.dvi *.ps *.pdf *.out *.ilg $(FILE)
93 -rm -fr *.idx *.log *.bbl *.blg *.toc *~ fig/*.bak
94 -rm -fr index.tex $(FIG_CLEAN)
96 # Build local copy of documentation:
98 if [ ! -d $(DOCDIR) ] ; then mkdir $(DOCDIR) ; fi
99 if [ ! -d $(DOCDIR)/pdf ] ; then mkdir $(DOCDIR)/pdf ; fi
100 if [ ! -d $(DOCDIR)/html ] ; then mkdir $(DOCDIR)/html ; fi
101 /bin/cp $(FILE).pdf $(DOCDIR)/pdf/$(DEST).pdf
102 chmod 664 $(DOCDIR)/pdf/$(DEST).pdf
103 /bin/rm -rf $(DOCDIR)/html/$(DEST)
104 /bin/cp -R $(FILE) $(DOCDIR)/html/$(DEST)
105 find $(DOCDIR)/html/$(DEST) $(DOCDIR)/p*/$(DEST).p* -type f -exec chmod 664 {} \;
106 find $(DOCDIR)/html/$(DEST) -type d -exec chmod 775 {} \;
108 # Build web copy of documentation (PPL-only):
110 /bin/cp $(FILE).pdf $(WEBDIR)/pdf/$(DEST).pdf
111 -chmod 664 $(WEBDIR)/pdf/$(DEST).pdf
112 /bin/rm -rf $(WEBDIR)/html/$(DEST)
113 /bin/cp -R $(FILE) $(WEBDIR)/html/$(DEST)
114 find $(WEBDIR)/html/$(DEST) $(WEBDIR)/p*/$(DEST).p* -type f -exec chmod 664 {} \;
115 find $(WEBDIR)/html/$(DEST) -type d -exec chmod 775 {} \;
116 -chgrp -R kale $(WEBDIR)/html/$(DEST) $(WEBDIR)/p*/$(DEST).p*