Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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