Skip to content
Newer
Older
100644 271 lines (214 sloc) 9.38 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 ?= .
1c372aa @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
1c372aa @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
1c372aa @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 OCAMLBU…
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 libnattraver…
Louis Gesbert authored
26
b3faa83 @Aqua-Ye [feature] Makefile: use DEBUG_OCAMLBUILD to print classic display for…
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
1c372aa @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 buildin…
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)
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
9b747e0 @Aqua-Ye [enhance] Makefile: factorize OPA_TOOLS, and make a target out of it
Aqua-Ye authored
72 DISTRIB_TOOLS = opa-bin opa-plugin-builder-bin opa-plugin-browser-bin bslServerLib.ml # opa-cloud opa-db-server opa-db-tool opatop opa-translate
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))
78
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBU…
Aqua-Ye authored
79 ##
1f43f00 @Aqua-Ye [doc] Makefile: comment
Aqua-Ye authored
80 ## MANPAGES - done in install_release.sh
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBU…
Aqua-Ye authored
81 ##
82
8c3019b [enhance] manpages: added target install-man to install manpages by d…
Mathieu Baudet authored
83 .PHONY: manpages
5baea24 [fix] manpages: when called from the main Makefile, do not assume 'in…
Mathieu Baudet authored
84 manpages: $(MYOCAMLBUILD)
44fea0f @Aqua-Ye [enhance] Makefile: use NO_MANPAGES on manpages target ans not for al…
Aqua-Ye authored
85 ifndef NO_MANPAGES
8c7bf7f @Aqua-Ye [enhance] Makefile: silence recursive make calls
Aqua-Ye authored
86 @$(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
87 else
88 @echo "Not building manpages"
89 endif
8c3019b [enhance] manpages: added target install-man to install manpages by d…
Mathieu Baudet authored
90
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBU…
Aqua-Ye authored
91 ##
92 ## OPA-CREATE
93 ##
94
82f79ec @Aqua-Ye [enhance] Makefile: fixing some paths
Aqua-Ye authored
95 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
96
2b39809 @cedricss [feature] opa-create: new tool to generate application skeletons
cedricss authored
97 .PHONY: opa-create
98 opa-create: $(MYOCAMLBUILD)
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBU…
Aqua-Ye authored
99 $(OCAMLBUILD) $(target-tool-opa-create)
f42e1e4 @BourgerieQuentin Revert "[enhance] build: cleanup, improve"
BourgerieQuentin authored
100 @mkdir -p $(BUILD_DIR)/bin
101 $(INSTALL) $(BUILD_DIR)/$(target-tool-opa-create) $(BUILD_DIR)/bin/opa-create
102 @chmod 755 $(BUILD_DIR)/bin/opa-create
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBU…
Aqua-Ye authored
103
2b39809 @cedricss [feature] opa-create: new tool to generate application skeletons
cedricss authored
104 .PHONY: install-opa-create
105 install-opa-create:
6a0b86b @Aqua-Ye [cleanup] Makefile, Makefile.bld: some cleanup, and factorize OCAMLBU…
Aqua-Ye authored
106 @mkdir -p $(PREFIX)/bin
f42e1e4 @BourgerieQuentin Revert "[enhance] build: cleanup, improve"
BourgerieQuentin authored
107 $(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
108 @chmod 755 $(INSTALL_DIR)/bin/opa-create
2b39809 @cedricss [feature] opa-create: new tool to generate application skeletons
cedricss authored
109
fccc685 Initial open-source release
MLstate authored
110 ##
111 ## INSTALLATION
112 ##
113
114 .PHONY: install*
115
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
116 STDLIB_DIR = $(INSTALL_DIR)/lib/opa/stdlib
662e95e @BourgerieQuentin [enhance] compiler, packages: Allows to have several backends (separa…
BourgerieQuentin authored
117
118 NODE_STDLIB_SUFFIX_DIR=stdlib.qmljs
119 STDLIB_NODE_DIR=$(STDLIB_DIR)/$(NODE_STDLIB_SUFFIX_DIR)
f42e1e4 @BourgerieQuentin Revert "[enhance] build: cleanup, improve"
BourgerieQuentin authored
120 BUILD_NODE_DIR=$(BUILD_DIR)/$(NODE_STDLIB_SUFFIX_DIR)
662e95e @BourgerieQuentin [enhance] compiler, packages: Allows to have several backends (separa…
BourgerieQuentin authored
121 define install-node-package
122 @mkdir -p "$(STDLIB_NODE_DIR)/$*.opx/_build"
123 @find "$(BUILD_NODE_DIR)/$*.opx" -maxdepth 1 ! -type d -exec $(INSTALL) {} "$(STDLIB_NODE_DIR)/$*.opx/" \;
124 @$(INSTALL) $(BUILD_NODE_DIR)/$*.opx/*.js "$(STDLIB_NODE_DIR)/$*.opx/"
fccc685 Initial open-source release
MLstate authored
125 endef
126
2fae9ee @Aqua-Ye [fix] Makefile: plugins were not install because of wrong path
Aqua-Ye authored
127 PLUGINS_DIR=lib/plugins
724ba0f @Aqua-Ye [enhance] Makefile: renamed some targets with -node- inside it
Aqua-Ye authored
128 define install-node-plugin
2f55085 @OpaOnWindowsNow [fix] Makefile: install plugins
OpaOnWindowsNow authored
129 @printf "Installing into $(STDLIB_DIR)/$*.opp^[[K\r"
032f272 @arthuraa [enhance] install: raw js files.
arthuraa authored
130 @mkdir -p "$(STDLIB_DIR)/$*.opp"
f42e1e4 @BourgerieQuentin Revert "[enhance] build: cleanup, improve"
BourgerieQuentin authored
131 @$(INSTALL) $(BUILD_DIR)/$(PLUGINS_DIR)/$*.opp/*.bypass "$(STDLIB_DIR)/$*.opp/";
132 @$(if $(wildcard $(BUILD_DIR)/$(PLUGINS_DIR)/$*.opp/*NodeJsPackage.js), $(INSTALL) $(BUILD_DIR)/$(PLUGINS_DIR)/$*.opp/*NodeJsPackage.js "$(STDLIB_DIR)/$*.opp/")
133 @$(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
134 endef
135
136
d863cc7 @Aqua-Ye [enhance] all: wip compilation
Aqua-Ye authored
137 # List all packages and plugins in stdlib
5e5b333 [enhance] windows,Makefile: cache for packages and plugins enumeratio…
Rudy Sicard authored
138 # caches are needed because too slow on cygwin/msys
139 OPA_PACKAGES_CACHE = _build/OPA_PACKAGES.cache
140 OPA_PLUGINS_CACHE = _build/OPA_PLUGINS.cache
04553ac @OpaOnWindowsNow [fix] Makefile: create _build for cache files
OpaOnWindowsNow authored
141 OPA_PACKAGES := $(shell mkdir -p _build; 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))
5e5b333 [enhance] windows,Makefile: cache for packages and plugins enumeratio…
Rudy Sicard authored
142 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)
143
fccc685 Initial open-source release
MLstate authored
144
145 # Rules installing everything that has been compiled
146 #
147 # This doesn't rely on install rules generated by Makefile.bld ;
148 # instead it assumes that what you want to install has been properly
f42e1e4 @BourgerieQuentin Revert "[enhance] build: cleanup, improve"
BourgerieQuentin authored
149 # put in $(BUILD_DIR)/{bin,lib/opa,share/opa,share/man}.
fccc685 Initial open-source release
MLstate authored
150 #
151 # This is the case of tools (because of Makefile.bld),
152 # and of opa runtime libs (because build rules copy them
f42e1e4 @BourgerieQuentin Revert "[enhance] build: cleanup, improve"
BourgerieQuentin authored
153 # to $(BUILD_DIR)/lib/opa/static).
fccc685 Initial open-source release
MLstate authored
154 # This doesn't install the other libs though, use target install-libs
155 # for that
156
662e95e @BourgerieQuentin [enhance] compiler, packages: Allows to have several backends (separa…
BourgerieQuentin authored
157 install-node-packageopt-%:
158 $(if $(wildcard $(BUILD_NODE_DIR)/$*.opx/*.js),$(install-node-package))
fccc685 Initial open-source release
MLstate authored
159
662e95e @BourgerieQuentin [enhance] compiler, packages: Allows to have several backends (separa…
BourgerieQuentin authored
160 install-node-package-%:
161 $(install-node-package)
162
163 install-node-packages: $(addprefix install-node-packageopt-,$(OPA_PACKAGES))
164 @printf "Installation to $(STDLIB_NODE_DIR) done.\n"
fccc685 Initial open-source release
MLstate authored
165
724ba0f @Aqua-Ye [enhance] Makefile: renamed some targets with -node- inside it
Aqua-Ye authored
166 install-node-pluginopt-%:
f42e1e4 @BourgerieQuentin Revert "[enhance] build: cleanup, improve"
BourgerieQuentin authored
167 $(if $(wildcard $(BUILD_DIR)/$(PLUGINS_DIR)/$*.opp/),$(install-node-plugin))
2f55085 @OpaOnWindowsNow [fix] Makefile: install plugins
OpaOnWindowsNow authored
168
724ba0f @Aqua-Ye [enhance] Makefile: renamed some targets with -node- inside it
Aqua-Ye authored
169 install-node-plugin-%:
170 $(install-node-plugin)
2f55085 @OpaOnWindowsNow [fix] Makefile: install plugins
OpaOnWindowsNow authored
171
724ba0f @Aqua-Ye [enhance] Makefile: renamed some targets with -node- inside it
Aqua-Ye authored
172 install-node-plugins: $(addprefix install-node-pluginopt-,$(OPA_PLUGINS))
2f55085 @OpaOnWindowsNow [fix] Makefile: install plugins
OpaOnWindowsNow authored
173 @printf "Installation to $(STDLIB_DIR) done.\n"
174
fcef231 @cedricss [enhance] Compile: Makefile improved for opa tools. Built them before…
cedricss authored
175 install-bin:
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
176 @printf "Installing into $(INSTALL_DIR)/bin\r"
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
177 @mkdir -p $(INSTALL_DIR)/bin
f42e1e4 @BourgerieQuentin Revert "[enhance] build: cleanup, improve"
BourgerieQuentin authored
178 @$(if $(wildcard $(BUILD_DIR)/bin/*),$(INSTALL) -r $(BUILD_DIR)/bin/* $(INSTALL_DIR)/bin)
82f79ec @Aqua-Ye [enhance] Makefile: fixing some paths
Aqua-Ye authored
179 @$(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
180 @printf "Installation to $(INSTALL_DIR)/bin done.\n"
fccc685 Initial open-source release
MLstate authored
181
182 install-lib:
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
183 @printf "Installing into $(INSTALL_DIR)/lib/opa\r"
f42e1e4 @BourgerieQuentin Revert "[enhance] build: cleanup, improve"
BourgerieQuentin authored
184 @rm -f $(BUILD_DIR)/lib/opa/static/opabslMLRuntime.cmi
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
185 @mkdir -p $(INSTALL_DIR)/lib/opa
f42e1e4 @BourgerieQuentin Revert "[enhance] build: cleanup, improve"
BourgerieQuentin authored
186 @$(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
187 @printf "Installation to $(INSTALL_DIR)/lib/opa done.\n"
fccc685 Initial open-source release
MLstate authored
188
189 install-share:
8037018 [fix] Makefiles: using a more portable printf instead of echo
Louis Gesbert authored
190 @printf "Installing into $(INSTALL_DIR)/share/opa\r"
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
191 @mkdir -p $(INSTALL_DIR)/share/opa
f42e1e4 @BourgerieQuentin Revert "[enhance] build: cleanup, improve"
BourgerieQuentin authored
192 @$(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
193 @printf "Installation to $(INSTALL_DIR)/share/opa done.\n"
fccc685 Initial open-source release
MLstate authored
194
8c3019b [enhance] manpages: added target install-man to install manpages by d…
Mathieu Baudet authored
195 install-man:
196 @printf "Installing into $(INSTALL_DIR)/share/man\r"
f42e1e4 @BourgerieQuentin Revert "[enhance] build: cleanup, improve"
BourgerieQuentin authored
197 @if [ -d $(BUILD_DIR)/man/man1 ]; then \
8c3019b [enhance] manpages: added target install-man to install manpages by d…
Mathieu Baudet authored
198 mkdir -p $(INSTALL_DIR)/share/man/man1; \
199 fi
f42e1e4 @BourgerieQuentin Revert "[enhance] build: cleanup, improve"
BourgerieQuentin authored
200 @$(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
201 @printf "Installation to $(INSTALL_DIR)/share/man done.\n"
202
724ba0f @Aqua-Ye [enhance] Makefile: renamed some targets with -node- inside it
Aqua-Ye authored
203 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
204 @printf "Installation into $(INSTALL_DIR) done.\n"
205
1f01d30 @Aqua-Ye [enhance] Makefile: improved install* rules
Aqua-Ye authored
206 .PHONY: install
724ba0f @Aqua-Ye [enhance] Makefile: renamed some targets with -node- inside it
Aqua-Ye authored
207 install:: install-node
1f01d30 @Aqua-Ye [enhance] Makefile: improved install* rules
Aqua-Ye authored
208 @printf "Installation into $(INSTALL_DIR) done.\n"
209
fccc685 Initial open-source release
MLstate authored
210 .PHONY: uninstall
211 uninstall:
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
212 rm -rf $(INSTALL_DIR)/lib/opa
213 @[ ! -d $(INSTALL_DIR)/lib ] || [ -n "`ls -A $(INSTALL_DIR)/lib`" ] || rmdir $(INSTALL_DIR)/lib
214 rm -rf $(INSTALL_DIR)/share/opa
215 rm -rf $(INSTALL_DIR)/share/doc/opa
b87dce7 @Aqua-Ye [fix] Makefile: comment position
Aqua-Ye authored
216 # TODO: remove all installed opa manpages
217 # rm -rf $(INSTALL_DIR)/share/man/man1/opa*
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
218 @[ ! -d $(INSTALL_DIR)/share ] || [ -n "`ls -A $(INSTALL_DIR)/share`" ] || rmdir $(INSTALL_DIR)/share
f42e1e4 @BourgerieQuentin Revert "[enhance] build: cleanup, improve"
BourgerieQuentin authored
219 $(foreach file,$(wildcard $(BUILD_DIR)/bin/*),rm -f $(INSTALL_DIR)/bin/$(notdir $(file));)
82f79ec @Aqua-Ye [enhance] Makefile: fixing some paths
Aqua-Ye authored
220 @$(OPALANG_DIR)/tools/utils/install.sh --uninstall --dir $(INSTALL_DIR)
dd85158 @Aqua-Ye [cleanup] Makefile: ws
Aqua-Ye authored
221 @[ ! -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
222 @printf "Uninstall done.\n"
fccc685 Initial open-source release
MLstate authored
223
224 # Install our ocamlbuild-generation engine
225 install-bld:
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
226 @mkdir -p $(INSTALL_DIR)/bin
22b433a @fperrin Don't assume that bash is in /bin
fperrin authored
227 @echo "#!/usr/bin/env bash" > $(INSTALL_DIR)/bin/bld
228 @echo "set -e" >> $(INSTALL_DIR)/bin/bld
229 @echo "set -u" >> $(INSTALL_DIR)/bin/bld
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
230 @chmod 755 $(INSTALL_DIR)/bin/bld
231 @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
232 @echo "_build/myocamlbuild$(EXT_EXE) -no-plugin $(OCAMLBUILD_OPT) \"\$$@\"" >> $(INSTALL_DIR)/bin/bld
894a751 @delroth Support make DESTDIR=... install for easier packaging
delroth authored
233 @mkdir -p $(INSTALL_DIR)/share/opa/bld
1c372aa @Aqua-Ye [enhance] build: cleanup, improve
Aqua-Ye authored
234 @$(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
235 $(INSTALL_DIR)/share/opa/bld
fccc685 Initial open-source release
MLstate authored
236
b0691fc @Aqua-Ye [fix] Makefile: paths
Aqua-Ye authored
237 maxmem: $(OPALANG_DIR)/tools/maxmem.c
238 gcc $(OPALANG_DIR)/tools/maxmem.c -o $(OPALANG_DIR)/tools/maxmem
dfac25c @Aqua-Ye [fix] Makefile: fix for maxmem
Aqua-Ye authored
239
1f01d30 @Aqua-Ye [enhance] Makefile: improved install* rules
Aqua-Ye authored
240 # 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
241 install-all:: install install-bld maxmem
b0691fc @Aqua-Ye [fix] Makefile: paths
Aqua-Ye authored
242 @$(INSTALL) $(OPALANG_DIR)/tools/platform_helper.sh $(INSTALL_DIR)/bin/
243 @$(INSTALL) $(OPALANG_DIR)/tools/maxmem $(INSTALL_DIR)/bin/
244 @rm $(OPALANG_DIR)/tools/maxmem
245 @$(INSTALL) $(OPALANG_DIR)/tools/plotmem $(INSTALL_DIR)/bin/
9395fa3 @Aqua-Ye [enhance] Makefile: added a printing after install-all
Aqua-Ye authored
246 @printf "All Installation into $(INSTALL_DIR) done.\n"
1f01d30 @Aqua-Ye [enhance] Makefile: improved install* rules
Aqua-Ye authored
247
fccc685 Initial open-source release
MLstate authored
248 ##
249 ## DOCUMENTATION
250 ##
251 # (in this section, multiple calls to ocamlbuild are tolerated)
252
253 .PHONY: doc.jsbsl
254 doc.jsbsl: $(MYOCAMLBUILD)
255 $(OCAMLBUILD) $@/index.html
256
257 # this rules provides the doc.html target (from Makefile.bld)
258 # the sed are just there to help sorting by filename-within-directory
259 .PHONY: doc.odocl
260 doc.odocl:
261 echo $(foreach lib,$(ALL_LIBS),$(lib-cmi-$(lib):%.cmi=%)) \
262 | sed 's# \+#\n#g' \
263 | sed 's#\(.*\)/\([^/]*\)#\1 \2#' \
264 | sort -k 2 -u \
265 | sed 's#\(.*\) \([^ ]*\)#\1/\2#' \
266 >$@
267
268 .PHONY: packages-api
269 packages-api: $(MYOCAMLBUILD)
65bfa58 @Aqua-Ye [fix] Makefile, ocamlbuild: added MYOCAMLBUILD_OPT for always buildin…
Aqua-Ye authored
270 OPAOPT="$(OPAOPT) --api --parser classic" $(OCAMLBUILD) plugins.qmljs.stamp opa-node-packages.stamp
Something went wrong with that request. Please try again.