Debian Codegraph @

api_docgen/ocamldoc/Makefile

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 #**************************************************************************
2 #* *
3 #* OCaml *
4 #* *
5 #* Florian Angeletti, projet Cambium, Inria Paris *
6 #* *
7 #* Copyright 2020 Institut National de Recherche en Informatique et *
8 #* en Automatique. *
9 #* *
10 #* All rights reserved. This file is distributed under the terms of *
11 #* the GNU Lesser General Public License version 2.1, with the *
12 #* special exception on linking described in the file LICENSE. *
13 #* *
14 #**************************************************************************
15 # Used by included Makefiles
16 ROOTDIR = ../..
17 include ../Makefile.common
18 vpath %.mli ../../stdlib $(DOC_COMPILERLIBS_DIRS) $(DOC_STDLIB_DIRS)
19
20
21 man: build/man/Stdlib.3o
22 latex: build/latex/Stdlib.tex
23 html: \
24 build/html/libref/Stdlib.html \
25 build/html/compilerlibref/Compiler_libs.html
26 texi: build/texi/stdlib.texi
27
28 DOC_STDLIB_INCLUDES= $(addprefix -I , $(DOC_STDLIB_DIRS))
29
30 DOC_ALL_INCLUDES = \
31 $(DOC_STDLIB_INCLUDES) \
32 $(addprefix -I ,$(DOC_COMPILERLIBS_DIRS))
33
34 libref=$(stdlib_UNPREFIXED) $(otherlibref)
35
36 ALL_MAN= $(ALL_DOC:%=build/man/%.3o)
37 ALL_LATEX= $(ALL_DOC:%=build/latex/%.tex)
38
39 build/latex/ifocamldoc.tex: | build/latex
40 $(V_GEN)printf '\\newif\\ifocamldoc\\ocamldoctrue\n' > $@
41
42 $(libref:%=build/libref/%.odoc): build/libref/%.odoc: %.mli | build/libref
43 $(V_OCAMLDOC)$(OCAMLDOC_RUN) -nostdlib -hide Stdlib -lib Stdlib \
44 -pp \
45 "$(AWK) -v ocamldoc=true -f ../../stdlib/expand_module_aliases.awk" \
46 $(DOC_STDLIB_INCLUDES) -hide-warnings $< -dump $@
47
48 $(compilerlibref:%=build/compilerlibref/%.odoc):\
49 build/compilerlibref/%.odoc: %.mli | build/compilerlibref
50 $(V_OCAMLDOC)$(OCAMLDOC_RUN) -nostdlib -hide Stdlib \
51 $(DOC_ALL_INCLUDES) -hide-warnings $< -dump $@
52
53 $(compilerlibref_TEXT:%=build/compilerlibref/%.odoc):\
54 build/compilerlibref/%.odoc: build/%.mld | build/compilerlibref
55 $(V_OCAMLDOC)$(OCAMLDOC_RUN) -hide-warnings $(DOC_ALL_INCLUDES) -text $< -dump $@
56
57 $(libref_TEXT:%=build/libref/%.odoc):\
58 build/libref/%.odoc: build/%.mld | build/libref
59 $(V_OCAMLDOC)$(OCAMLDOC_RUN) -hide-warnings $(DOC_STDLIB_INCLUDES) -text $< -dump $@
60
61 ALL_COMPILED_DOC=$(ALL_DOC:%=build/%.odoc)
62 build/man/Stdlib.3o: $(ALL_COMPILED_DOC) | build/man
63 $(V_OCAMLDOC)$(OCAMLDOC_RUN) -man -d build/man -man-mini \
•64 -man-section 3o \
65 -nostdlib -hide Stdlib -lib Stdlib -t "OCaml library" \
66 $(addprefix -load , $(ALL_COMPILED_DOC))
67
68 HTML_OPTIONS= -charset="utf8" -colorize-code -nonavbar
69
70 build/html/libref/Stdlib.html: $(ALL_LIBREF:%=build/%.odoc) | build/html/libref
71 $(V_OCAMLDOC)$(OCAMLDOC_RUN) -html -d build/html/libref \
72 $(HTML_OPTIONS) \
73 -nostdlib -hide Stdlib -lib Stdlib -t "OCaml library" \
74 $(addprefix -load , $(ALL_LIBREF:%=build/%.odoc))
75
76 build/html/compilerlibref/Compiler_libs.html: \
77 $(ALL_COMPILERLIBREF:%=build/%.odoc) | build/html/compilerlibref
78 $(V_OCAMLDOC)$(OCAMLDOC_RUN) -html -d build/html/compilerlibref \
79 -nostdlib -hide Stdlib -t "OCaml compiler library" \
80 $(HTML_OPTIONS) \
81 -intro build/Compiler_libs.mld \
82 $(addprefix -load , $(ALL_COMPILERLIBREF:%=build/%.odoc))
83
84 build/texi/stdlib.texi: $(ALL_COMPILED_DOC) | build/texi
85 $(V_OCAMLDOC)$(OCAMLDOC_RUN) -texi -o $@ \
86 -nostdlib -hide Stdlib -lib Stdlib -t "OCaml library" \
87 $(addprefix -load , $(ALL_COMPILED_DOC))
88
89 build/latex/Stdlib.tex: $(ALL_COMPILED_DOC) | build/latex
90 $(V_OCAMLDOC)$(OCAMLDOC_RUN) -latex -o build/latex/all.tex \
91 -hide Stdlib -lib Stdlib $(DOC_ALL_INCLUDES) \
92 -sepfiles \
93 -latex-escape-underscore "false" \
94 -latextitle "1,subsection*" \
95 -latextitle "2,subsubsection*" \
96 -latex-type-prefix "TYP" \
97 -latex-module-prefix "" \
98 -latex-module-type-prefix "" \
99 -latex-value-prefix "" \
100 -nostdlib -hide Stdlib -lib Stdlib -t "OCaml library" \
101 $(addprefix -load , $(ALL_COMPILED_DOC))
102
103 build/latex/alldoc.pdf: build/latex/Stdlib.tex build/latex/alldoc.tex \
104 | build/latex
105 cd build/latex && \
106 TEXINPUTS=$${TEXINPUTS}:../../ocamldoc pdflatex alldoc
107 cd build/latex && \
108 TEXINPUTS=$${TEXINPUTS}:../../ocamldoc pdflatex alldoc
109
110 stdlib_INPUT=$(foreach module,\
111 $(filter-out stdlib.mli camlinternal%,$(stdlib_UNPREFIXED)),\
112 \\input{$(call capitalize,$(module)).tex}\
113 )
114 build/latex/stdlib_input.tex: | build/latex
115 $(V_GEN)echo $(stdlib_INPUT) > $@
116
117 compilerlibs_INPUT=$(foreach module,\
118 $(filter-out camlinternal%,$(compilerlibref)),\
119 \\input{$(call capitalize,$(module)).tex})
120 build/latex/compilerlibs_input.tex: | build/latex
121 $(V_GEN)echo $(compilerlibs_INPUT) > $@
122
123 .PHONY: install
124 install:
125 $(MKDIR) "$(INSTALL_LIBRARIES_MAN_DIR)"
126 if test -d build/man; then \
127 $(INSTALL_DATA) build/man/*.3o "$(INSTALL_LIBRARIES_MAN_DIR)"; \
128 fi