Resolve build failure due to inttypes.h inclusion in hrctimer.h
[charm.git] / doc / Makefile.common
blob1c291d6ca834e44a8dba8addf820ea0806a569fe
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)
14 DOCDIR=..
16 # Destination directory for web-accessible copy of files (e.g., on PPL machines)
17 WEBDIR=/www/ppl_manuals
19 # Call to Latex2html
20 L2H=latex2html -white -antialias -local_icons \
21         -long_titles 1 \
22         -show_section_numbers \
23         -top_navigation \
24         -address ''
26 DEPTEX=$(TEX) $(FILE).aux index.tex
28 .PHONY: setup html1page
30 # Default target: build postscript, pdf, and html:
32 all: pdf html
34 # PostScript Target:
35 ps: $(FILE).ps
37 # latex does not create dvi anymore on new linux distributions
38 #$(FILE).dvi: $(TEX) $(FILE).aux 
39 #       latex $(FILE).tex
41 $(FILE).ps: $(FILE).pdf
42         pdftops -level1 -paper letter $(FILE).pdf $(FILE).ps
43         #dvips -t letter -f $(FILE).dvi > $(FILE).ps
46 # PDF Target:
47 pdf: $(FILE).pdf
49 $(FILE).pdf: $(TEX) $(FILE).aux
50         pdflatex $(FILE).tex
51         pdflatex $(FILE).tex
53 # HTML Target:
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
62         rm -f $(tmpFile)
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
71         rm -f $(l2h1pagecfg)
73 setup:
74         -@ln -s ../pplmanual.* .
75         -@ln -s ../dot.latex2html-init .latex2html-init
76         -@rm -fr $(FILE)/*.html $(FILE)/*.aux
77         -@mkdir $(FILE)
78         -@/bin/cp -r ../assets fig figs $(FILE)
80 # LaTeX Index and link support
81 $(FILE).aux: $(TEX) index.tex $(FIG_TARGET)
82         pdflatex $(FILE).tex
84 index.tex: $(FILE).idx
85         makeindex -o index.tex $(FILE).idx
87 $(FILE).idx:
88         touch $(FILE).idx
90 # Clean out all TeX droppings:
91 clean:
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:
97 doc: all
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):
109 web: all
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*