Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 319 lines (254 sloc) 11.546 kb
d863cc7 Frederic Ye [enhance] all: wip compilation
Aqua-Ye authored
1 #!/usr/bin/env make
fccc685 Initial open-source release
MLstate authored
2
3 # [ Warning ] don't use make to solve dependencies !!
4 #
5 # we rely on ocamlbuild which already handles them ; every rule should
6 # call it only once (no recursion)
7 #
2cac7a3 Frederic Ye [doc] README, Makefile: small update
Aqua-Ye authored
8 # More info in tools/build/Makefile.bld and tools/build/README
d863cc7 Frederic Ye [enhance] all: wip compilation
Aqua-Ye authored
9
10 .PHONY: default
bc046f3 Frederic Ye [enhance] Makefile: only compile node packages by default
Aqua-Ye authored
11 default: node
fccc685 Initial open-source release
MLstate authored
12
94ed07b Frederic Ye [enhance] build: moved config files in tools/build
Aqua-Ye authored
13 CONFIG_PATH = tools/build
14
15 include $(CONFIG_PATH)/config.make
fccc685 Initial open-source release
MLstate authored
16
1321ba9 On FreeBSD check and use gmake, use make elsewhere
Frédéric Perrin authored
17 MAKE ?= $_
6a0b86b Frederic Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBUILD...
Aqua-Ye authored
18 OCAMLBUILD_OPT ?= -j 6
fccc685 Initial open-source release
MLstate authored
19
e7282e7 [enhance] make: do not rebuild opa packages if the variable is set
Louis Gesbert authored
20 ifndef NO_REBUILD_OPA_PACKAGES
42668dc Frederic Ye [enhance] Makefile: packages-api only constructs node API
Aqua-Ye authored
21 OPAOPT += --rebuild
e7282e7 [enhance] make: do not rebuild opa packages if the variable is set
Louis Gesbert authored
22 endif
8a40e70 [feature] build: support for optional libraries, enabled libnattraversal...
Louis Gesbert authored
23
24 ifneq ($(HAS_CAMLIDL)$(HAS_LIBNATPMP)$(HAS_MINIUPNPC),111)
d863cc7 Frederic Ye [enhance] all: wip compilation
Aqua-Ye authored
25 DISABLED_LIBS = libnattraversal
8a40e70 [feature] build: support for optional libraries, enabled libnattraversal...
Louis Gesbert authored
26 endif
27
fccc685 Initial open-source release
MLstate authored
28 export
29
6d1dcea Frederic Ye [fix] Makefile: carefull with makefiles inclusion
Aqua-Ye authored
30 include tools/build/Makefile.bld
31
fccc685 Initial open-source release
MLstate authored
32 ##
33 ## STANDARD TARGETS
34 ##
35
bc046f3 Frederic Ye [enhance] Makefile: only compile node packages by default
Aqua-Ye authored
36 .PHONY: node
37 node: $(MYOCAMLBUILD)
38 $(OCAMLBUILD) $(call target-tools,$(ALL_TOOLS)) opa-node-packages.stamp
39 @$(call copy-tools,$(ALL_TOOLS))
40 $(MAKE) manpages
41
fccc685 Initial open-source release
MLstate authored
42 .PHONY: all
a54a2d4 Rudy Sicard [enhance] Makefile: manpages should be the first thing we build
OpaOnWindowsNow authored
43 all: $(MYOCAMLBUILD)
fea3afa Frederic Ye [fix] Makefile: all target should build both packages
Aqua-Ye authored
44 $(OCAMLBUILD) $(call target-tools,$(ALL_TOOLS)) opa-both-packages.stamp
fccc685 Initial open-source release
MLstate authored
45 @$(call copy-tools,$(ALL_TOOLS))
3e3c2e6 Jeremy Messenger [fix] Makefile: Use $(MAKE) instead of hardcore "make".
jlmess77 authored
46 $(MAKE) manpages
fccc685 Initial open-source release
MLstate authored
47
48 .PHONY: build
49 build: all
50
51 .PHONY: runtime-libs
52 runtime-libs: $(MYOCAMLBUILD)
53 $(OCAMLBUILD) runtime-libs.stamp
54
37c04ec [cleanup] Makefile,comments: tiny cleanup & fixes
Louis Gesbert authored
55 .PHONY: $(BUILD_DIR)/bin/opa
fccc685 Initial open-source release
MLstate authored
56 $(BUILD_DIR)/bin/opa: $(MYOCAMLBUILD)
bc046f3 Frederic Ye [enhance] Makefile: only compile node packages by default
Aqua-Ye authored
57 $(OCAMLBUILD) opa-node-packages.stamp $(target-tool-opa-bin)
fccc685 Initial open-source release
MLstate authored
58 @$(copy-tool-opa-bin)
78a5027 Frederic Ye [enhance] install: moving some indstall scripts to appropriate directori...
Aqua-Ye authored
59 @tools/utils/install.sh --quiet --dir $(realpath $(BUILD_DIR)) --ocaml-prefix $(OCAMLLIB)/../../..
fccc685 Initial open-source release
MLstate authored
60
61 .PHONY: opa
62 opa: $(BUILD_DIR)/bin/opa
63
d863cc7 Frederic Ye [enhance] all: wip compilation
Aqua-Ye authored
64 .PHONY: opa-flat-packages opa-node-packages opa-both-packages
4a6014e Quentin Bourgerie [enhance] build: install the both set of packages
BourgerieQuentin authored
65 opa-flat-packages: $(MYOCAMLBUILD)
662e95e Quentin Bourgerie [enhance] compiler, packages: Allows to have several backends (separated...
BourgerieQuentin authored
66 $(OCAMLBUILD) opa-packages.stamp
75a4f89 Quentin Bourgerie [enhance] build: Added rules to compile stdlib to nodejs backend
BourgerieQuentin authored
67 opa-node-packages: $(MYOCAMLBUILD)
68 $(OCAMLBUILD) opa-node-packages.stamp
4a6014e Quentin Bourgerie [enhance] build: install the both set of packages
BourgerieQuentin authored
69 opa-both-packages: $(MYOCAMLBUILD)
70 $(OCAMLBUILD) opa-both-packages.stamp
fccc685 Initial open-source release
MLstate authored
71
56f5352 Frederic Ye [enhance] Makefile: missing .PHONY
Aqua-Ye authored
72 .PHONY: stdlib stdlib-flat stdlib-node
4a6014e Quentin Bourgerie [enhance] build: install the both set of packages
BourgerieQuentin authored
73 stdlib: opa-both-packages
74 stdlib-flat: opa-flat-packages
75a4f89 Quentin Bourgerie [enhance] build: Added rules to compile stdlib to nodejs backend
BourgerieQuentin authored
75 stdlib-node: opa-node-packages
fccc685 Initial open-source release
MLstate authored
76
4f1de8b Frederic Ye [enhance] Makefile: reduced the number of DISTRIB_TOOLS
Aqua-Ye authored
77 DISTRIB_TOOLS = opa-bin opa-plugin-builder-bin opa-plugin-browser-bin bslServerLib.ml opa-cloud # opa-db-server opa-db-tool opatop opa-translate
fccc685 Initial open-source release
MLstate authored
78
fcef231 Cédric Soulas [enhance] Compile: Makefile improved for opa tools. Built them before in...
cedricss authored
79 OPA_TOOLS = opa-create
80
fccc685 Initial open-source release
MLstate authored
81 .PHONY: distrib
82 distrib: $(MYOCAMLBUILD)
bc046f3 Frederic Ye [enhance] Makefile: only compile node packages by default
Aqua-Ye authored
83 $(OCAMLBUILD) $(call target-tools,$(DISTRIB_TOOLS)) opa-node-packages.stamp
84 @$(call copy-tools,$(DISTRIB_TOOLS))
acce4f2 Frederic Ye [fix] Makefile: fix opa-plugin-browser and opa-plugin-builder manpages f...
Aqua-Ye authored
85 @tools/utils/install.sh --quiet --dir $(realpath $(BUILD_DIR)) --ocaml-prefix $(OCAMLLIB)/../../.. --prefix $(realpath $(BUILD_DIR))
2f95684 Frederic Ye [enhance] manoages: better manpages for opa-plugin-browser, opa-plugin-b...
Aqua-Ye authored
86 $(MAKE) manpages
bc046f3 Frederic Ye [enhance] Makefile: only compile node packages by default
Aqua-Ye authored
87
88 .PHONY: distrib-all
89 distrib-all: $(MYOCAMLBUILD)
0d63254 Frederic Ye [fix] Makefile: build both packages for distrib
Aqua-Ye authored
90 $(OCAMLBUILD) $(call target-tools,$(DISTRIB_TOOLS)) opa-both-packages.stamp
fccc685 Initial open-source release
MLstate authored
91 @$(call copy-tools,$(DISTRIB_TOOLS))
2f95684 Frederic Ye [enhance] manoages: better manpages for opa-plugin-browser, opa-plugin-b...
Aqua-Ye authored
92 $(MAKE) manpages
fccc685 Initial open-source release
MLstate authored
93
6a0b86b Frederic Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBUILD...
Aqua-Ye authored
94 ##
95 ## MANPAGES
96 ##
97
8c3019b [enhance] manpages: added target install-man to install manpages by defa...
Mathieu Baudet authored
98 .PHONY: manpages
5baea24 [fix] manpages: when called from the main Makefile, do not assume 'insta...
Mathieu Baudet authored
99 manpages: $(MYOCAMLBUILD)
44fea0f Frederic Ye [enhance] Makefile: use NO_MANPAGES on manpages target ans not for all t...
Aqua-Ye authored
100 ifndef NO_MANPAGES
d863cc7 Frederic Ye [enhance] all: wip compilation
Aqua-Ye authored
101 $(MAKE) -C tools/manpages OCAMLBUILD="$(OCAMLBUILD)" BLDDIR=../../$(BUILD_DIR)
44fea0f Frederic Ye [enhance] Makefile: use NO_MANPAGES on manpages target ans not for all t...
Aqua-Ye authored
102 else
103 @echo "Not building manpages"
104 endif
8c3019b [enhance] manpages: added target install-man to install manpages by defa...
Mathieu Baudet authored
105
6a0b86b Frederic Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBUILD...
Aqua-Ye authored
106 ##
107 ## OPA-CREATE
108 ##
109
110 target-tool-opa-create = tools/opa-create/src/opa-create.exe
111
2b39809 Cédric Soulas [feature] opa-create: new tool to generate application skeletons
cedricss authored
112 .PHONY: opa-create
113 opa-create: $(MYOCAMLBUILD)
6a0b86b Frederic Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBUILD...
Aqua-Ye authored
114 $(OCAMLBUILD) $(target-tool-opa-create)
115 @mkdir -p $(BUILD_DIR)/bin
116 $(INSTALL) $(BUILD_DIR)/$(target-tool-opa-create) $(BUILD_DIR)/bin/opa-create
fb0b7f9 Frederic Ye [enhance] Makefile: also give 755 rights to opa-create on build
Aqua-Ye authored
117 @chmod 755 $(BUILD_DIR)/bin/opa-create
6a0b86b Frederic Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBUILD...
Aqua-Ye authored
118
2b39809 Cédric Soulas [feature] opa-create: new tool to generate application skeletons
cedricss authored
119 .PHONY: install-opa-create
120 install-opa-create:
6a0b86b Frederic Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBUILD...
Aqua-Ye authored
121 @mkdir -p $(PREFIX)/bin
122 $(INSTALL) $(BUILD_DIR)/bin/opa-create $(INSTALL_DIR)/bin/opa-create
5a7402b Frederic Ye [enhance] Makefile: change opa-create with 755 rights after install
Aqua-Ye authored
123 @chmod 755 $(INSTALL_DIR)/bin/opa-create
2b39809 Cédric Soulas [feature] opa-create: new tool to generate application skeletons
cedricss authored
124
fccc685 Initial open-source release
MLstate authored
125 ##
126 ## INSTALLATION
127 ##
128
129 .PHONY: install*
130
894a751 Pierre Bourdon Support make DESTDIR=... install for easier packaging
delroth authored
131 STDLIB_DIR = $(INSTALL_DIR)/lib/opa/stdlib
662e95e Quentin Bourgerie [enhance] compiler, packages: Allows to have several backends (separated...
BourgerieQuentin authored
132
133 FLAT_STDLIB_SUFFIX_DIR=stdlib.qmlflat
134 STDLIB_FLAT_DIR=$(STDLIB_DIR)/$(FLAT_STDLIB_SUFFIX_DIR)
135 BUILD_FLAT_DIR=$(BUILD_DIR)/$(FLAT_STDLIB_SUFFIX_DIR)
fccc685 Initial open-source release
MLstate authored
136 define install-package
662e95e Quentin Bourgerie [enhance] compiler, packages: Allows to have several backends (separated...
BourgerieQuentin authored
137 @printf "Installing into $(STDLIB_FLAT_DIR)/$*.opx\r"
138 @mkdir -p "$(STDLIB_FLAT_DIR)/$*.opx/_build"
139 @find "$(BUILD_FLAT_DIR)/$*.opx" -maxdepth 1 ! -type d -exec $(INSTALL) {} "$(STDLIB_FLAT_DIR)/$*.opx/" \;
140 @$(INSTALL) $(BUILD_FLAT_DIR)/$*.opx/_build/*.a "$(STDLIB_FLAT_DIR)/$*.opx/_build/"
141 @$(INSTALL) $(BUILD_FLAT_DIR)/$*.opx/_build/*.cmi "$(STDLIB_FLAT_DIR)/$*.opx/_build/"
142 @$(INSTALL) $(BUILD_FLAT_DIR)/$*.opx/_build/*.cmxa "$(STDLIB_FLAT_DIR)/$*.opx/_build/"
143 endef
144
145 NODE_STDLIB_SUFFIX_DIR=stdlib.qmljs
146 STDLIB_NODE_DIR=$(STDLIB_DIR)/$(NODE_STDLIB_SUFFIX_DIR)
147 BUILD_NODE_DIR=$(BUILD_DIR)/$(NODE_STDLIB_SUFFIX_DIR)
148 define install-node-package
149 @printf "Installing into $(STDLIB_NODE_DIR)/$*.opx\r"
150 @mkdir -p "$(STDLIB_NODE_DIR)/$*.opx/_build"
151 @find "$(BUILD_NODE_DIR)/$*.opx" -maxdepth 1 ! -type d -exec $(INSTALL) {} "$(STDLIB_NODE_DIR)/$*.opx/" \;
152 @$(INSTALL) $(BUILD_NODE_DIR)/$*.opx/*.js "$(STDLIB_NODE_DIR)/$*.opx/"
fccc685 Initial open-source release
MLstate authored
153 endef
154
2fae9ee Frederic Ye [fix] Makefile: plugins were not install because of wrong path
Aqua-Ye authored
155 PLUGINS_DIR=lib/plugins
2f55085 Rudy Sicard [fix] Makefile: install plugins
OpaOnWindowsNow authored
156 define install-plugin
157 @printf "Installing into $(STDLIB_DIR)/$*.opp^[[K\r"
032f272 Arthur Azevedo de Amorim [enhance] install: raw js files.
arthuraa authored
158 @mkdir -p "$(STDLIB_DIR)/$*.opp"
2fae9ee Frederic Ye [fix] Makefile: plugins were not install because of wrong path
Aqua-Ye authored
159 @$(INSTALL) $(BUILD_DIR)/$(PLUGINS_DIR)/$*.opp/*.bypass "$(STDLIB_DIR)/$*.opp/";
a367cd2 Arthur Azevedo de Amorim [enhance] bslregister: output nodejs package.
arthuraa authored
160 @$(INSTALL) $(BUILD_DIR)/$(PLUGINS_DIR)/$*.opp/*NodeJsPackage.js "$(STDLIB_DIR)/$*.opp/";
2dbccef Arthur Azevedo de Amorim [enhance] qml2js: output package.json for plugins.
arthuraa authored
161 @$(INSTALL) $(BUILD_DIR)/$(PLUGINS_DIR)/$*.opp/package.json "$(STDLIB_DIR)/$*.opp/";
cb3418e Arthur Azevedo de Amorim [fix] build: plugin install command.
arthuraa authored
162 @$(if $(wildcard $(BUILD_DIR)/$(PLUGINS_DIR)/$*.opp/*MLRuntime.*), $(INSTALL) $(BUILD_DIR)/$(PLUGINS_DIR)/$*.opp/*MLRuntime.* "$(STDLIB_DIR)/$*.opp/")
2f55085 Rudy Sicard [fix] Makefile: install plugins
OpaOnWindowsNow authored
163 endef
164
165
d863cc7 Frederic Ye [enhance] all: wip compilation
Aqua-Ye authored
166 # List all packages and plugins in stdlib
167 OPA_PACKAGES := $(shell cd lib/stdlib && ./all_packages.sh)
168 OPA_PLUGINS := $(shell cd lib/stdlib && ./all_plugins.sh)
fccc685 Initial open-source release
MLstate authored
169
170 # Rules installing everything that has been compiled
171 #
172 # This doesn't rely on install rules generated by Makefile.bld ;
173 # instead it assumes that what you want to install has been properly
8c3019b [enhance] manpages: added target install-man to install manpages by defa...
Mathieu Baudet authored
174 # put in $(BUILD_DIR)/{bin,lib/opa,share/opa,share/man}.
fccc685 Initial open-source release
MLstate authored
175 #
176 # This is the case of tools (because of Makefile.bld),
177 # and of opa runtime libs (because build rules copy them
178 # to $(BUILD_DIR)/lib/opa/static).
179 # This doesn't install the other libs though, use target install-libs
180 # for that
181
182 install-packageopt-%:
662e95e Quentin Bourgerie [enhance] compiler, packages: Allows to have several backends (separated...
BourgerieQuentin authored
183 $(if $(wildcard $(BUILD_FLAT_DIR)/$*.opx/_build/*),$(install-package))
184
185 install-node-packageopt-%:
186 $(if $(wildcard $(BUILD_NODE_DIR)/$*.opx/*.js),$(install-node-package))
fccc685 Initial open-source release
MLstate authored
187
188 install-package-%:
189 $(install-package)
190
662e95e Quentin Bourgerie [enhance] compiler, packages: Allows to have several backends (separated...
BourgerieQuentin authored
191 install-node-package-%:
192 $(install-node-package)
193
fccc685 Initial open-source release
MLstate authored
194 install-packages: $(addprefix install-packageopt-,$(OPA_PACKAGES))
662e95e Quentin Bourgerie [enhance] compiler, packages: Allows to have several backends (separated...
BourgerieQuentin authored
195 @printf "Installation to $(STDLIB_FLAT_DIR) done.\n"
196
197 install-node-packages: $(addprefix install-node-packageopt-,$(OPA_PACKAGES))
198 @printf "Installation to $(STDLIB_NODE_DIR) done.\n"
fccc685 Initial open-source release
MLstate authored
199
200 install-all-packages: $(addprefix install-package-,$(OPA_PACKAGES))
662e95e Quentin Bourgerie [enhance] compiler, packages: Allows to have several backends (separated...
BourgerieQuentin authored
201 @printf "Installation to $(STDLIB_FLAT_DIR) done.\n"
fccc685 Initial open-source release
MLstate authored
202
2f55085 Rudy Sicard [fix] Makefile: install plugins
OpaOnWindowsNow authored
203 install-pluginopt-%:
2fae9ee Frederic Ye [fix] Makefile: plugins were not install because of wrong path
Aqua-Ye authored
204 $(if $(wildcard $(BUILD_DIR)/$(PLUGINS_DIR)/$*.opp/),$(install-plugin))
2f55085 Rudy Sicard [fix] Makefile: install plugins
OpaOnWindowsNow authored
205
206 install-plugin-%:
207 $(install-plugin)
208
209 install-plugins: $(addprefix install-pluginopt-,$(OPA_PLUGINS))
210 @printf "Installation to $(STDLIB_DIR) done.\n"
211
212 install-all-plugins: $(addprefix install-plugin-,$(OPA_PLUGINS))
213 @printf "Installation to $(STDLIB_DIR) done.\n"
214
215
216
fcef231 Cédric Soulas [enhance] Compile: Makefile improved for opa tools. Built them before in...
cedricss authored
217 install-bin:
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
218 @printf "Installing into $(INSTALL_DIR)/bin\r"
894a751 Pierre Bourdon Support make DESTDIR=... install for easier packaging
delroth authored
219 @mkdir -p $(INSTALL_DIR)/bin
220 @$(if $(wildcard $(BUILD_DIR)/bin/*),$(INSTALL) -r $(BUILD_DIR)/bin/* $(INSTALL_DIR)/bin)
78a5027 Frederic Ye [enhance] install: moving some indstall scripts to appropriate directori...
Aqua-Ye authored
221 @tools/utils/install.sh --quiet --dir $(INSTALL_DIR) --ocamllib $(OCAMLLIB) --ocamlopt $(OCAMLOPT)
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
222 @printf "Installation to $(INSTALL_DIR)/bin done.\n"
fccc685 Initial open-source release
MLstate authored
223
224 install-lib:
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
225 @printf "Installing into $(INSTALL_DIR)/lib/opa\r"
8b622a8 Frederic Ye [fix] Makefile: quick-fix: manually remove missing cmi
Aqua-Ye authored
226 @rm -f $(BUILD_DIR)/lib/opa/static/opabslMLRuntime.cmi
894a751 Pierre Bourdon Support make DESTDIR=... install for easier packaging
delroth authored
227 @mkdir -p $(INSTALL_DIR)/lib/opa
228 @$(if $(wildcard $(BUILD_DIR)/lib/opa/*),$(INSTALL) -r $(BUILD_DIR)/lib/opa/* $(INSTALL_DIR)/lib/opa/)
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
229 @printf "Installation to $(INSTALL_DIR)/lib/opa done.\n"
fccc685 Initial open-source release
MLstate authored
230
231 install-share:
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
232 @printf "Installing into $(INSTALL_DIR)/share/opa\r"
894a751 Pierre Bourdon Support make DESTDIR=... install for easier packaging
delroth authored
233 @mkdir -p $(INSTALL_DIR)/share/opa
234 @$(if $(wildcard $(BUILD_DIR)/share/opa/*),$(INSTALL) -r $(BUILD_DIR)/share/opa/* $(INSTALL_DIR)/share/opa/)
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
235 @printf "Installation to $(INSTALL_DIR)/share/opa done.\n"
fccc685 Initial open-source release
MLstate authored
236
8c3019b [enhance] manpages: added target install-man to install manpages by defa...
Mathieu Baudet authored
237 install-man:
238 @printf "Installing into $(INSTALL_DIR)/share/man\r"
239 @if [ -d $(BUILD_DIR)/man/man1 ]; then \
240 mkdir -p $(INSTALL_DIR)/share/man/man1; \
241 fi
f16cfd8 Frederic Ye [enhance] Makefile: install man from BUILD_DIR only if present
Aqua-Ye authored
242 @$(if $(wildcard $(BUILD_DIR)/man/man1/*.1.gz),$(INSTALL) -r $(BUILD_DIR)/man/man1/*.1.gz $(INSTALL_DIR)/share/man/man1)
8c3019b [enhance] manpages: added target install-man to install manpages by defa...
Mathieu Baudet authored
243 @printf "Installation to $(INSTALL_DIR)/share/man done.\n"
244
a3114c0 Frederic Ye [fix] Makefile: build opa-create on install
Aqua-Ye authored
245 install: install-lib install-share install-plugins install-packages install-node-packages install-man $(OPA_TOOLS) install-bin
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
246 @printf "Installation into $(INSTALL_DIR) done.\n"
fccc685 Initial open-source release
MLstate authored
247
a3114c0 Frederic Ye [fix] Makefile: build opa-create on install
Aqua-Ye authored
248 install-node: install-lib install-share install-plugins install-node-packages install-man $(OPA_TOOLS) install-bin
465b551 Frederic Ye [enhance] build: added option to not install ocaml
Aqua-Ye authored
249 @printf "Installation into $(INSTALL_DIR) done.\n"
250
fccc685 Initial open-source release
MLstate authored
251 .PHONY: uninstall
252 uninstall:
894a751 Pierre Bourdon Support make DESTDIR=... install for easier packaging
delroth authored
253 rm -rf $(INSTALL_DIR)/lib/opa
254 @[ ! -d $(INSTALL_DIR)/lib ] || [ -n "`ls -A $(INSTALL_DIR)/lib`" ] || rmdir $(INSTALL_DIR)/lib
255 rm -rf $(INSTALL_DIR)/share/opa
256 rm -rf $(INSTALL_DIR)/share/doc/opa
b87dce7 Frederic Ye [fix] Makefile: comment position
Aqua-Ye authored
257 # TODO: remove all installed opa manpages
258 # rm -rf $(INSTALL_DIR)/share/man/man1/opa*
894a751 Pierre Bourdon Support make DESTDIR=... install for easier packaging
delroth authored
259 @[ ! -d $(INSTALL_DIR)/share ] || [ -n "`ls -A $(INSTALL_DIR)/share`" ] || rmdir $(INSTALL_DIR)/share
1b2772b [fix] Makefile: zealous uninstall
Louis Gesbert authored
260 $(foreach file,$(wildcard $(BUILD_DIR)/bin/*),rm -f $(INSTALL_DIR)/bin/$(notdir $(file));)
78a5027 Frederic Ye [enhance] install: moving some indstall scripts to appropriate directori...
Aqua-Ye authored
261 @tools/utils/install.sh --uninstall --dir $(INSTALL_DIR)
894a751 Pierre Bourdon Support make DESTDIR=... install for easier packaging
delroth authored
262 @[ ! -d $(INSTALL_DIR)/bin ] || [ -n "`ls -A $(INSTALL_DIR)/bin`" ] || rmdir $(INSTALL_DIR)/bin
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
263 @printf "Uninstall done.\n"
fccc685 Initial open-source release
MLstate authored
264
265 # Install our ocamlbuild-generation engine
266 install-bld:
894a751 Pierre Bourdon Support make DESTDIR=... install for easier packaging
delroth authored
267 @mkdir -p $(INSTALL_DIR)/bin
22b433a Don't assume that bash is in /bin
Frédéric Perrin authored
268 @echo "#!/usr/bin/env bash" > $(INSTALL_DIR)/bin/bld
269 @echo "set -e" >> $(INSTALL_DIR)/bin/bld
270 @echo "set -u" >> $(INSTALL_DIR)/bin/bld
894a751 Pierre Bourdon Support make DESTDIR=... install for easier packaging
delroth authored
271 @chmod 755 $(INSTALL_DIR)/bin/bld
272 @echo "BLDDIR=$(PREFIX)/share/opa/bld $(PREFIX)/share/opa/bld/gen_myocamlbuild.sh" >> $(INSTALL_DIR)/bin/bld
538524f Frederic Ye [enhance] ocamlbuild: ability to set OCAMLBUILD_OPT
Aqua-Ye authored
273 @echo "_build/myocamlbuild -no-plugin $(OCAMLBUILD_OPT) \"\$$@\"" >> $(INSTALL_DIR)/bin/bld
894a751 Pierre Bourdon Support make DESTDIR=... install for easier packaging
delroth authored
274 @mkdir -p $(INSTALL_DIR)/share/opa/bld
6790c3f Frederic Ye [fix] Makefile: fix path for gen_myocamlbuild*.sh
Aqua-Ye authored
275 @$(INSTALL) tools/build/gen_myocamlbuild.sh tools/build/myocamlbuild_*fix.ml $(CONFIG_PATH)/config.sh $(CONFIG_PATH)/config.mli $(CONFIG_PATH)/config.ml\
894a751 Pierre Bourdon Support make DESTDIR=... install for easier packaging
delroth authored
276 $(INSTALL_DIR)/share/opa/bld
fccc685 Initial open-source release
MLstate authored
277
278 # Install an opa wrapper with different stdlib and options (for some backwards-compatibility)
279 install-qmlflat: # depends on opabsl_for_compiler, but we don't want to run ocamlbuild twice
894a751 Pierre Bourdon Support make DESTDIR=... install for easier packaging
delroth authored
280 @mkdir -p $(INSTALL_DIR)/bin $(INSTALL_DIR)/share/opa/mlstatebsl
2fae9ee Frederic Ye [fix] Makefile: plugins were not install because of wrong path
Aqua-Ye authored
281 @$(INSTALL) $(BUILD_DIR)/$(PLUGINS_DIR)/opabsl.opp/lib/plugins/opabsl/mlstatebsl/opabsl_*.opa $(INSTALL_DIR)/share/opa/mlstatebsl
22b433a Don't assume that bash is in /bin
Frédéric Perrin authored
282 @echo "#!/usr/bin/env bash" > $(INSTALL_DIR)/bin/qmlflat
283 @echo "set -e" >> $(INSTALL_DIR)/bin/qmlflat
284 @echo "set -u" >> $(INSTALL_DIR)/bin/qmlflat
894a751 Pierre Bourdon Support make DESTDIR=... install for easier packaging
delroth authored
285 @chmod 755 $(INSTALL_DIR)/bin/qmlflat
a1fe4fa Quentin Bourgerie [fix] qmlflat: Add mlstatebsl to qmlflat
BourgerieQuentin authored
286 @echo 'exec opa --parser classic --no-stdlib --no-server --no-cps --no-closure --no-ei --no-constant-sharing --no-undot --separated off --value-restriction disabled --no-warn duplicateL0 --no-warn typer.warncoerce --no-warn unused --no-discard-of-unused-stdlib --no-warn pattern $(STDLIB_DIR)/opabsl.opp $$(if ! grep -qE "(^| )--no-stdlib( |$$)" <<<"$$*"; then echo $(INSTALL_DIR)/share/opa/mlstatebsl/*.opa; fi) "$$@"' \
894a751 Pierre Bourdon Support make DESTDIR=... install for easier packaging
delroth authored
287 >> $(INSTALL_DIR)/bin/qmlflat
fccc685 Initial open-source release
MLstate authored
288
289 # installs some dev tools on top of the normal install; these should not change often
d863cc7 Frederic Ye [enhance] all: wip compilation
Aqua-Ye authored
290 install-all: install install-bld install-qmlflat tools/maxmem
33e6550 Frederic Ye [fix] Makefile: fix install-all and install-qmlflat rules
Aqua-Ye authored
291 @$(INSTALL) tools/platform_helper.sh $(INSTALL_DIR)/bin/
d863cc7 Frederic Ye [enhance] all: wip compilation
Aqua-Ye authored
292 @$(INSTALL) tools/maxmem $(INSTALL_DIR)/bin/
293 @rm tools/maxmem
294 @$(INSTALL) tools/plotmem $(INSTALL_DIR)/bin/
fccc685 Initial open-source release
MLstate authored
295
296 ##
297 ## DOCUMENTATION
298 ##
299 # (in this section, multiple calls to ocamlbuild are tolerated)
300
301 .PHONY: doc.jsbsl
302 doc.jsbsl: $(MYOCAMLBUILD)
303 $(OCAMLBUILD) $@/index.html
304
305 # this rules provides the doc.html target (from Makefile.bld)
306 # the sed are just there to help sorting by filename-within-directory
307 .PHONY: doc.odocl
308 doc.odocl:
309 echo $(foreach lib,$(ALL_LIBS),$(lib-cmi-$(lib):%.cmi=%)) \
310 | sed 's# \+#\n#g' \
311 | sed 's#\(.*\)/\([^/]*\)#\1 \2#' \
312 | sort -k 2 -u \
313 | sed 's#\(.*\) \([^ ]*\)#\1/\2#' \
314 >$@
315
316 .PHONY: packages-api
317 packages-api: $(MYOCAMLBUILD)
42668dc Frederic Ye [enhance] Makefile: packages-api only constructs node API
Aqua-Ye authored
318 OPAOPT="$(OPAOPT) --api --parser classic" $(OCAMLBUILD) opa-node-packages.stamp
Something went wrong with that request. Please try again.