-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9996 from Octachron/parallel_manpages
documentation: centralized and parallel builds
- Loading branch information
Showing
17 changed files
with
358 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{1 Warning} | ||
This library is part of the internal OCaml compiler API, and is | ||
not the language standard library. | ||
There are no compatibility guarantees between releases, so code written | ||
against these modules must be willing to depend on specific OCaml compiler | ||
versions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
#************************************************************************** | ||
#* * | ||
#* OCaml * | ||
#* * | ||
#* Florian Angeletti, projet Cambium, Inria Paris * | ||
#* * | ||
#* Copyright 2020 Institut National de Recherche en Informatique et * | ||
#* en Automatique. * | ||
#* * | ||
#* All rights reserved. This file is distributed under the terms of * | ||
#* the GNU Lesser General Public License version 2.1, with the * | ||
#* special exception on linking described in the file LICENSE. * | ||
#* * | ||
#************************************************************************** | ||
ROOTDIR = .. | ||
|
||
include $(ROOTDIR)/stdlib/StdlibModules | ||
include $(ROOTDIR)/Makefile.common | ||
include $(ROOTDIR)/Makefile.best_binaries | ||
include $(ROOTDIR)/ocamldoc/Makefile.best_ocamldoc | ||
include Makefile.docfiles | ||
|
||
DOC_COMPILERLIBS_DIRS= $(addprefix $(ROOTDIR)/, \ | ||
parsing utils typing bytecomp driver file_formats lambda\ | ||
) | ||
|
||
DOC_STDLIB_DIRS = $(addprefix $(ROOTDIR)/, stdlib \ | ||
otherlibs/str \ | ||
otherlibs/$(UNIXLIB) otherlibs/dynlink \ | ||
otherlibs/systhreads\ | ||
) | ||
|
||
DOC_STDLIB_INCLUDES=$(addprefix -I , $(DOC_STDLIB_DIRS)) | ||
|
||
DOC_ALL_INCLUDES = \ | ||
$(DOC_STDLIB_INCLUDES) \ | ||
$(addprefix -I ,$(DOC_COMPILERLIBS_DIRS)) | ||
|
||
ALL_MAN= $(ALL_DOC:%=man/%.3o) | ||
ALL_LATEX= $(ALL_DOC:%=latex/%.tex) | ||
|
||
all: html pdf man | ||
.PHONY:all | ||
.SUFFIXES: | ||
|
||
.PHONY: setup | ||
setup: | ||
$(MKDIR) build build/libref build/compilerlibref | ||
$(MKDIR) html html/libref html/compilerlibref | ||
$(MKDIR) man | ||
$(MKDIR) latex | ||
$(MKDIR) texi | ||
|
||
pdf: latex/alldoc.pdf | setup | ||
latex: | setup | ||
man: | setup | ||
html: | setup | ||
latex/alldoc.pdf: latex/stdlib_input.tex latex/compilerlibs_input.tex | ||
|
||
Compiler_libs.mld: Compiler_libs.pre.mld | ||
cp $< $@ && echo "{!modules:$(compilerlibref_C)}" >> $@ | ||
|
||
vpath %.mli $(ROOTDIR)/stdlib $(DOC_COMPILERLIBS_DIRS) $(DOC_STDLIB_DIRS) | ||
|
||
man: man/Stdlib.3o | ||
html: html/libref/Stdlib.html html/compilerlibref/Compiler_libs.html | ||
latex: latex/Stdlib.tex | ||
|
||
LD_PATH := "$(SRC)/otherlibs/unix/:$(SRC)/otherlibs/str/" | ||
SET_LD_PATH = CAML_LD_LIBRARY_PATH=$(LD_PATH) | ||
|
||
|
||
$(libref:%=build/libref/%.odoc):build/libref/%.odoc:%.mli | ||
$(OCAMLDOC_RUN) -nostdlib -hide Stdlib -lib Stdlib \ | ||
-pp \ | ||
"$(AWK) -v ocamldoc=true -f $(ROOTDIR)/stdlib/expand_module_aliases.awk" \ | ||
$(DOC_STDLIB_INCLUDES) $< -dump $@ | ||
|
||
$(compilerlibref:%=build/compilerlibref/%.odoc):\ | ||
build/compilerlibref/%.odoc:%.mli | ||
$(OCAMLDOC_RUN) -nostdlib -hide Stdlib -lib Stdlib \ | ||
$(DOC_ALL_INCLUDES) $< -dump $@ | ||
|
||
$(compilerlibref_TEXT:%=build/compilerlibref/%.odoc):\ | ||
build/compilerlibref/%.odoc:%.mld | ||
$(OCAMLDOC_RUN) $(DOC_ALL_INCLUDES) -text $< -dump $@ | ||
|
||
$(libref_TEXT:%=build/libref/%.odoc):build/libref/%.odoc:%.mld | ||
$(OCAMLDOC_RUN) $(DOC_STDLIB_INCLUDES) -text $< -dump $@ | ||
|
||
ALL_COMPILED_DOC=$(ALL_DOC:%=build/%.odoc) | ||
man/Stdlib.3o: $(ALL_COMPILED_DOC) | ||
$(MKDIR) man | ||
$(OCAMLDOC_RUN) -man -d man -man-mini \ | ||
-nostdlib -hide Stdlib -lib Stdlib -t "OCaml library" \ | ||
$(addprefix -load , $(ALL_COMPILED_DOC)) | ||
|
||
html/libref/Stdlib.html: $(ALL_LIBREF:%=build/%.odoc) | ||
$(MKDIR) -p html/libref | ||
$(OCAMLDOC_RUN) -html -d html/libref \ | ||
-charset="utf8" \ | ||
-nostdlib -hide Stdlib -lib Stdlib -t "OCaml library" \ | ||
$(addprefix -load , $(ALL_LIBREF:%=build/%.odoc)) | ||
|
||
html/compilerlibref/Compiler_libs.html: $(ALL_COMPILERLIBREF:%=build/%.odoc) | ||
$(MKDIR) -p html/compilerlibref | ||
$(OCAMLDOC_RUN) -html -d html/compilerlibref \ | ||
-nostdlib -hide Stdlib -t "OCaml compiler library" \ | ||
-charset="utf8" \ | ||
-intro Compiler_libs.mld \ | ||
$(addprefix -load , $(ALL_COMPILERLIBREF:%=build/%.odoc)) | ||
|
||
texi/stdlib.texi: $(ALL_COMPILED_DOC) | ||
$(MKDIR) texi | ||
$(OCAMLDOC_RUN) -texi -o $@ \ | ||
-nostdlib -hide Stdlib -lib Stdlib -t "OCaml library" \ | ||
$(addprefix -load , $(ALL_COMPILED_DOC)) | ||
|
||
latex/Stdlib.tex: $(ALL_COMPILED_DOC) | ||
$(MKDIR) latex | ||
$(OCAMLDOC_RUN) -latex -o latex/all.tex \ | ||
-hide Stdlib -lib Stdlib $(DOC_ALL_INCLUDES) \ | ||
-sepfiles \ | ||
-latextitle "1,subsection*" \ | ||
-latextitle "2,subsubsection*" \ | ||
-latex-type-prefix "TYP" \ | ||
-latex-module-prefix "" \ | ||
-latex-module-type-prefix "" \ | ||
-latex-value-prefix "" \ | ||
-nostdlib -hide Stdlib -lib Stdlib -t "OCaml library" \ | ||
$(addprefix -load , $(ALL_COMPILED_DOC)) | ||
|
||
latex/alldoc.pdf: latex/Stdlib.tex latex/alldoc.tex | ||
cd latex && TEXINPUTS=$${TEXINPUTS}:$(ROOTDIR)/ocamldoc pdflatex alldoc | ||
cd latex && TEXINPUTS=$${TEXINPUTS}:$(ROOTDIR)/ocamldoc pdflatex alldoc | ||
latex/alldoc.tex:alldoc.tex | ||
cp $< $@ | ||
|
||
stdlib_INPUT=$(foreach module,\ | ||
$(filter-out stdlib.mli camlinternal%,$(stdlib_UNPREFIXED)),\ | ||
\\input{$(call capitalize,$(module)).tex}\ | ||
) | ||
latex/stdlib_input.tex: | ||
echo $(stdlib_INPUT)> $@ | ||
|
||
compilerlibs_INPUT=$(foreach module,\ | ||
$(filter-out camlinternal%,$(compilerlibref)),\ | ||
\\input{$(call capitalize,$(module)).tex}) | ||
latex/compilerlibs_input.tex: | ||
echo $(compilerlibs_INPUT)> $@ | ||
|
||
INSTALL_MANODIR=$(INSTALL_MANDIR)/man3 | ||
.PHONY:install | ||
install: | ||
$(MKDIR) "$(INSTALL_MANODIR)" | ||
if test -d man; then \ | ||
$(INSTALL_DATA) man/* "$(INSTALL_MANODIR)"; \ | ||
else : ; fi | ||
|
||
clean: | ||
rm -rf build man html latex texi Compiler_libs.mld |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#************************************************************************** | ||
#* * | ||
#* OCaml * | ||
#* * | ||
#* Florian Angeletti, projet Cambium, Inria Paris * | ||
#* * | ||
#* Copyright 2020 Institut National de Recherche en Informatique et * | ||
#* en Automatique. * | ||
#* * | ||
#* All rights reserved. This file is distributed under the terms of * | ||
#* the GNU Lesser General Public License version 2.1, with the * | ||
#* special exception on linking described in the file LICENSE. * | ||
#* * | ||
#************************************************************************** | ||
|
||
define capitalize_one | ||
$(shell echo $(1) | cut -c1 | tr '[:lower:]' '[:upper:]')$\ | ||
$(shell echo $(1) | cut -c2-) | ||
endef | ||
|
||
define capitalize | ||
$(foreach m,$(1),$(call capitalize_one,$m)) | ||
endef | ||
|
||
|
||
str_MLIS := str.mli | ||
unix_MLIS := unix.mli unixLabels.mli | ||
dynlink_MLIS := dynlink.mli | ||
thread_MLIS := \ | ||
thread.mli condition.mli mutex.mli event.mli \ | ||
threadUnix.mli semaphore.mli | ||
|
||
STDLIB=$(filter-out stdlib__pervasives, $(STDLIB_MODULES)) | ||
|
||
stdlib_UNPREFIXED=$(STDLIB:stdlib__%=%) | ||
libref= \ | ||
$(stdlib_UNPREFIXED) \ | ||
$(str_MLIS:%.mli=%) \ | ||
$(unix_MLIS:%.mli=%) \ | ||
$(dynlink_MLIS:%.mli=%) \ | ||
$(thread_MLIS:%.mli=%) | ||
libref_EXTRA=stdlib__pervasives | ||
libref_TEXT=Ocaml_operators | ||
libref_C=$(call capitalize,$(libref) $(libref_EXTRA)) | ||
|
||
PARSING_MLIS := $(filter-out camlinternal%, \ | ||
$(notdir $(wildcard $(ROOTDIR)/parsing/*.mli))\ | ||
) | ||
UTILS_MLIS := $(notdir $(wildcard $(ROOTDIR)/utils/*.mli)) | ||
DRIVER_MLIS := pparse.mli | ||
|
||
compilerlibref_MLIS=\ | ||
$(PARSING_MLIS) \ | ||
$(UTILS_MLIS) \ | ||
$(DRIVER_MLIS) | ||
compilerlibref=$(compilerlibref_MLIS:%.mli=%) | ||
compilerlibref_TEXT=Compiler_libs | ||
compilerlibref_C=$(call capitalize,$(compilerlibref)) | ||
|
||
ALL_LIBREF= $(libref_TEXT:%=libref/%) $(libref:%=libref/%) | ||
ALL_COMPILERLIBREF= \ | ||
$(compilerlibref_TEXT:%=compilerlibref/%) \ | ||
$(compilerlibref:%=compilerlibref/%) | ||
ALL_DOC= $(ALL_LIBREF) $(ALL_COMPILERLIBREF) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
\documentclass{book} | ||
|
||
\usepackage[colorlinks=true]{hyperref} | ||
\usepackage{color} | ||
\usepackage{lmodern} | ||
\usepackage[T1]{fontenc} | ||
\usepackage[strings]{underscore} | ||
\usepackage{textcomp} | ||
\usepackage{ocamldoc} | ||
|
||
\newcommand{\docitem}[2]{\input{#2}} | ||
\begin{document} | ||
\chapter{Stdlib} | ||
\docitem{libref}{Stdlib.tex} | ||
\input{stdlib_input} | ||
\docitem{libref}{Ocaml_operators.tex} | ||
\chapter{Dynlink} | ||
\docitem{libref}{Dynlink.tex} | ||
\chapter{Str} | ||
\docitem{libref}{Str.tex} | ||
\chapter{Thread} | ||
\docitem{libref}{Condition.tex} | ||
\docitem{libref}{Event.tex} | ||
\docitem{libref}{Mutex.tex} | ||
\docitem{libref}{Thread.tex} | ||
\docitem{libref}{ThreadUnix.tex} | ||
\docitem{libref}{Semaphore.tex} | ||
\chapter{Unix} | ||
\docitem{libref}{UnixLabels.tex} | ||
\docitem{libref}{Unix.tex} | ||
\chapter{Compilerlibs} | ||
\docitem{compilerlibref}{Compiler_libs.tex} | ||
\input{compilerlibs_input.tex} | ||
\end{document} |
Oops, something went wrong.