| 1 |
ROOTDIR = ../.. |
| 2 |
include $(ROOTDIR)/Makefile.common |
| 3 |
|
| 4 |
TEXQUOTE = $(ROOTDIR)/runtime/ocamlrun ../tools/texquote2 |
| 5 |
|
| 6 |
DIRS = infoman texstuff textman |
| 7 |
|
| 8 |
FILES = allfiles.tex biblio.tex foreword.tex version.tex cmds/warnings-help.etex ifocamldoc.tex |
| 9 |
|
| 10 |
TEXINPUTS = ".:..:../refman:../refman/extensions:../library:../cmds:../tutorials:../../styles:" |
| 11 |
RELEASE = $$HOME/release/$${RELEASENAME} |
| 12 |
HEVEA = hevea |
| 13 |
HACHA = hacha |
| 14 |
|
| 15 |
|
| 16 |
INFO_FLAGS = -fix -exec xxdate.exe -info -w 79 -s |
| 17 |
HTML_FLAGS = -fix -exec xxdate.exe -O |
| 18 |
TEXT_FLAGS = -fix -exec xxdate.exe -text -w 79 -s |
| 19 |
|
| 20 |
|
| 21 |
APIDOC=$(ROOTDIR)/api_docgen |
| 22 |
.PHONY: html_files |
| 23 |
.PHONY: latex_files |
| 24 |
ifeq ($(DOCUMENTATION_TOOL),odoc) |
| 25 |
latex_files: |
| 26 |
make -C $(APIDOC) latex |
| 27 |
cp $(APIDOC)/odoc/build/latex/*/*.tex library |
| 28 |
|
| 29 |
html_files: |
| 30 |
make -C $(APIDOC) html |
| 31 |
cp -r $(APIDOC)/odoc/build/html/* htmlman |
| 32 |
|
| 33 |
ifocamldoc.tex: $(ROOTDIR)/Makefile.build_config |
| 34 |
$(MAKE) -C $(APIDOC)/odoc build/latex/ifocamldoc.tex |
| 35 |
cp $(APIDOC)/odoc/build/latex/ifocamldoc.tex $@ |
| 36 |
else |
| 37 |
latex_files: |
| 38 |
$(MAKE) -C $(APIDOC) latex |
| 39 |
cp $(APIDOC)/ocamldoc/build/latex/*.tex library |
| 40 |
|
| 41 |
html_files: |
| 42 |
$(MAKE) -C $(APIDOC) html |
| 43 |
mkdir -p htmlman/libref |
| 44 |
cp -r $(APIDOC)/ocamldoc/build/html/libref htmlman |
| 45 |
cp -r $(APIDOC)/ocamldoc/build/html/compilerlibref htmlman |
| 46 |
cp style.css htmlman/libref |
| 47 |
cp style.css htmlman/compilerlibref |
| 48 |
|
| 49 |
ifocamldoc.tex: $(ROOTDIR)/Makefile.build_config |
| 50 |
$(MAKE) -C $(APIDOC)/ocamldoc build/latex/ifocamldoc.tex |
| 51 |
cp $(APIDOC)/ocamldoc/build/latex/ifocamldoc.tex $@ |
| 52 |
endif |
| 53 |
|
| 54 |
$(DIRS): |
| 55 |
$(MKDIR) $@ |
| 56 |
|
| 57 |
pdf: files latex_files | texstuff |
| 58 |
cd texstuff \ |
| 59 |
&& TEXINPUTS=$(TEXINPUTS) lualatex manual.tex |
| 60 |
|
| 61 |
index: | texstuff |
| 62 |
cd texstuff \ |
| 63 |
&& sh ../../tools/fix_index.sh manual.idx \ |
| 64 |
&& makeindex manual.idx \ |
| 65 |
&& makeindex manual.kwd.idx |
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
html: etex-files html_files |
| 70 |
cd htmlman \ |
| 71 |
&& $(HEVEA) $(HTML_FLAGS) \ |
| 72 |
-I .. -I ../cmds -I ../library -I ../refman \ |
| 73 |
-I ../refman/extensions -I ../tutorials \ |
| 74 |
-I ../../styles -I ../texstuff \ |
| 75 |
manual.hva -e macros.tex ../manual.tex \ |
| 76 |
&& $(HACHA) -tocter manual.html |
| 77 |
|
| 78 |
info: files latex_files | infoman |
| 79 |
cd infoman \ |
| 80 |
&& rm -f ocaml.info* \ |
| 81 |
&& $(HEVEA) $(INFO_FLAGS) -o ocaml.info.body \ |
| 82 |
-I .. -I ../cmds -I ../library -I ../refman \ |
| 83 |
-I ../refman/extensions -I ../tutorials \ |
| 84 |
-I ../../styles -I ../texstuff \ |
| 85 |
../manual.inf -e macros.tex ../manual.tex |
| 86 |
cat manual.info.header infoman/ocaml.info.body > infoman/ocaml.info |
| 87 |
cd infoman \ |
| 88 |
&& rm -f ocaml.info.tmp ocaml.info.body \ |
| 89 |
&& gzip -9 ocaml.info* |
| 90 |
|
| 91 |
text: files latex_files | textman |
| 92 |
cd textman \ |
| 93 |
&& $(HEVEA) $(TEXT_FLAGS) \ |
| 94 |
-I .. -I ../cmds -I ../library -I ../refman \ |
| 95 |
-I ../refman/extensions -I ../tutorials \ |
| 96 |
-I ../../styles -I ../texstuff \ |
| 97 |
../manual.inf -e macros.tex ../manual.tex |
| 98 |
|
| 99 |
.PHONY: all |
| 100 |
all: |
| 101 |
$(MAKE) html |
| 102 |
$(MAKE) text |
| 103 |
$(MAKE) info |
| 104 |
$(MAKE) pdf |
| 105 |
$(MAKE) index |
| 106 |
$(MAKE) pdf |
| 107 |
|
| 108 |
release: all |
| 109 |
cp htmlman/manual.html $(RELEASE)refman.html |
| 110 |
rm -f htmlman/manual.{html,haux,hmanual*,htoc} |
| 111 |
tar zcf $(RELEASE)refman-html.tar.gz \ |
| 112 |
htmlman/*.* htmlman/libref htmlman/compilerlibref htmlman/fonts |
| 113 |
zip -8 $(RELEASE)refman-html.zip \ |
| 114 |
htmlman/*.* htmlman/libref/*.* htmlman/compilerlibref/*.* \ |
| 115 |
htmlman/fonts/*.* |
| 116 |
cp texstuff/manual.pdf $(RELEASE)refman.pdf |
| 117 |
cp textman/manual.txt $(RELEASE)refman.txt |
| 118 |
tar cf - infoman/ocaml.info* | gzip > $(RELEASE)refman.info.tar.gz |
| 119 |
|
| 120 |
web: html |
| 121 |
$(MAKE) -C html_processing all |
| 122 |
|
| 123 |
files: $(FILES) |
| 124 |
$(MAKE) -C cmds all |
| 125 |
$(MAKE) -C library all |
| 126 |
$(MAKE) -C refman all |
| 127 |
$(MAKE) -C tutorials all |
| 128 |
|
| 129 |
etex-files: $(FILES) |
| 130 |
$(MAKE) -C cmds etex-files |
| 131 |
$(MAKE) -C library etex-files |
| 132 |
$(MAKE) -C refman etex-files |
| 133 |
$(MAKE) -C tutorials etex-files |
| 134 |
|
| 135 |
|
| 136 |
%.tex: %.etex |
| 137 |
$(TEXQUOTE) < $< > $*.texquote_error.tex |
| 138 |
mv $*.texquote_error.tex $@ |
| 139 |
|
| 140 |
cmds/warnings-help.etex: $(ROOTDIR)/utils/warnings.ml $(ROOTDIR)/ocamlc |
| 141 |
(echo "% This file is generated from (ocamlc -warn-help)";\ |
| 142 |
echo "% according to a rule in manual/src/Makefile.";\ |
| 143 |
echo "% In particular, the reference to documentation sections";\ |
| 144 |
echo "% are inserted through the Makefile, which should be updated";\ |
| 145 |
echo "% when a new warning is documented.";\ |
| 146 |
echo "%";\ |
| 147 |
$(ROOTDIR)/boot/ocamlrun $(ROOTDIR)/ocamlc -warn-help \ |
| 148 |
| LC_ALL=C sed -e 's/^ *\([0-9][0-9]*\) *\[\([a-z][a-z-]*\)\]\(.*\)/\\item[\1 "\2"] \3/' \ |
| 149 |
-e 's/^ *\([0-9A-Z][0-9]*\) *\([^]].*\)/\\item[\1] \2/'\ |
| 150 |
| sed -e 's/@/\\@/g' \ |
| 151 |
) >$@ |
| 152 |
|
| 153 |
for i in 52 57; do\ |
| 154 |
sed\ |
| 155 |
s'/\\item\[\('$$i'[^]]*\)\]/\\item\[\1 (see \\ref{ss:warn'$$i'})\]/'\ |
| 156 |
$@ > [email protected];\ |
| 157 |
mv [email protected] $@;\ |
| 158 |
done |
| 159 |
|
| 160 |
.PHONY: clean |
| 161 |
clean: |
| 162 |
rm -f $(filter-out version.tex,$(FILES)) *.texquote_error |
| 163 |
$(MAKE) -C cmds clean |
| 164 |
$(MAKE) -C html_processing clean |
| 165 |
$(MAKE) -C library clean |
| 166 |
$(MAKE) -C refman clean |
| 167 |
$(MAKE) -C tutorials clean |
| 168 |
cd htmlman; rm -rf libref compilerlibref *.htoc *.html *.haux *.hind *.svg \ |
| 169 |
fonts/KaTeX* katex.min.css katex.min.js highlight.pack.js \ |
| 170 |
manual.hmanual manual.hmanual.kwd manual.css odoc.css |
| 171 |
rm -rf $(DIRS) |
| 172 |
|
| 173 |
.PHONY: distclean |
| 174 |
distclean: clean |
| 175 |
rm -f version.tex |
| 176 |
$(MAKE) -C cmds distclean |
| 177 |
$(MAKE) -C html_processing distclean |
| 178 |
$(MAKE) -C library distclean |
| 179 |
$(MAKE) -C refman distclean |
| 180 |
$(MAKE) -C tutorials distclean |