Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 289 lines (228 sloc) 10.165 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
1d9609b @Aqua-Ye [enhance] Makefile: renamed default target into all
Aqua-Ye authored
10 .PHONY: all
11 all: node
fccc685 Initial open-source release
MLstate authored
12
2dd0622 @Aqua-Ye [enhance] Makefile: some env vars renaming and substitution
Aqua-Ye authored
13 OPALANG_DIR ?= .
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
14 CONFIG_DIR ?= $(OPALANG_DIR)/tools/build
40c01f8 @Aqua-Ye [enhance] build: started to improve the build system to handle a prefix
Aqua-Ye authored
15
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
16 BUILD_TOOLS_DIR = $(OPALANG_DIR)/tools/build
94ed07b @Aqua-Ye [enhance] build: moved config files in tools/build
Aqua-Ye authored
17
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
18 -include $(CONFIG_DIR)/config.make
fccc685 Initial open-source release
MLstate authored
19
1321ba9 @fperrin On FreeBSD check and use gmake, use make elsewhere
fperrin authored
20 MAKE ?= $_
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBUILD...
Aqua-Ye authored
21 OCAMLBUILD_OPT ?= -j 6
fccc685 Initial open-source release
MLstate authored
22
e7282e7 [enhance] make: do not rebuild opa packages if the variable is set
Louis Gesbert authored
23 ifndef NO_REBUILD_OPA_PACKAGES
42668dc @Aqua-Ye [enhance] Makefile: packages-api only constructs node API
Aqua-Ye authored
24 OPAOPT += --rebuild
e7282e7 [enhance] make: do not rebuild opa packages if the variable is set
Louis Gesbert authored
25 endif
8a40e70 [feature] build: support for optional libraries, enabled libnattraversal...
Louis Gesbert authored
26
b3faa83 @Aqua-Ye [feature] Makefile: use DEBUG_OCAMLBUILD to print classic display for oc...
Aqua-Ye authored
27 ifdef DEBUG_OCAMLBUILD
28 OCAMLBUILD_OPT += -classic-display
29 endif
30
fccc685 Initial open-source release
MLstate authored
31 export
32
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
33 include $(BUILD_TOOLS_DIR)/Makefile.bld
6d1dcea @Aqua-Ye [fix] Makefile: carefull with makefiles inclusion
Aqua-Ye authored
34
65bfa58 @Aqua-Ye [fix] Makefile, ocamlbuild: added MYOCAMLBUILD_OPT for always building a...
Aqua-Ye authored
35 MYOCAMLBUILD_OPT = opabsl.qmljs.stamp
36
fccc685 Initial open-source release
MLstate authored
37 ##
38 ## STANDARD TARGETS
39 ##
40
0f00345 @Aqua-Ye [doc] Makefile: a comment about ALL_TOOLS
Aqua-Ye authored
41 # ALL_TOOLS is built by Makefile.bld from build_tools files
bc046f3 @Aqua-Ye [enhance] Makefile: only compile node packages by default
Aqua-Ye authored
42 .PHONY: node
43 node: $(MYOCAMLBUILD)
edd2fa0 @nrs135 [feature] apigen: Added apigen sources and build code.
nrs135 authored
44 $(OCAMLBUILD) plugins.qmljs.stamp $(call target-tools,$(ALL_TOOLS)) opa-node-packages.stamp qmljs.opa.create qmljs.apigen
bc046f3 @Aqua-Ye [enhance] Makefile: only compile node packages by default
Aqua-Ye authored
45 @$(call copy-tools,$(ALL_TOOLS))
fccc685 Initial open-source release
MLstate authored
46
14d4637 @Aqua-Ye [enhance] Makefile: renamed some targets
Aqua-Ye authored
47 .PHONY: node-runtime-libs
48 node-runtime-libs: $(MYOCAMLBUILD)
49 $(OCAMLBUILD) js-runtime-libs.stamp
fccc685 Initial open-source release
MLstate authored
50
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
51 .PHONY: $(BUILD_TOOLS_DIR)/bin/opa
52 $(BUILD_TOOLS_DIR)/bin/opa: $(MYOCAMLBUILD)
65bfa58 @Aqua-Ye [fix] Makefile, ocamlbuild: added MYOCAMLBUILD_OPT for always building a...
Aqua-Ye authored
53 $(OCAMLBUILD) plugins.qmljs.stamp opa-node-packages.stamp $(target-tool-opa-bin)
fccc685 Initial open-source release
MLstate authored
54 @$(copy-tool-opa-bin)
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
55 @$(OPALANG_DIR)/tools/utils/install.sh --quiet --dir $(realpath $(BUILD_TOOLS_DIR)) --ocaml-prefix $(OCAMLLIB)/../../..
fccc685 Initial open-source release
MLstate authored
56
57 .PHONY: opa
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
58 opa: $(BUILD_TOOLS_DIR)/bin/opa
fccc685 Initial open-source release
MLstate authored
59
4b0bc5d @Aqua-Ye [enhance] Makefile: split Makefile for native and node compilation
Aqua-Ye authored
60 .PHONY: opa-node-packages
75a4f89 @BourgerieQuentin [enhance] build: Added rules to compile stdlib to nodejs backend
BourgerieQuentin authored
61 opa-node-packages: $(MYOCAMLBUILD)
65bfa58 @Aqua-Ye [fix] Makefile, ocamlbuild: added MYOCAMLBUILD_OPT for always building a...
Aqua-Ye authored
62 $(OCAMLBUILD) plugins.qmljs.stamp opa-node-packages.stamp
fccc685 Initial open-source release
MLstate authored
63
14d4637 @Aqua-Ye [enhance] Makefile: renamed some targets
Aqua-Ye authored
64 .PHONY: stdlib
65 stdlib: opa-node-packages
fccc685 Initial open-source release
MLstate authored
66
072c33e @Aqua-Ye [enhance] Makefile: renamed opa_tools into opa-tools
Aqua-Ye authored
67 .PHONY: opa-tools
edd2fa0 @nrs135 [feature] apigen: Added apigen sources and build code.
nrs135 authored
68 opa-tools: $(MYOCAMLBUILD) opa-create apigen
c62a001 @Aqua-Ye [enhance] build: better opa-create building
Aqua-Ye authored
69 @echo "Tools build"
fccc685 Initial open-source release
MLstate authored
70
9b747e0 @Aqua-Ye [enhance] Makefile: factorize OPA_TOOLS, and make a target out of it
Aqua-Ye authored
71 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
fcef231 @cedricss [enhance] Compile: Makefile improved for opa tools. Built them before in...
cedricss authored
72
fccc685 Initial open-source release
MLstate authored
73 .PHONY: distrib
74 distrib: $(MYOCAMLBUILD)
edd2fa0 @nrs135 [feature] apigen: Added apigen sources and build code.
nrs135 authored
75 $(OCAMLBUILD) plugins.qmljs.stamp $(call target-tools,$(DISTRIB_TOOLS)) opa-node-packages.stamp qmljs.opa.create qmljs.apigen
bc046f3 @Aqua-Ye [enhance] Makefile: only compile node packages by default
Aqua-Ye authored
76 @$(call copy-tools,$(DISTRIB_TOOLS))
77
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBUILD...
Aqua-Ye authored
78 ##
1f43f00 @Aqua-Ye [doc] Makefile: comment
Aqua-Ye authored
79 ## MANPAGES - done in install_release.sh
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBUILD...
Aqua-Ye authored
80 ##
81
8c3019b [enhance] manpages: added target install-man to install manpages by defa...
Mathieu Baudet authored
82 .PHONY: manpages
5baea24 [fix] manpages: when called from the main Makefile, do not assume 'insta...
Mathieu Baudet authored
83 manpages: $(MYOCAMLBUILD)
44fea0f @Aqua-Ye [enhance] Makefile: use NO_MANPAGES on manpages target ans not for all t...
Aqua-Ye authored
84 ifndef NO_MANPAGES
8c7bf7f @Aqua-Ye [enhance] Makefile: silence recursive make calls
Aqua-Ye authored
85 @$(MAKE) -f $(OPALANG_DIR)/tools/manpages/Makefile
44fea0f @Aqua-Ye [enhance] Makefile: use NO_MANPAGES on manpages target ans not for all t...
Aqua-Ye authored
86 else
87 @echo "Not building manpages"
88 endif
8c3019b [enhance] manpages: added target install-man to install manpages by defa...
Mathieu Baudet authored
89
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBUILD...
Aqua-Ye authored
90 ##
91 ## OPA-CREATE
92 ##
93
82f79ec @Aqua-Ye [enhance] Makefile: fixing some paths
Aqua-Ye authored
94 target-tool-opa-create = $(OPALANG_DIR)/tools/opa-create/src/opa-create.exe
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBUILD...
Aqua-Ye authored
95
2b39809 @cedricss [feature] opa-create: new tool to generate application skeletons
cedricss authored
96 .PHONY: opa-create
97 opa-create: $(MYOCAMLBUILD)
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBUILD...
Aqua-Ye authored
98 $(OCAMLBUILD) $(target-tool-opa-create)
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
99 @mkdir -p $(BUILD_TOOLS_DIR)/bin
100 $(INSTALL) $(BUILD_TOOLS_DIR)/$(target-tool-opa-create) $(BUILD_TOOLS_DIR)/bin/opa-create
101 @chmod 755 $(BUILD_TOOLS_DIR)/bin/opa-create
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBUILD...
Aqua-Ye authored
102
2b39809 @cedricss [feature] opa-create: new tool to generate application skeletons
cedricss authored
103 .PHONY: install-opa-create
104 install-opa-create:
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBUILD...
Aqua-Ye authored
105 @mkdir -p $(PREFIX)/bin
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
106 $(INSTALL) $(BUILD_TOOLS_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
107 @chmod 755 $(INSTALL_DIR)/bin/opa-create
2b39809 @cedricss [feature] opa-create: new tool to generate application skeletons
cedricss authored
108
fccc685 Initial open-source release
MLstate authored
109 ##
edd2fa0 @nrs135 [feature] apigen: Added apigen sources and build code.
nrs135 authored
110 ## APIGEN
111 ##
112
113 target-tool-apigen = $(OPALANG_DIR)/tools/apigen/apigen.exe
114
115 .PHONY: apigen
116 apigen: $(MYOCAMLBUILD)
117 $(OCAMLBUILD) $(target-tool-apigen)
118 @mkdir -p $(BUILD_DIR)/bin
119 $(INSTALL) $(BUILD_DIR)/$(target-tool-apigen) $(BUILD_DIR)/bin/apigen
120 @chmod 755 $(BUILD_DIR)/bin/apigen
121
122 .PHONY: install-apigen
123 install-apigen:
124 @mkdir -p $(PREFIX)/bin
125 $(INSTALL) $(BUILD_DIR)/bin/apigen $(INSTALL_DIR)/bin/apigen
126 @chmod 755 $(INSTALL_DIR)/bin/apigen
127
128 ##
fccc685 Initial open-source release
MLstate authored
129 ## INSTALLATION
130 ##
131
132 .PHONY: install*
133
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
134 STDLIB_DIR = $(INSTALL_DIR)/lib/opa/stdlib
662e95e @BourgerieQuentin [enhance] compiler, packages: Allows to have several backends (separated...
BourgerieQuentin authored
135
136 NODE_STDLIB_SUFFIX_DIR=stdlib.qmljs
137 STDLIB_NODE_DIR=$(STDLIB_DIR)/$(NODE_STDLIB_SUFFIX_DIR)
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
138 BUILD_NODE_DIR=$(BUILD_TOOLS_DIR)/$(NODE_STDLIB_SUFFIX_DIR)
662e95e @BourgerieQuentin [enhance] compiler, packages: Allows to have several backends (separated...
BourgerieQuentin authored
139 define install-node-package
140 @mkdir -p "$(STDLIB_NODE_DIR)/$*.opx/_build"
141 @find "$(BUILD_NODE_DIR)/$*.opx" -maxdepth 1 ! -type d -exec $(INSTALL) {} "$(STDLIB_NODE_DIR)/$*.opx/" \;
142 @$(INSTALL) $(BUILD_NODE_DIR)/$*.opx/*.js "$(STDLIB_NODE_DIR)/$*.opx/"
fccc685 Initial open-source release
MLstate authored
143 endef
144
2fae9ee @Aqua-Ye [fix] Makefile: plugins were not install because of wrong path
Aqua-Ye authored
145 PLUGINS_DIR=lib/plugins
724ba0f @Aqua-Ye [enhance] Makefile: renamed some targets with -node- inside it
Aqua-Ye authored
146 define install-node-plugin
2f55085 @OpaOnWindowsNow [fix] Makefile: install plugins
OpaOnWindowsNow authored
147 @printf "Installing into $(STDLIB_DIR)/$*.opp^[[K\r"
032f272 @arthuraa [enhance] install: raw js files.
arthuraa authored
148 @mkdir -p "$(STDLIB_DIR)/$*.opp"
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
149 @$(INSTALL) $(BUILD_TOOLS_DIR)/$(PLUGINS_DIR)/$*.opp/*.bypass "$(STDLIB_DIR)/$*.opp/";
150 @$(if $(wildcard $(BUILD_TOOLS_DIR)/$(PLUGINS_DIR)/$*.opp/*NodeJsPackage.js), $(INSTALL) $(BUILD_TOOLS_DIR)/$(PLUGINS_DIR)/$*.opp/*NodeJsPackage.js "$(STDLIB_DIR)/$*.opp/")
151 @$(if $(wildcard $(BUILD_TOOLS_DIR)/$(PLUGINS_DIR)/$*.opp/package.json), $(INSTALL) $(BUILD_TOOLS_DIR)/$(PLUGINS_DIR)/$*.opp/package.json "$(STDLIB_DIR)/$*.opp/")
2f55085 @OpaOnWindowsNow [fix] Makefile: install plugins
OpaOnWindowsNow authored
152 endef
153
154
d863cc7 @Aqua-Ye [enhance] all: wip compilation
Aqua-Ye authored
155 # List all packages and plugins in stdlib
5e5b333 [enhance] windows,Makefile: cache for packages and plugins enumeration (...
Rudy Sicard authored
156 # caches are needed because too slow on cygwin/msys
157 OPA_PACKAGES_CACHE = _build/OPA_PACKAGES.cache
158 OPA_PLUGINS_CACHE = _build/OPA_PLUGINS.cache
159 OPA_PACKAGES := $(shell if [ ! -f $(OPA_PACKAGES_CACHE) ]; then $(OPALANG_DIR)/lib/stdlib/all_packages.sh $(OPALANG_DIR)/lib/stdlib/node.exclude $(OPALANG_DIR)/lib/stdlib > $(OPA_PACKAGES_CACHE); fi; cat $(OPA_PACKAGES_CACHE))
160 OPA_PLUGINS := $(shell if [ ! -f $(OPA_PLUGINS_CACHE) ]; then $(OPALANG_DIR)/lib/stdlib/all_plugins.sh $(OPALANG_DIR)/lib/stdlib > $(OPA_PLUGINS_CACHE); fi; cat $(OPA_PLUGINS_CACHE) && echo opabsl)
161
fccc685 Initial open-source release
MLstate authored
162
163 # Rules installing everything that has been compiled
164 #
165 # This doesn't rely on install rules generated by Makefile.bld ;
166 # instead it assumes that what you want to install has been properly
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
167 # put in $(BUILD_TOOLS_DIR)/{bin,lib/opa,share/opa,share/man}.
fccc685 Initial open-source release
MLstate authored
168 #
169 # This is the case of tools (because of Makefile.bld),
170 # and of opa runtime libs (because build rules copy them
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
171 # to $(BUILD_TOOLS_DIR)/lib/opa/static).
fccc685 Initial open-source release
MLstate authored
172 # This doesn't install the other libs though, use target install-libs
173 # for that
174
662e95e @BourgerieQuentin [enhance] compiler, packages: Allows to have several backends (separated...
BourgerieQuentin authored
175 install-node-packageopt-%:
176 $(if $(wildcard $(BUILD_NODE_DIR)/$*.opx/*.js),$(install-node-package))
fccc685 Initial open-source release
MLstate authored
177
662e95e @BourgerieQuentin [enhance] compiler, packages: Allows to have several backends (separated...
BourgerieQuentin authored
178 install-node-package-%:
179 $(install-node-package)
180
181 install-node-packages: $(addprefix install-node-packageopt-,$(OPA_PACKAGES))
182 @printf "Installation to $(STDLIB_NODE_DIR) done.\n"
fccc685 Initial open-source release
MLstate authored
183
724ba0f @Aqua-Ye [enhance] Makefile: renamed some targets with -node- inside it
Aqua-Ye authored
184 install-node-pluginopt-%:
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
185 $(if $(wildcard $(BUILD_TOOLS_DIR)/$(PLUGINS_DIR)/$*.opp/),$(install-node-plugin))
2f55085 @OpaOnWindowsNow [fix] Makefile: install plugins
OpaOnWindowsNow authored
186
724ba0f @Aqua-Ye [enhance] Makefile: renamed some targets with -node- inside it
Aqua-Ye authored
187 install-node-plugin-%:
188 $(install-node-plugin)
2f55085 @OpaOnWindowsNow [fix] Makefile: install plugins
OpaOnWindowsNow authored
189
724ba0f @Aqua-Ye [enhance] Makefile: renamed some targets with -node- inside it
Aqua-Ye authored
190 install-node-plugins: $(addprefix install-node-pluginopt-,$(OPA_PLUGINS))
2f55085 @OpaOnWindowsNow [fix] Makefile: install plugins
OpaOnWindowsNow authored
191 @printf "Installation to $(STDLIB_DIR) done.\n"
192
fcef231 @cedricss [enhance] Compile: Makefile improved for opa tools. Built them before in...
cedricss authored
193 install-bin:
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
194 @printf "Installing into $(INSTALL_DIR)/bin\r"
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
195 @mkdir -p $(INSTALL_DIR)/bin
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
196 @$(if $(wildcard $(BUILD_TOOLS_DIR)/bin/*),$(INSTALL) -r $(BUILD_TOOLS_DIR)/bin/* $(INSTALL_DIR)/bin)
82f79ec @Aqua-Ye [enhance] Makefile: fixing some paths
Aqua-Ye authored
197 @$(OPALANG_DIR)/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
198 @printf "Installation to $(INSTALL_DIR)/bin done.\n"
fccc685 Initial open-source release
MLstate authored
199
200 install-lib:
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
201 @printf "Installing into $(INSTALL_DIR)/lib/opa\r"
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
202 @rm -f $(BUILD_TOOLS_DIR)/lib/opa/static/opabslMLRuntime.cmi
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
203 @mkdir -p $(INSTALL_DIR)/lib/opa
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
204 @$(if $(wildcard $(BUILD_TOOLS_DIR)/lib/opa/*),$(INSTALL) -r $(BUILD_TOOLS_DIR)/lib/opa/* $(INSTALL_DIR)/lib/opa/)
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
205 @printf "Installation to $(INSTALL_DIR)/lib/opa done.\n"
fccc685 Initial open-source release
MLstate authored
206
207 install-share:
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
208 @printf "Installing into $(INSTALL_DIR)/share/opa\r"
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
209 @mkdir -p $(INSTALL_DIR)/share/opa
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
210 @$(if $(wildcard $(BUILD_TOOLS_DIR)/share/opa/*),$(INSTALL) -r $(BUILD_TOOLS_DIR)/share/opa/* $(INSTALL_DIR)/share/opa/)
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
211 @printf "Installation to $(INSTALL_DIR)/share/opa done.\n"
fccc685 Initial open-source release
MLstate authored
212
8c3019b [enhance] manpages: added target install-man to install manpages by defa...
Mathieu Baudet authored
213 install-man:
214 @printf "Installing into $(INSTALL_DIR)/share/man\r"
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
215 @if [ -d $(BUILD_TOOLS_DIR)/man/man1 ]; then \
8c3019b [enhance] manpages: added target install-man to install manpages by defa...
Mathieu Baudet authored
216 mkdir -p $(INSTALL_DIR)/share/man/man1; \
217 fi
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
218 @$(if $(wildcard $(BUILD_TOOLS_DIR)/man/man1/*.1.gz),$(INSTALL) -r $(BUILD_TOOLS_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
219 @printf "Installation to $(INSTALL_DIR)/share/man done.\n"
220
724ba0f @Aqua-Ye [enhance] Makefile: renamed some targets with -node- inside it
Aqua-Ye authored
221 install-node: install-bin install-lib install-share install-node-plugins install-node-packages install-man
465b551 @Aqua-Ye [enhance] build: added option to not install ocaml
Aqua-Ye authored
222 @printf "Installation into $(INSTALL_DIR) done.\n"
223
1f01d30 @Aqua-Ye [enhance] Makefile: improved install* rules
Aqua-Ye authored
224 .PHONY: install
724ba0f @Aqua-Ye [enhance] Makefile: renamed some targets with -node- inside it
Aqua-Ye authored
225 install:: install-node
1f01d30 @Aqua-Ye [enhance] Makefile: improved install* rules
Aqua-Ye authored
226 @printf "Installation into $(INSTALL_DIR) done.\n"
227
fccc685 Initial open-source release
MLstate authored
228 .PHONY: uninstall
229 uninstall:
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
230 rm -rf $(INSTALL_DIR)/lib/opa
231 @[ ! -d $(INSTALL_DIR)/lib ] || [ -n "`ls -A $(INSTALL_DIR)/lib`" ] || rmdir $(INSTALL_DIR)/lib
232 rm -rf $(INSTALL_DIR)/share/opa
233 rm -rf $(INSTALL_DIR)/share/doc/opa
b87dce7 @Aqua-Ye [fix] Makefile: comment position
Aqua-Ye authored
234 # TODO: remove all installed opa manpages
235 # rm -rf $(INSTALL_DIR)/share/man/man1/opa*
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
236 @[ ! -d $(INSTALL_DIR)/share ] || [ -n "`ls -A $(INSTALL_DIR)/share`" ] || rmdir $(INSTALL_DIR)/share
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
237 $(foreach file,$(wildcard $(BUILD_TOOLS_DIR)/bin/*),rm -f $(INSTALL_DIR)/bin/$(notdir $(file));)
82f79ec @Aqua-Ye [enhance] Makefile: fixing some paths
Aqua-Ye authored
238 @$(OPALANG_DIR)/tools/utils/install.sh --uninstall --dir $(INSTALL_DIR)
dd85158 @Aqua-Ye [cleanup] Makefile: ws
Aqua-Ye authored
239 @[ ! -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
240 @printf "Uninstall done.\n"
fccc685 Initial open-source release
MLstate authored
241
242 # Install our ocamlbuild-generation engine
243 install-bld:
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
244 @mkdir -p $(INSTALL_DIR)/bin
22b433a @fperrin Don't assume that bash is in /bin
fperrin authored
245 @echo "#!/usr/bin/env bash" > $(INSTALL_DIR)/bin/bld
246 @echo "set -e" >> $(INSTALL_DIR)/bin/bld
247 @echo "set -u" >> $(INSTALL_DIR)/bin/bld
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
248 @chmod 755 $(INSTALL_DIR)/bin/bld
249 @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
250 @echo "_build/myocamlbuild -no-plugin $(OCAMLBUILD_OPT) \"\$$@\"" >> $(INSTALL_DIR)/bin/bld
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
251 @mkdir -p $(INSTALL_DIR)/share/opa/bld
c6a6023 @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
252 @$(INSTALL) $(BUILD_TOOLS_DIR)/gen_myocamlbuild.sh $(BUILD_TOOLS_DIR)/myocamlbuild_*fix.ml $(CONFIG_DIR)/config.sh $(CONFIG_DIR)/config.mli $(CONFIG_DIR)/config.ml\
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
253 $(INSTALL_DIR)/share/opa/bld
fccc685 Initial open-source release
MLstate authored
254
b0691fc @Aqua-Ye [fix] Makefile: paths
Aqua-Ye authored
255 maxmem: $(OPALANG_DIR)/tools/maxmem.c
256 gcc $(OPALANG_DIR)/tools/maxmem.c -o $(OPALANG_DIR)/tools/maxmem
dfac25c @Aqua-Ye [fix] Makefile: fix for maxmem
Aqua-Ye authored
257
1f01d30 @Aqua-Ye [enhance] Makefile: improved install* rules
Aqua-Ye authored
258 # installs some dev tools on top of the normal install; these should not change often
dfac25c @Aqua-Ye [fix] Makefile: fix for maxmem
Aqua-Ye authored
259 install-all:: install install-bld maxmem
b0691fc @Aqua-Ye [fix] Makefile: paths
Aqua-Ye authored
260 @$(INSTALL) $(OPALANG_DIR)/tools/platform_helper.sh $(INSTALL_DIR)/bin/
261 @$(INSTALL) $(OPALANG_DIR)/tools/maxmem $(INSTALL_DIR)/bin/
262 @rm $(OPALANG_DIR)/tools/maxmem
263 @$(INSTALL) $(OPALANG_DIR)/tools/plotmem $(INSTALL_DIR)/bin/
9395fa3 @Aqua-Ye [enhance] Makefile: added a printing after install-all
Aqua-Ye authored
264 @printf "All Installation into $(INSTALL_DIR) done.\n"
1f01d30 @Aqua-Ye [enhance] Makefile: improved install* rules
Aqua-Ye authored
265
fccc685 Initial open-source release
MLstate authored
266 ##
267 ## DOCUMENTATION
268 ##
269 # (in this section, multiple calls to ocamlbuild are tolerated)
270
271 .PHONY: doc.jsbsl
272 doc.jsbsl: $(MYOCAMLBUILD)
273 $(OCAMLBUILD) $@/index.html
274
275 # this rules provides the doc.html target (from Makefile.bld)
276 # the sed are just there to help sorting by filename-within-directory
277 .PHONY: doc.odocl
278 doc.odocl:
279 echo $(foreach lib,$(ALL_LIBS),$(lib-cmi-$(lib):%.cmi=%)) \
280 | sed 's# \+#\n#g' \
281 | sed 's#\(.*\)/\([^/]*\)#\1 \2#' \
282 | sort -k 2 -u \
283 | sed 's#\(.*\) \([^ ]*\)#\1/\2#' \
284 >$@
285
286 .PHONY: packages-api
287 packages-api: $(MYOCAMLBUILD)
65bfa58 @Aqua-Ye [fix] Makefile, ocamlbuild: added MYOCAMLBUILD_OPT for always building a...
Aqua-Ye authored
288 OPAOPT="$(OPAOPT) --api --parser classic" $(OCAMLBUILD) plugins.qmljs.stamp opa-node-packages.stamp
Something went wrong with that request. Please try again.