Debian Codegraph @

api_docgen/Makefile.docfiles

raw
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
16 # Capitalize first letter of argument
17 define up
18 $(shell echo $(1) | cut -c1 | tr '[:lower:]' '[:upper:]')
19 endef
20
21 define capitalize_one
22 $(call up,$(1))$(shell echo $(1) | cut -c2-)
23 endef
24
25 define capitalize
26 $(foreach m,$(1),$(call capitalize_one,$m))
27 endef
28
29 runtime_events_MLIS := runtime_events.mli
30 str_MLIS := str.mli
31 unix_MLIS := unix.mli unixLabels.mli
32 dynlink_MLIS := dynlink.mli
33 thread_MLIS := \
34 thread.mli event.mli
35
36 STDLIB=$(STDLIB_MODULES)
37
38 stdlib_UNPREFIXED=$(STDLIB_MODULE_BASENAMES)
39
40 otherlibref := $(dynlink_MLIS:%.mli=%)
41
42 ifeq "$(lib_str)" "true"
43 otherlibref += $(str_MLIS:%.mli=%)
44 endif
45
46 ifeq "$(lib_unix)" "true"
47 otherlibref += $(unix_MLIS:%.mli=%)
48 endif
49
50 ifeq "$(lib_systhreads)" "true"
51 otherlibref += $(thread_MLIS:%.mli=%)
52 endif
53
54 ifeq "$(lib_runtime_events)" "true"
55 otherlibref += $(runtime_events_MLIS:%.mli=%)
56 endif
57
58 libref_TEXT=Ocaml_operators Format_tutorial
59 libref_C=$(call capitalize,$(libref))
60
61 PARSING_MLIS := $(notdir $(wildcard $(ROOTDIR)/parsing/*.mli))
62 UTILS_MLIS := $(notdir $(wildcard $(ROOTDIR)/utils/*.mli))
63 DRIVER_MLIS := pparse.mli
64
65 compilerlibref_MLIS= \
66 $(PARSING_MLIS) \
67 $(UTILS_MLIS) \
68 $(DRIVER_MLIS)
69 compilerlibref=$(compilerlibref_MLIS:%.mli=%)
70 compilerlibref_TEXT=Compiler_libs
71 compilerlibref_C=$(call capitalize,$(compilerlibref))
72
73 ALL_LIBREF= \
74 $(sort $(libref_TEXT:%=libref/%)) \
75 $(sort $(filter-out libref/camlinternal%, $(libref:%=libref/%))) \
76 $(sort $(filter libref/camlinternal%, $(libref:%=libref/%)))
77
78 ALL_COMPILERLIBREF= \
79 $(compilerlibref_TEXT:%=compilerlibref/%) \
80 $(compilerlibref:%=compilerlibref/%)
81 # Note that the output of $(wildcard ...) is sorted alphabetically.
82 # The compilerlibs index will be thus be sorted first by category:
83 # - text documentation
84 # - parsing modules
85 # - utils modules
86 # - driver modules
87 # And then alphabetically inside each category.
88
89 ALL_DOC= $(ALL_LIBREF) $(ALL_COMPILERLIBREF)