Debian Codegraph @

manual/src/html_processing/Makefile

raw symbols SCIP
1 ROOTDIR = ../../..
2 include $(ROOTDIR)/Makefile.config_if_required
3
4 DUNE_CMD := $(if $(wildcard dune/dune.exe),dune/dune.exe,dune)
5 DUNE ?= $(DUNE_CMD)
6
7 DEBUG ?= 0
8 ifeq ($(DEBUG), 1)
9 DBG=
10 else
11 DBG=quiet
12 endif
13
14 VERSION := $(OCAML_VERSION_MAJOR).$(OCAML_VERSION_MINOR)
15
16 WEBDIR = ../webman
17 WEBDIRMAN = $(WEBDIR)/$(VERSION)
18 WEBDIRAPI = $(WEBDIRMAN)/api
19 WEBDIRCOMP = $(WEBDIRAPI)/compilerlibref
20
21 # The "all" target generates the Web Manual in the directories
22 # ../webman/manual, ../webman/api, and ../webman/api/compilerlibref
23 all: css js img
24 $(DUNE) exec --root=. src/process_manual.exe $(DBG)
25 $(DUNE) exec --root=. src/process_api.exe overwrite $(DBG)
26 $(DUNE) exec --root=. src/process_api.exe compiler overwrite $(DBG)
27
28 $(WEBDIR)/%:
29 mkdir -p $@
30
31 $(WEBDIRMAN)/manual.css: scss/_common.scss scss/manual.scss | $(WEBDIRMAN)
32 sass scss/manual.scss > $(WEBDIRMAN)/manual.css
33
34 $(WEBDIRAPI)/style.css: scss/_common.scss scss/style.scss | $(WEBDIRAPI) $(WEBDIRCOMP)
35 sass scss/style.scss > $(WEBDIRAPI)/style.css
36 cp $(WEBDIRAPI)/style.css $(WEBDIRCOMP)/style.css
37
38 css: $(WEBDIRMAN)/manual.css $(WEBDIRAPI)/style.css
39
40 # Just copy the JS files:
41 #
42 JS_FILES0 := scroll.js navigation.js
43 JS_FILES1 := $(JS_FILES0) search.js
44 JS_FILES := $(addprefix $(WEBDIRAPI)/, $(JS_FILES1)) $(addprefix $(WEBDIRCOMP)/, $(JS_FILES1)) $(addprefix $(WEBDIRMAN)/, $(JS_FILES0))
45
46 # There must be a more clever way
47 $(WEBDIRAPI)/%.js: js/%.js | $(WEBDIRAPI)
48 cp $< $@
49
50 $(WEBDIRMAN)/%.js: js/%.js | $(WEBDIRMAN)
51 cp $< $@
52
53 $(WEBDIRCOMP)/%.js: js/%.js | $(WEBDIRCOMP)
54 cp $< $@
55
56 js: $(JS_FILES)
57
58 CURL = curl -s
59 # download images for local use
60
61 $(WEBDIRCOMP)/%: $(WEBDIRAPI)/% | $(WEBDIRCOMP)
62 cp $< $@
63
64 $(WEBDIRMAN)/%: $(WEBDIRAPI)/% | $(WEBDIRMAN)
65 cp $< $@
66
67 LOGO := colour-logo.svg
68 $(WEBDIRAPI)/colour-logo.svg: | $(WEBDIRAPI) $(WEBDIRMAN) $(WEBDIRCOMP)
69 $(CURL) "https://raw.githubusercontent.com/ocaml/ocaml-logo/master/Colour/SVG/colour-logo.svg" > $(WEBDIRAPI)/$(LOGO)
70
71 ICON := favicon.ico
72 $(WEBDIRAPI)/favicon.ico: | $(WEBDIRAPI) $(WEBDIRMAN) $(WEBDIRCOMP)
73 $(CURL) "https://raw.githubusercontent.com/ocaml/ocaml-logo/master/Colour/Favicon/32x32.ico" > $(WEBDIRAPI)/$(ICON)
74
75 IMG_FILES0 := colour-logo.svg
76 IMG_FILES := $(addprefix $(WEBDIRAPI)/, $(IMG_FILES0)) $(addprefix $(WEBDIRCOMP)/, $(IMG_FILES0)) $(addprefix $(WEBDIRMAN)/, $(IMG_FILES0))
77
78 img: $(WEBDIRAPI)/favicon.ico $(WEBDIRCOMP)/favicon.ico $(IMG_FILES)
79
80 clean:
81 rm -rf $(WEBDIR) src/.merlin _build
82
83 .PHONY: distclean
84 distclean:: clean
85
86 distclean::
87 rm -f src/common.ml
88
89 distclean::
90 rm -rf .sass-cache
91
92 # We need Dune and Lambda Soup; Markup.ml and Uutf are dependencies
93 DUNE_TAG = 3.4.0
94 LAMBDASOUP_TAG = 500
95 MARKUP_TAG = 1.0.3
96 UUTF_TAG = v1.0.3
97 RE_TAG = 1.10.4
98 CAMLP_STREAMS_TAG = v5.0.1
99
100 # Duniverse rules - set-up dune and the dependencies in-tree for CI
101 duniverse: dune/dune.exe re markup.ml uutf lambdasoup camlp-streams
102
103 dune/dune.exe: dune
104 cd dune; ocaml bootstrap.ml
105
106 GIT_CHECKOUT = git -c advice.detachedHead=false checkout
107
108 dune:
109 git clone https://github.com/ocaml/dune.git -n -o upstream
110 cd dune; $(GIT_CHECKOUT) $(DUNE_TAG)
111
112 distclean::
113 rm -rf dune
114
115 re:
116 git clone https://github.com/ocaml/ocaml-re.git -n -o upstream
117 cd ocaml-re; $(GIT_CHECKOUT) $(RE_TAG)
118 sed -i.bak -e '/(libraries seq)/d' ocaml-re/lib/dune
119
120 distclean::
121 rm -rf ocaml-re
122
123 lambdasoup:
124 git clone https://github.com/dra27/lambdasoup.git -n -o dra27
125 cd lambdasoup; $(GIT_CHECKOUT) $(LAMBDASOUP_TAG)
126
127 distclean::
128 rm -rf lambdasoup
129
130 markup.ml:
131 git clone https://github.com/aantron/markup.ml.git -n -o upstream
132 cd markup.ml; $(GIT_CHECKOUT) $(MARKUP_TAG)
133
134 distclean::
135 rm -rf markup.ml
136
137 uutf:
138 git clone https://github.com/dbuenzli/uutf.git -n -o upstream
139 cd uutf; $(GIT_CHECKOUT) $(UUTF_TAG)
140 cd uutf; \
141 mv opam uutf.opam; \
142 echo '(lang dune 1.0)' > dune-project; \
143 echo '(name uutf)' >> dune-project; \
144 echo '(library (name uutf)(public_name uutf)(flags (:standard -w -3-27))(wrapped false))' > src/dune
145
146 distclean::
147 rm -rf uutf
148
149 camlp-streams:
150 git clone https://github.com/ocaml/camlp-streams.git -n -o upstream
151 cd camlp-streams; $(GIT_CHECKOUT) $(CAMLP_STREAMS_TAG)
152
153 distclean::
154 rm -rf camlp-streams
155
156 .PHONY: css js img duniverse