Skip to content

HTTPS clone URL

Subversion checkout URL

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