summaryrefslogtreecommitdiff
path: root/manual/manual/library/Makefile
blob: c1c4f122c6fdaff8c200c568489ad9d210e3f112 (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
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
CORE_INTF=Pervasives.tex

STDLIB_INTF=Arg.tex Array.tex ArrayLabels.tex Char.tex Complex.tex \
  Digest.tex Filename.tex Format.tex \
  Gc.tex Genlex.tex Hashtbl.tex Int32.tex Int64.tex \
  Lazy.tex Lexing.tex List.tex ListLabels.tex Map.tex Marshal.tex \
  MoreLabels.tex Nativeint.tex Obj.tex Oo.tex \
  Parsing.tex Printexc.tex Printf.tex Queue.tex Random.tex Scanf.tex \
  Set.tex Sort.tex Stack.tex Stream.tex String.tex StringLabels.tex Sys.tex \
  Weak.tex Callback.tex Buffer.tex StdLabels.tex \
  Bytes.tex BytesLabels.tex Spacetime.tex

COMPILER_LIBS_PLUGIN_HOOKS=Pparse.tex Typemod.tex

COMPILER_LIBS_INTF=Asthelper.tex Astmapper.tex Asttypes.tex \
	Lexer.tex Location.tex Longident.tex Parse.tex Pprintast.tex Printast.tex \
	$(COMPILER_LIBS_PLUGIN_HOOKS)

OTHERLIB_INTF=Unix.tex UnixLabels.tex Str.tex \
  Num.tex Arithstatus.tex Bigint.tex \
  Graphics.tex GraphicsX11.tex \
  Thread.tex Mutex.tex Condition.tex Event.tex ThreadUnix.tex \
  Dynlink.tex Bigarray.tex


INTF=$(CORE_INTF) $(STDLIB_INTF) $(COMPILER_LIBS_INTF) $(OTHERLIB_INTF)

MLIS=$(CSLDIR)/stdlib/*.mli \
	$(CSLDIR)/utils/*.mli \
	$(CSLDIR)/parsing/*.mli \
	$(CSLDIR)/driver/pparse.mli \
	$(CSLDIR)/typing/typemod.mli \
	$(CSLDIR)/bytecomp/simplif.mli \
	$(CSLDIR)/otherlibs/bigarray/bigarray.mli \
	$(CSLDIR)/otherlibs/dynlink/dynlink.mli \
	$(CSLDIR)/otherlibs/graph/graphics.mli \
	$(CSLDIR)/otherlibs/graph/graphicsX11.mli \
	$(CSLDIR)/otherlibs/num/num.mli \
	$(CSLDIR)/otherlibs/num/arith_status.mli \
	$(CSLDIR)/otherlibs/num/big_int.mli \
	$(CSLDIR)/otherlibs/str/*.mli \
	$(CSLDIR)/otherlibs/systhreads/*.mli \
	$(CSLDIR)/otherlibs/unix/*.mli

BLURB=core.tex builtin.tex stdlib.tex compilerlibs.tex \
  libunix.tex libstr.tex libnum.tex libgraph.tex \
  libthreads.tex libdynlink.tex libbigarray.tex

FILES=$(BLURB) $(INTF)

FORMAT=../../tools/format-intf
TEXQUOTE=../../tools/texquote2

CSLDIR=$(RELEASEDIR)

VPATH=.:$(CSLDIR)/stdlib:$(CSLDIR)/parsing:$(CSLDIR)/otherlibs/unix:$(CSLDIR)/otherlibs/str:$(CSLDIR)/otherlibs/num:$(CSLDIR)/otherlibs/graph:$(CSLDIR)/otherlibs/threads:$(CSLDIR)/otherlibs/dynlink:$(CSLDIR)/otherlibs/bigarray

etex-files: $(BLURB)
all: libs
	sh ./check-stdlib-modules $(CSLDIR)

libs: $(FILES)

OCAMLDOC=$(if $(wildcard $(CSLDIR)/ocamldoc/ocamldoc.opt),\
  $(CSLDIR)/ocamldoc/ocamldoc.opt,\
  $(CSLDIR)/byterun/ocamlrun $(CSLDIR)/ocamldoc/ocamldoc)

$(INTF): interfaces
interfaces: $(MLIS)
	$(OCAMLDOC) -latex \
	-I $(CSLDIR)/utils \
	-I $(CSLDIR)/stdlib \
	-I $(CSLDIR)/parsing \
	-I $(CSLDIR)/typing \
	-I $(CSLDIR)/driver \
	-I $(CSLDIR)/bytecomp \
	-I $(CSLDIR)/otherlibs/bigarray \
	-I $(CSLDIR)/otherlibs/dynlink \
	-I $(CSLDIR)/otherlibs/graph \
	-I $(CSLDIR)/otherlibs/num \
	-I $(CSLDIR)/otherlibs/str \
	-I $(CSLDIR)/otherlibs/systhreads \
	-I $(CSLDIR)/otherlibs/unix \
	$(MLIS) \
	-sepfiles \
	-latextitle "6,subsection*" \
	-latextitle "7,subsubsection*" \
	-latex-type-prefix "TYP" \
	-latex-module-prefix "" \
	-latex-module-type-prefix "" \
	-latex-value-prefix ""
	mv -f Arith_status.tex Arithstatus.tex
	mv -f Big_int.tex Bigint.tex
	mv -f Ast_helper.tex Asthelper.tex
	mv -f Ast_mapper.tex Astmapper.tex

clean:
	rm -f $(FILES)


.SUFFIXES:
.SUFFIXES: .tex .etex .mli

.etex.tex: $(TEXQUOTE)
	@$(TEXQUOTE) < $*.etex > $*.texquote_error.tex\
	&& cp $*.texquote_error.tex $*.tex\
	|| printf "Failure when generating %s\n" $*.tex


.mli.tex: $(FORMAT)
	$(FORMAT) $< > $*.tex < $<