Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 304 lines (241 sloc) 10.739 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
11f1a77 @Aqua-Ye [fix] Makefile: re-enable opatop
Aqua-Ye authored
72 DISTRIB_TOOLS = opa-bin opa-plugin-builder-bin opa-plugin-browser-bin bslServerLib.ml opa-db-server opa-db-tool opa-cloud 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))
33e6901 @Aqua-Ye [fix] Makefile: re-include opa-create
Aqua-Ye authored
80 $(MAKE) $(OPA_TOOLS)
fccc685 Initial open-source release
MLstate authored
81
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBU…
Aqua-Ye authored
82 ##
83 ## MANPAGES
84 ##
85
8c3019b [enhance] manpages: added target install-man to install manpages by d…
Mathieu Baudet authored
86 .PHONY: manpages
5baea24 [fix] manpages: when called from the main Makefile, do not assume 'in…
Mathieu Baudet authored
87 manpages: $(MYOCAMLBUILD)
44fea0f @Aqua-Ye [enhance] Makefile: use NO_MANPAGES on manpages target ans not for al…
Aqua-Ye authored
88 ifndef NO_MANPAGES
d863cc7 @Aqua-Ye [enhance] all: wip compilation
Aqua-Ye authored
89 $(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
90 else
91 @echo "Not building manpages"
92 endif
8c3019b [enhance] manpages: added target install-man to install manpages by d…
Mathieu Baudet authored
93
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBU…
Aqua-Ye authored
94 ##
95 ## OPA-CREATE
96 ##
97
98 target-tool-opa-create = tools/opa-create/src/opa-create.exe
99
2b39809 @cedricss [feature] opa-create: new tool to generate application skeletons
cedricss authored
100 .PHONY: opa-create
101 opa-create: $(MYOCAMLBUILD)
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBU…
Aqua-Ye authored
102 $(OCAMLBUILD) $(target-tool-opa-create)
103 @mkdir -p $(BUILD_DIR)/bin
104 $(INSTALL) $(BUILD_DIR)/$(target-tool-opa-create) $(BUILD_DIR)/bin/opa-create
105
2b39809 @cedricss [feature] opa-create: new tool to generate application skeletons
cedricss authored
106 .PHONY: install-opa-create
107 install-opa-create:
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBU…
Aqua-Ye authored
108 @mkdir -p $(PREFIX)/bin
109 $(INSTALL) $(BUILD_DIR)/bin/opa-create $(INSTALL_DIR)/bin/opa-create
2b39809 @cedricss [feature] opa-create: new tool to generate application skeletons
cedricss authored
110
fccc685 Initial open-source release
MLstate authored
111 ##
112 ## INSTALLATION
113 ##
114
115 .PHONY: install*
116
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
117 STDLIB_DIR = $(INSTALL_DIR)/lib/opa/stdlib
662e95e @BourgerieQuentin [enhance] compiler, packages: Allows to have several backends (separa…
BourgerieQuentin authored
118
119 FLAT_STDLIB_SUFFIX_DIR=stdlib.qmlflat
120 STDLIB_FLAT_DIR=$(STDLIB_DIR)/$(FLAT_STDLIB_SUFFIX_DIR)
121 BUILD_FLAT_DIR=$(BUILD_DIR)/$(FLAT_STDLIB_SUFFIX_DIR)
fccc685 Initial open-source release
MLstate authored
122 define install-package
662e95e @BourgerieQuentin [enhance] compiler, packages: Allows to have several backends (separa…
BourgerieQuentin authored
123 @printf "Installing into $(STDLIB_FLAT_DIR)/$*.opx\r"
124 @mkdir -p "$(STDLIB_FLAT_DIR)/$*.opx/_build"
125 @find "$(BUILD_FLAT_DIR)/$*.opx" -maxdepth 1 ! -type d -exec $(INSTALL) {} "$(STDLIB_FLAT_DIR)/$*.opx/" \;
126 @$(INSTALL) $(BUILD_FLAT_DIR)/$*.opx/_build/*.a "$(STDLIB_FLAT_DIR)/$*.opx/_build/"
127 @$(INSTALL) $(BUILD_FLAT_DIR)/$*.opx/_build/*.cmi "$(STDLIB_FLAT_DIR)/$*.opx/_build/"
128 @$(INSTALL) $(BUILD_FLAT_DIR)/$*.opx/_build/*.cmxa "$(STDLIB_FLAT_DIR)/$*.opx/_build/"
129 endef
130
131 NODE_STDLIB_SUFFIX_DIR=stdlib.qmljs
132 STDLIB_NODE_DIR=$(STDLIB_DIR)/$(NODE_STDLIB_SUFFIX_DIR)
133 BUILD_NODE_DIR=$(BUILD_DIR)/$(NODE_STDLIB_SUFFIX_DIR)
134 define install-node-package
135 @printf "Installing into $(STDLIB_NODE_DIR)/$*.opx\r"
136 @mkdir -p "$(STDLIB_NODE_DIR)/$*.opx/_build"
137 @find "$(BUILD_NODE_DIR)/$*.opx" -maxdepth 1 ! -type d -exec $(INSTALL) {} "$(STDLIB_NODE_DIR)/$*.opx/" \;
138 @$(INSTALL) $(BUILD_NODE_DIR)/$*.opx/*.js "$(STDLIB_NODE_DIR)/$*.opx/"
fccc685 Initial open-source release
MLstate authored
139 endef
140
2fae9ee @Aqua-Ye [fix] Makefile: plugins were not install because of wrong path
Aqua-Ye authored
141 PLUGINS_DIR=lib/plugins
2f55085 @OpaOnWindowsNow [fix] Makefile: install plugins
OpaOnWindowsNow authored
142 define install-plugin
143 @printf "Installing into $(STDLIB_DIR)/$*.opp^[[K\r"
032f272 @arthuraa [enhance] install: raw js files.
arthuraa authored
144 @mkdir -p "$(STDLIB_DIR)/$*.opp"
2fae9ee @Aqua-Ye [fix] Makefile: plugins were not install because of wrong path
Aqua-Ye authored
145 @$(INSTALL) $(BUILD_DIR)/$(PLUGINS_DIR)/$*.opp/*.bypass "$(STDLIB_DIR)/$*.opp/";
146 @for f in `find "$(BUILD_DIR)/$(PLUGINS_DIR)/$*.opp" -mindepth 2 -iname \*.\*js`; do \
032f272 @arthuraa [enhance] install: raw js files.
arthuraa authored
147 nf=`basename $$f | sed 's/[^_]*_\(.*\)/\1/'`; $(INSTALL) $$f "$(STDLIB_DIR)/$*.opp/$$nf"; done
2fae9ee @Aqua-Ye [fix] Makefile: plugins were not install because of wrong path
Aqua-Ye authored
148 @$(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
149 endef
150
151
d863cc7 @Aqua-Ye [enhance] all: wip compilation
Aqua-Ye authored
152 # List all packages and plugins in stdlib
153 OPA_PACKAGES := $(shell cd lib/stdlib && ./all_packages.sh)
154 OPA_PLUGINS := $(shell cd lib/stdlib && ./all_plugins.sh)
fccc685 Initial open-source release
MLstate authored
155
156 # Rules installing everything that has been compiled
157 #
158 # This doesn't rely on install rules generated by Makefile.bld ;
159 # 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
160 # put in $(BUILD_DIR)/{bin,lib/opa,share/opa,share/man}.
fccc685 Initial open-source release
MLstate authored
161 #
162 # This is the case of tools (because of Makefile.bld),
163 # and of opa runtime libs (because build rules copy them
164 # to $(BUILD_DIR)/lib/opa/static).
165 # This doesn't install the other libs though, use target install-libs
166 # for that
167
168 install-packageopt-%:
662e95e @BourgerieQuentin [enhance] compiler, packages: Allows to have several backends (separa…
BourgerieQuentin authored
169 $(if $(wildcard $(BUILD_FLAT_DIR)/$*.opx/_build/*),$(install-package))
170
171 install-node-packageopt-%:
172 $(if $(wildcard $(BUILD_NODE_DIR)/$*.opx/*.js),$(install-node-package))
fccc685 Initial open-source release
MLstate authored
173
174 install-package-%:
175 $(install-package)
176
662e95e @BourgerieQuentin [enhance] compiler, packages: Allows to have several backends (separa…
BourgerieQuentin authored
177 install-node-package-%:
178 $(install-node-package)
179
fccc685 Initial open-source release
MLstate authored
180 install-packages: $(addprefix install-packageopt-,$(OPA_PACKAGES))
662e95e @BourgerieQuentin [enhance] compiler, packages: Allows to have several backends (separa…
BourgerieQuentin authored
181 @printf "Installation to $(STDLIB_FLAT_DIR) done.\n"
182
183 install-node-packages: $(addprefix install-node-packageopt-,$(OPA_PACKAGES))
184 @printf "Installation to $(STDLIB_NODE_DIR) done.\n"
fccc685 Initial open-source release
MLstate authored
185
186 install-all-packages: $(addprefix install-package-,$(OPA_PACKAGES))
662e95e @BourgerieQuentin [enhance] compiler, packages: Allows to have several backends (separa…
BourgerieQuentin authored
187 @printf "Installation to $(STDLIB_FLAT_DIR) done.\n"
fccc685 Initial open-source release
MLstate authored
188
2f55085 @OpaOnWindowsNow [fix] Makefile: install plugins
OpaOnWindowsNow authored
189 install-pluginopt-%:
2fae9ee @Aqua-Ye [fix] Makefile: plugins were not install because of wrong path
Aqua-Ye authored
190 $(if $(wildcard $(BUILD_DIR)/$(PLUGINS_DIR)/$*.opp/),$(install-plugin))
2f55085 @OpaOnWindowsNow [fix] Makefile: install plugins
OpaOnWindowsNow authored
191
192 install-plugin-%:
193 $(install-plugin)
194
195 install-plugins: $(addprefix install-pluginopt-,$(OPA_PLUGINS))
196 @printf "Installation to $(STDLIB_DIR) done.\n"
197
198 install-all-plugins: $(addprefix install-plugin-,$(OPA_PLUGINS))
199 @printf "Installation to $(STDLIB_DIR) done.\n"
200
201
202
fcef231 @cedricss [enhance] Compile: Makefile improved for opa tools. Built them before…
cedricss authored
203 install-bin:
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
204 @printf "Installing into $(INSTALL_DIR)/bin\r"
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
205 @mkdir -p $(INSTALL_DIR)/bin
206 @$(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
207 @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
208 @printf "Installation to $(INSTALL_DIR)/bin done.\n"
fccc685 Initial open-source release
MLstate authored
209
210 install-lib:
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
211 @printf "Installing into $(INSTALL_DIR)/lib/opa\r"
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
212 @mkdir -p $(INSTALL_DIR)/lib/opa
213 @$(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
214 @printf "Installation to $(INSTALL_DIR)/lib/opa done.\n"
fccc685 Initial open-source release
MLstate authored
215
216 install-share:
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
217 @printf "Installing into $(INSTALL_DIR)/share/opa\r"
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
218 @mkdir -p $(INSTALL_DIR)/share/opa
219 @$(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
220 @printf "Installation to $(INSTALL_DIR)/share/opa done.\n"
fccc685 Initial open-source release
MLstate authored
221
8c3019b [enhance] manpages: added target install-man to install manpages by d…
Mathieu Baudet authored
222 install-man:
223 @printf "Installing into $(INSTALL_DIR)/share/man\r"
224 @if [ -d $(BUILD_DIR)/man/man1 ]; then \
225 mkdir -p $(INSTALL_DIR)/share/man/man1; \
226 $(INSTALL) -r $(BUILD_DIR)/man/man1/*.1 $(INSTALL_DIR)/share/man/man1; \
227 fi
228 @printf "Installation to $(INSTALL_DIR)/share/man done.\n"
229
4a6014e @BourgerieQuentin [enhance] build: install the both set of packages
BourgerieQuentin authored
230 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
231 @printf "Installation into $(INSTALL_DIR) done.\n"
fccc685 Initial open-source release
MLstate authored
232
465b551 @Aqua-Ye [enhance] build: added option to not install ocaml
Aqua-Ye authored
233 install-node: install-bin install-lib install-share install-plugins install-node-packages install-man
234 @printf "Installation into $(INSTALL_DIR) done.\n"
235
fccc685 Initial open-source release
MLstate authored
236 .PHONY: uninstall
237 uninstall:
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
238 rm -rf $(INSTALL_DIR)/lib/opa
239 @[ ! -d $(INSTALL_DIR)/lib ] || [ -n "`ls -A $(INSTALL_DIR)/lib`" ] || rmdir $(INSTALL_DIR)/lib
240 rm -rf $(INSTALL_DIR)/share/opa
241 rm -rf $(INSTALL_DIR)/share/doc/opa
a9fdc17 @Aqua-Ye [doc] Makefile: added a TODO
Aqua-Ye authored
242 # TODO: remove all installed opa manpages
243 # rm -rf $(INSTALL_DIR)/share/man/man1/opa*
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
244 @[ ! -d $(INSTALL_DIR)/share ] || [ -n "`ls -A $(INSTALL_DIR)/share`" ] || rmdir $(INSTALL_DIR)/share
1b2772b [fix] Makefile: zealous uninstall
Louis Gesbert authored
245 $(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
246 @tools/utils/install.sh --uninstall --dir $(INSTALL_DIR)
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
247 @[ ! -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
248 @printf "Uninstall done.\n"
fccc685 Initial open-source release
MLstate authored
249
250 # Install our ocamlbuild-generation engine
251 install-bld:
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
252 @mkdir -p $(INSTALL_DIR)/bin
22b433a @fperrin Don't assume that bash is in /bin
fperrin authored
253 @echo "#!/usr/bin/env bash" > $(INSTALL_DIR)/bin/bld
254 @echo "set -e" >> $(INSTALL_DIR)/bin/bld
255 @echo "set -u" >> $(INSTALL_DIR)/bin/bld
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
256 @chmod 755 $(INSTALL_DIR)/bin/bld
257 @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
258 @echo "_build/myocamlbuild -no-plugin $(OCAMLBUILD_OPT) \"\$$@\"" >> $(INSTALL_DIR)/bin/bld
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
259 @mkdir -p $(INSTALL_DIR)/share/opa/bld
6790c3f @Aqua-Ye [fix] Makefile: fix path for gen_myocamlbuild*.sh
Aqua-Ye authored
260 @$(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
261 $(INSTALL_DIR)/share/opa/bld
fccc685 Initial open-source release
MLstate authored
262
263 # Install an opa wrapper with different stdlib and options (for some backwards-compatibility)
264 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
265 @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
266 @$(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
267 @echo "#!/usr/bin/env bash" > $(INSTALL_DIR)/bin/qmlflat
268 @echo "set -e" >> $(INSTALL_DIR)/bin/qmlflat
269 @echo "set -u" >> $(INSTALL_DIR)/bin/qmlflat
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
270 @chmod 755 $(INSTALL_DIR)/bin/qmlflat
33e6550 @Aqua-Ye [fix] Makefile: fix install-all and install-qmlflat rules
Aqua-Ye authored
271 @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
272 >> $(INSTALL_DIR)/bin/qmlflat
fccc685 Initial open-source release
MLstate authored
273
274 # 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
275 install-all: install install-bld install-qmlflat tools/maxmem
33e6550 @Aqua-Ye [fix] Makefile: fix install-all and install-qmlflat rules
Aqua-Ye authored
276 @$(INSTALL) tools/platform_helper.sh $(INSTALL_DIR)/bin/
d863cc7 @Aqua-Ye [enhance] all: wip compilation
Aqua-Ye authored
277 @$(INSTALL) tools/maxmem $(INSTALL_DIR)/bin/
278 @rm tools/maxmem
279 @$(INSTALL) tools/plotmem $(INSTALL_DIR)/bin/
fccc685 Initial open-source release
MLstate authored
280
281 ##
282 ## DOCUMENTATION
283 ##
284 # (in this section, multiple calls to ocamlbuild are tolerated)
285
286 .PHONY: doc.jsbsl
287 doc.jsbsl: $(MYOCAMLBUILD)
288 $(OCAMLBUILD) $@/index.html
289
290 # this rules provides the doc.html target (from Makefile.bld)
291 # the sed are just there to help sorting by filename-within-directory
292 .PHONY: doc.odocl
293 doc.odocl:
294 echo $(foreach lib,$(ALL_LIBS),$(lib-cmi-$(lib):%.cmi=%)) \
295 | sed 's# \+#\n#g' \
296 | sed 's#\(.*\)/\([^/]*\)#\1 \2#' \
297 | sort -k 2 -u \
298 | sed 's#\(.*\) \([^ ]*\)#\1/\2#' \
299 >$@
300
301 .PHONY: packages-api
302 packages-api: $(MYOCAMLBUILD)
5e9da00 @BourgerieQuentin [enhance] compiler, syntax: Default syntax is now js-like
BourgerieQuentin authored
303 OPAOPT="$(OPAOPT) --rebuild --api --parser classic" $(OCAMLBUILD) opa-packages.stamp
Something went wrong with that request. Please try again.