Skip to content

HTTPS clone URL

Subversion checkout URL

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