forked from ocaml/ocaml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStdlibModules
131 lines (122 loc) · 3.76 KB
/
StdlibModules
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# -*- Makefile -*-
#**************************************************************************
#* *
#* OCaml *
#* *
#* Xavier Leroy, projet Cristal, INRIA Rocquencourt *
#* *
#* Copyright 2002 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. *
#* *
#**************************************************************************
# This file should be included after Makefile.common
# This file lists all standard library modules. It is used by:
# 1. stdlib/Makefile when building stdlib.cma
# 2. Makefile to expunge the toplevels
# 3. api_docgen/Makefile.docfiles to compute all documentation files which need
# need to be generated for the stdlib
# Three variables are exported:
# $(STDLIB_MODULE_BASENAMES) - basenames, in dependency order, of the modules in
# the stdlib
# $(STDLIB_PREFIXED_MODULES) - just the namespaced modules of
# $(STDLIB_MODULE_BASENAMES), i.e. without camlinternal* and stdlib. Used in
# stdlib/Makefile to munge the dependencies.
# $(STDLIB_MODULES) - full list, in prefixed form as appropriate.
# Basenames of the source files for the standard library (i.e. unprefixed and
# with lowercase first letters). These must be listed in dependency order.
STDLIB_MODULE_BASENAMES = \
camlinternalFormatBasics \
stdlib \
either \
sys \
obj \
type \
atomic \
camlinternalLazy \
lazy \
seq \
option \
pair \
result \
bool \
char \
uchar \
list \
int \
array \
iarray \
bytes \
string \
unit \
marshal \
float \
int32 \
int64 \
nativeint \
lexing \
parsing \
repr \
set \
map \
stack \
queue \
buffer \
mutex \
condition \
semaphore \
domain \
camlinternalFormat \
printf \
arg \
printexc \
fun \
gc \
in_channel \
out_channel \
digest \
bigarray \
random \
hashtbl \
weak \
format \
scanf \
callback \
camlinternalOO \
oo \
camlinternalMod \
dynarray \
pqueue \
ephemeron \
filename \
complex \
arrayLabels \
listLabels \
bytesLabels \
stringLabels \
moreLabels \
stdLabels \
effect
STDLIB_PREFIXED_MODULES = \
$(filter-out stdlib camlinternal%, $(STDLIB_MODULE_BASENAMES))
# $(STDLIB_MODULES) applies the PREFIX_MODULE macro to each item in
# $(STDLIB_MODULE_BASENAMES). For the names which require prefixing, this is
# done using CAPITALIZE. CAPITALIZE is a recursive macro taking the name to
# transform and a list of transformations to apply to the beginning of the name,
# thus $(call CAPITALIZE, string, ... r R s S t T ...) expands to String.
CAPITALIZE = \
$(strip $(if $(firstword $(2)), \
$(call CAPITALIZE, $(patsubst $(word 1, $(2))%, $(word 2, $(2))%, $(1)), \
$(wordlist 3, $(words $(2)), $(2))), \
$(1)))
PREFIX_MODULE = \
$(if $(filter stdlib camlinternal%, $(1)), \
$(1), \
stdlib__$(call CAPITALIZE, $(1), \
a A b B c C d D e E f F g G h H i I j J k K l L m M \
n N o O p P q Q r R s S t T u U v V w W x X y Y z Z))
STDLIB_MODULES = $(strip \
$(foreach name, $(STDLIB_MODULE_BASENAMES), $(call PREFIX_MODULE, $(name))))