summaryrefslogtreecommitdiff
path: root/api_docgen/Makefile.docfiles
blob: e403da657a030bf57facfb38aa185937138928bb (plain)
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
#**************************************************************************
#*                                                                        *
#*                                 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.          *
#*                                                                        *
#**************************************************************************

# Capitalize first letter of argument
define up
$(shell echo $(1) | cut -c1 | tr '[:lower:]' '[:upper:]')
endef

define capitalize_one
$(call up,$(1))$(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 event.mli \
	threadUnix.mli

libref= \
	$(filter-out pervasives,$(STDLIB_MODULE_BASENAMES)) \
	$(str_MLIS:%.mli=%) \
	$(unix_MLIS:%.mli=%) \
	$(dynlink_MLIS:%.mli=%) \
	$(thread_MLIS:%.mli=%)
libref_EXTRA=stdlib__pervasives
libref_TEXT=Ocaml_operators Format_tutorial
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)