Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 1048 lines (894 sloc) 36.664 kB
84adefa The R13B03 release.
Erlang/OTP authored
1 #
2 # %CopyrightBegin%
141b8f2 Merge branch 'fh/common_test-includes' into ccase/r13b04_dev
Erlang/OTP authored
3 #
92bbb54 @bufflig Teach toplevel makefile to always use newly built escript.
bufflig authored
4 # Copyright Ericsson AB 1998-2011. All Rights Reserved.
141b8f2 Merge branch 'fh/common_test-includes' into ccase/r13b04_dev
Erlang/OTP authored
5 #
84adefa The R13B03 release.
Erlang/OTP authored
6 # The contents of this file are subject to the Erlang Public License,
7 # Version 1.1, (the "License"); you may not use this file except in
8 # compliance with the License. You should have received a copy of the
9 # Erlang Public License along with this software. If not, it can be
10 # retrieved online at http://www.erlang.org/.
141b8f2 Merge branch 'fh/common_test-includes' into ccase/r13b04_dev
Erlang/OTP authored
11 #
84adefa The R13B03 release.
Erlang/OTP authored
12 # Software distributed under the License is distributed on an "AS IS"
13 # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 # the License for the specific language governing rights and limitations
15 # under the License.
141b8f2 Merge branch 'fh/common_test-includes' into ccase/r13b04_dev
Erlang/OTP authored
16 #
84adefa The R13B03 release.
Erlang/OTP authored
17 # %CopyrightEnd%
18
19 # Toplevel makefile for building the Erlang system
20 #
21
22 # ----------------------------------------------------------------------
23
24 # And you'd think that this would be obvious... :-)
25 SHELL = /bin/sh
26
27 # The top directory in which Erlang is unpacked
28 ERL_TOP = @ERL_TOP@
29
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
30 # OTP release
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored
31 OTP = OTP-@OTP_REL@
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
32
84adefa The R13B03 release.
Erlang/OTP authored
33 # erts (Erlang RunTime System) version
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored
34 ERTS = erts-@ERTS_VSN@
84adefa The R13B03 release.
Erlang/OTP authored
35
36 # ----------------------------------------------------------------------
37
38 #
39 # The variables below control where Erlang is installed. They are
40 # configurable (unless otherwise stated). Some of them are best
41 # changed by giving special arguments to configure instead of changing
42 # them in this file. Note: If you change them in Makefile, instead of
43 # Makefile.in your changes will be lost the next time you run
44 # configure.
45 #
46
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
47 # prefix from configure, default is /usr/local (must be an absolute path)
48 prefix = @prefix@
49 exec_prefix = @exec_prefix@
84adefa The R13B03 release.
Erlang/OTP authored
50
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
51 # Locations where we should install according to configure. These location
52 # may be prefixed by $(DESTDIR) and/or $(EXTRA_PREFIX) (see below).
53 bindir = @bindir@
54 libdir = @libdir@
84adefa The R13B03 release.
Erlang/OTP authored
55
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
56 # Where Erlang/OTP is located
57 libdir_suffix = /erlang
58 erlang_libdir = $(libdir)$(libdir_suffix)
59 erlang_bindir = $(erlang_libdir)/bin
60
61 #
62 # By default we install relative symbolic links for $(ERL_BASE_PUB_FILES)
63 # from $(bindir) to $(erlang_bindir) as long as they are both prefixed
64 # by $(exec_prefix) (and are otherwise reasonable). This behavior can be
65 # overridden by passing BINDIR_SYMLINKS=<HOW>, where <HOW> is either
66 # absolute or relative.
67 #
68
69 # $ make DESTDIR=<...> install
70 #
71 # DESTDIR can be set in case you want to install Erlang in a different
72 # location than where you have configured it to run. This can be
73 # useful, e.g. when installing on a server that stores the files with a
74 # different path than where the clients access them, when building
75 # rpms, or cross compiling, etc. DESTDIR will prefix the actual
76 # installation which will only be able to run once the DESTDIR prefix
77 # has disappeard, e.g. the part after DESTDIR has been packed and
78 # unpacked without DESTDIR. The name DESTDIR have been chosen since it
79 # is the GNU coding standard way of doing it.
80 #
81 # If INSTALL_PREFIX is set but not DESTDIR, DESTDIR will be set to
82 # INSTALL_PREFIX. INSTALL_PREFIX has been buggy for a long time. It was
83 # initially intended to have the same effect as DESTDIR. This effect was,
84 # however, lost even before it was first released :-( In all released OTP
85 # versions up to R13B03, INSTALL_PREFIX has behaved as EXTRA_PREFIX do
86 # today (see below).
87
88 ifeq ($(DESTDIR),)
89 ifneq ($(INSTALL_PREFIX),)
90 DESTDIR=$(INSTALL_PREFIX)
91 endif
92 else
93 ifneq ($(INSTALL_PREFIX),)
94 ifneq ($(DESTDIR),$(INSTALL_PREFIX))
95 $(error Both DESTDIR="$(DESTDIR)" and INSTALL_PREFIX="$(INSTALL_PREFIX)" have been set and have been set differently! Please, only set one of them)
96 endif
97 endif
98 endif
99
100 # $ make EXTRA_PREFIX=<...> install
101 #
102 # EXTRA_PREFIX behaves exactly as the buggy INSTALL_PREFIX behaved in
103 # pre R13B04 releases. It adds a prefix to all installation paths which
104 # will be used by the actuall installation. That is, the installation
105 # needs to be located at this location when run. This is useful if you
106 # want to try out the system, running test suites, etc, before doing the
107 # real install using the configuration you have set up using `configure'.
108 # A similar thing can be done by overriding `prefix' if only default
109 # installation directories are used. However, the installation can get
110 # sprawled out all over the place if the user use `--bindir', `--libdir',
111 # etc, and it is possible that `prefix' wont have any effect at all. That
112 # is, it is not at all the same thing as using EXTRA_PREFIX in the
113 # general case. It is also nice to be able to supply this feature if
114 # someone should have relied on the old buggy INSTALL_PREFIX.
115
116 # The directory in which user executables (ERL_BASE_PUB_FILES) are installed
117 BINDIR = $(DESTDIR)$(EXTRA_PREFIX)$(bindir)
84adefa The R13B03 release.
Erlang/OTP authored
118
119 #
120 # Erlang base public files
121 #
5cf552a @pekadan Add run_test program for Common Test
pekadan authored
122 ERL_BASE_PUB_FILES=erl erlc epmd run_erl to_erl dialyzer typer escript run_test
84adefa The R13B03 release.
Erlang/OTP authored
123
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
124 # ERLANG_INST_LIBDIR is the top directory where the Erlang installation
125 # will be located when running.
126 ERLANG_INST_LIBDIR=$(EXTRA_PREFIX)$(erlang_libdir)
127 ERLANG_INST_BINDIR= $(ERLANG_INST_LIBDIR)/bin
84adefa The R13B03 release.
Erlang/OTP authored
128
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
129 # ERLANG_LIBDIR is the top directory where the Erlang installation is copied
130 # during installation. If DESTDIR != "", it cannot be run from this location.
131 ERLANG_LIBDIR = $(DESTDIR)$(ERLANG_INST_LIBDIR)
84adefa The R13B03 release.
Erlang/OTP authored
132
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored
133 # ----------------------------------------------------------------------
134 # This functionality has been lost along the way... :(
135 # It could perhaps be nice to reintroduce some day; therefore,
136 # it is not removed just commented out.
137
138 ## # The directory in which man pages for above executables are put
139 ## ERL_MAN1DIR = $(DESTDIR)$(EXTRA_PREFIX)@mandir@/man1
140 ## ERL_MAN1EXT = 1
141
142 ## # The directory in which Erlang private man pages are put. In order
143 ## # not to clutter up the man namespace these are by default put in the
144 ## # Erlang private directory $(ERLANG_LIBDIR)/man (\@erl_mandir\@ is set
145 ## # to $(erlang_libdir)/man). If you want to install the man pages
146 ## # together with the rest give the argument "--disable-erlang-mandir"
147 ## # when you run configure, which will set \@erl_mandir\@ to \@mandir\@.
148 ## # If you want a special suffix on the manpages set ERL_MANEXT to
149 ## # this suffix, e.g. "erl"
150 ## ERL_MANDIR = $(DESTDIR)$(EXTRA_PREFIX)@erl_mandir@
151 ## ERL_MANEXT =
84adefa The R13B03 release.
Erlang/OTP authored
152
153 # ----------------------------------------------------------------------
154
155 # Must be GNU make!
156 MAKE = @MAKE_PROG@
157
158 # This should be set to the target "arch-vendor-os"
159 export TARGET = @TARGET@
160
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
161 BOOTSTRAP_ONLY = @BOOTSTRAP_ONLY@
162
163 CROSS_COMPILING = @CROSS_COMPILING@
164 ifeq ($(CROSS_COMPILING),yes)
165 INSTALL_CROSS = -cross
166 else
167 ifneq ($(DESTDIR),)
168 INSTALL_CROSS = -cross
169 else
170 INSTALL_CROSS =
171 endif
172 endif
173
84adefa The R13B03 release.
Erlang/OTP authored
174 # A BSD compatible install program
175 INSTALL = @INSTALL@
176 INSTALL_PROGRAM = @INSTALL_PROGRAM@
177 INSTALL_DATA = @INSTALL_DATA@
178 MKSUBDIRS = ${INSTALL} -d
179
180 # Program to create symbolic links
181 LN_S = @LN_S@
182
183 # Ranlib program, if not needed set to e.g. ":"
184 RANLIB = @RANLIB@
185
186 # ----------------------------------------------------------------------
187
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
188 # By default we require an Erlang/OTP of the same release as the one
189 # we cross compile.
190 ERL_XCOMP_FORCE_DIFFERENT_OTP = no
191
192 # ----------------------------------------------------------------------
193
84adefa The R13B03 release.
Erlang/OTP authored
194 #
195 # The directory where at least the primary bootstrap is placed under.
196 #
197 # We need to build to view private files in case we are in clearcase;
198 # therefore, we don't want BOOTSTRAP_TOP changed.
199 #
200 # PRIMARY_BOOTSTRAP_TOP would perhaps have been a better name...
201 #
202 override BOOTSTRAP_TOP = $(ERL_TOP)/bootstrap
203 # BOOTSTRAP_SRC_TOP is normally the same as BOOTSTRAP_TOP but
204 # it is allowed to be changed
205 BOOTSTRAP_SRC_TOP = $(BOOTSTRAP_TOP)
206
207 # Where to install the bootstrap directory.
208 #
209 # Typically one might want to set this to a fast local filesystem, or,
210 # the default, as ERL_TOP
211 BOOTSTRAP_ROOT = $(ERL_TOP)
212
213 # Directories which you need in the path if you wish to run the
214 # locally built system. (This can be put in front or back of the path
215 # depending on which system is preferred.)
216 LOCAL_PATH = $(ERL_TOP)/erts/bin/$(TARGET):$(ERL_TOP)/erts/bin
217 ifeq ($(TARGET),win32)
218 WIN32_WRAPPER_PATH=$(ERL_TOP)/erts/etc/win32/cygwin_tools
219 BOOT_PREFIX=$(WIN32_WRAPPER_PATH):$(BOOTSTRAP_ROOT)/bootstrap/bin:
220 else
221 BOOT_PREFIX=$(BOOTSTRAP_ROOT)/bootstrap/bin:
222 endif
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
223
224 # ----------------------------------------------------------------------
225
226 # The following is currently only used for determining what to prevent
227 # usage of during strict install or release.
228 include $(ERL_TOP)/make/$(TARGET)/otp_ded.mk
229 CC = @CC@
230 LD = @LD@
231 CXX = @CXX@
232
233 IBIN_DIR = $(ERL_TOP)/ibin
234 #
235 # If $(OTP_STRICT_INSTALL) equals `yes' we prefix the PATH with $(IBIN_DIR)
236 # when doing `release' or `install'. This directory contains `erlc', `gcc',
237 # `ld' etc, that unconditionally will fail if used. This is used during the
238 # daily builds in order to pick up on things being erroneously built during
239 # the `release' and `install' phases.
240 #
241 INST_FORBID = gcc g++ cc c++ cxx cl gcc.sh cc.sh ld ld.sh
242 INST_FORBID += javac.sh javac guavac gcj jikes bock
243 INST_FORBID += $(notdir $(CC)) $(notdir $(LD)) $(notdir $(CXX))
244 INST_FORBID += $(notdir $(DED_CC)) $(notdir $(DED_LD))
245 INST_FORBID += $(ERL_BASE_PUB_FILES)
246 IBIN_FILES = $(addprefix $(IBIN_DIR)/,$(sort $(INST_FORBID))) # sort will
247 # remove
248 # duplicates
249
250 ifeq ($(OTP_STRICT_INSTALL),yes)
251
252 INST_PATH_PREFIX=$(IBIN_DIR):
253 INST_DEP = strict_install
254 ifneq ($(CROSS_COMPILING),yes)
255 INST_DEP += strict_install_all_bootstraps
256 endif
257
258 else # --- Normal case, i.e., not strict install ---
259
260 #
261 # By default we allow build during install and release phase; therefore,
262 # make sure that the bootstrap system is available in the path.
263 #
264 INST_PATH_PREFIX=$(BOOT_PREFIX)
265 # If cross compiling `erlc', in path might have be used; therefore,
266 # avoid triggering a bootstrap build...
267 INST_DEP =
268 ifneq ($(CROSS_COMPILING),yes)
269 INST_DEP += all_bootstraps
270 endif
271
272 endif # --- Normal case, i.e., not strict install ---
273
84adefa The R13B03 release.
Erlang/OTP authored
274 # ----------------------------------------------------------------------
275 # Fix up RELEASE_ROOT/TESTROOT havoc
276 ifeq ($(RELEASE_ROOT),)
277 ifneq ($(TESTROOT),)
278 RELEASE_ROOT = $(TESTROOT)
279 endif
280 endif
281
282
283 # ----------------------------------------------------------------------
284
285 # A default for the release_tests, not same target dir as release.
286 # More TESTROOT havoc...
287 ifeq ($(TESTSUITE_ROOT),)
288 ifneq ($(TESTROOT),)
289 TESTSUITE_ROOT = $(TESTROOT)
290 else
291 TESTSUITE_ROOT = $(ERL_TOP)/release/tests
292 endif
293 endif
294
295 #
296 # The steps to build a working system are:
297 # * build an emulator
298 # * setup the erl and erlc program in bootstrap/bin
299 # * build additional compilers and copy them into bootstrap/lib
300 # * use the bootstrap erl and erlc to build all the libs
301 #
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
302
303 .PHONY: all bootstrap all_bootstraps
304
305 ifneq ($(CROSS_COMPILING),yes)
306 # Not cross compiling
307
308 ifeq ($(BOOTSTRAP_ONLY),yes)
309 all: bootstrap
310 else
311 # The normal case; not cross compiling, and not bootstrap only build.
312 all: bootstrap libs local_setup dialyzer
313 endif
314
315 else
316 # Cross compiling
317
318 all: cross_check_erl depend emulator libs start_scripts dialyzer
319
320 endif
321
322 cross_check_erl:
323 @PATH=$(BOOT_PREFIX)$${PATH} $(ERL_TOP)/make/cross_check_erl \
324 -target $(TARGET) -otp $(OTP) -erl_top $(ERL_TOP) \
325 -force $(ERL_XCOMP_FORCE_DIFFERENT_OTP)
326
327 is_cross_configured:
328 @echo @CROSS_COMPILING@
329
330 target_configured:
331 @echo @TARGET@
332
333 bootstrap: depend all_bootstraps
334
335
336
337 ifeq ($(OTP_STRICT_INSTALL),yes)
338
339 .PHONY: strict_install_all_bootstraps
340
341 strict_install_all_bootstraps:
342 $(MAKE) BOOT_PREFIX=$(INST_PATH_PREFIX) OTP_STRICT_INSTALL=$(OTP_STRICT_INSTALL) all_bootstraps
343
344 endif
84adefa The R13B03 release.
Erlang/OTP authored
345
346 # With all bootstraps we mean all bootstrapping that is done when
347 # the system is delivered in open source, the primary
348 # bootstrap is not included, it requires a pre built emulator...
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
349 all_bootstraps: emulator \
84adefa The R13B03 release.
Erlang/OTP authored
350 bootstrap_setup \
351 secondary_bootstrap_build secondary_bootstrap_copy \
bb3f5af @bjorng Merge the fourth bootstrap stage into the third bootstrap stage
bjorng authored
352 tertiary_bootstrap_build tertiary_bootstrap_copy
84adefa The R13B03 release.
Erlang/OTP authored
353
354 #
355 # Use these targets when you want to use the erl and erlc
356 # binaries in your PATH instead of those created from the
357 # pre-compiled Erlang modules under bootstrap/.
358 #
359 noboot:
360 $(MAKE) BOOT_PREFIX= emulator libs local_setup
b45b616 @bjorng Makefiles: Remove stray OSE/Delta support
bjorng authored
361
84adefa The R13B03 release.
Erlang/OTP authored
362 noboot_install:
363 $(MAKE) BOOT_PREFIX= install
364
365 .PHONY: release release_docs
366
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
367 release: $(INST_DEP)
84adefa The R13B03 release.
Erlang/OTP authored
368 ifeq ($(OTP_SMALL_BUILD),true)
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
369 cd $(ERL_TOP)/lib && \
370 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
371 $(MAKE) TESTROOT=$(RELEASE_ROOT) release
84adefa The R13B03 release.
Erlang/OTP authored
372 else
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
373 cd $(ERL_TOP)/lib && \
374 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
375 $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release
84adefa The R13B03 release.
Erlang/OTP authored
376 ifneq ($(findstring vxworks,$(TARGET)),vxworks)
377 @if test -f lib/dialyzer/SKIP ; then \
378 echo "=== Skipping dialyzer, reason:" ; \
379 cat lib/dialyzer/SKIP ; \
380 echo "===" ; \
381 else \
382 cd $(ERL_TOP)/lib/dialyzer && \
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
383 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
384 $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release ; \
84adefa The R13B03 release.
Erlang/OTP authored
385 fi
386 endif
387 endif
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
388 cd $(ERL_TOP)/erts && \
389 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
390 $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release
84adefa The R13B03 release.
Erlang/OTP authored
391
392 # ---------------------------------------------------------------
393 # Target only used when building commercial ERTS patches
394 # ---------------------------------------------------------------
2f93254 Prepare erl_docgen for using Dialyzer specs and types
Hans Bolinder authored
395 release_docs docs: mod2app
84adefa The R13B03 release.
Erlang/OTP authored
396 ifeq ($(OTP_SMALL_BUILD),true)
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored
397 cd $(ERL_TOP)/lib && \
92bbb54 @bufflig Teach toplevel makefile to always use newly built escript.
bufflig authored
398 PATH=$(ERL_TOP)/bin:$${PATH} ERL_TOP=$(ERL_TOP) \
399 $(MAKE) TESTROOT=$(RELEASE_ROOT) $@
84adefa The R13B03 release.
Erlang/OTP authored
400 else
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored
401 cd $(ERL_TOP)/lib && \
92bbb54 @bufflig Teach toplevel makefile to always use newly built escript.
bufflig authored
402 PATH=$(ERL_TOP)/bin:$${PATH} ERL_TOP=$(ERL_TOP) \
403 $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored
404 cd $(ERL_TOP)/lib/dialyzer && \
92bbb54 @bufflig Teach toplevel makefile to always use newly built escript.
bufflig authored
405 PATH=$(ERL_TOP)/bin:$${PATH} ERL_TOP=$(ERL_TOP) \
406 $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@
84adefa The R13B03 release.
Erlang/OTP authored
407 endif
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored
408 cd $(ERL_TOP)/erts && \
92bbb54 @bufflig Teach toplevel makefile to always use newly built escript.
bufflig authored
409 PATH=$(ERL_TOP)/bin:$${PATH} ERL_TOP=$(ERL_TOP) \
410 $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored
411 cd $(ERL_TOP)/system/doc && \
92bbb54 @bufflig Teach toplevel makefile to always use newly built escript.
bufflig authored
412 PATH=$(ERL_TOP)/bin:$${PATH} \
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored
413 ERL_TOP=$(ERL_TOP) $(MAKE) TESTROOT=$(RELEASE_ROOT) $@
414
92bbb54 @bufflig Teach toplevel makefile to always use newly built escript.
bufflig authored
415 mod2app:
416 PATH=$(ERL_TOP)/bin:$${PATH} escript $(ERL_TOP)/lib/erl_docgen/priv/bin/xref_mod_app.escript -topdir $(ERL_TOP) -outfile $(ERL_TOP)/make/$(TARGET)/mod2app.xml
2f93254 Prepare erl_docgen for using Dialyzer specs and types
Hans Bolinder authored
417
84adefa The R13B03 release.
Erlang/OTP authored
418 # ----------------------------------------------------------------------
419 ERLANG_EARS=$(BOOTSTRAP_ROOT)/bootstrap/erts
420 ELINK=$(BOOTSTRAP_ROOT)/bootstrap/erts/bin/elink
421 BOOT_BINDIR=$(BOOTSTRAP_ROOT)/bootstrap/erts/bin
422 BEAM_EVM=$(ERL_TOP)/bin/$(TARGET)/beam_evm
423 BOOTSTRAP_COMPILER = $(BOOTSTRAP_TOP)/primary_compiler
424
425 .PHONY: emulator libs kernel stdlib compiler hipe dialyzer typer syntax_tools preloaded
426
427 emulator:
428 cd erts && ERL_TOP=$(ERL_TOP) $(MAKE) NO_START_SCRIPTS=true $(TYPE) FLAVOR=$(FLAVOR)
429
430 libs:
431 ifeq ($(OTP_SMALL_BUILD),true)
432 cd lib && \
433 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
434 $(MAKE) opt
435 else
436 cd lib && \
437 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
438 $(MAKE) opt BUILD_ALL=true
439 endif
440 kernel:
441 cd lib/kernel && \
442 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
443 $(MAKE) opt BUILD_ALL=true
444
445 stdlib:
446 cd lib/stdlib && \
447 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
448 $(MAKE) opt BUILD_ALL=true
449
450 compiler:
451 cd lib/compiler && \
452 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
453 $(MAKE) opt BUILD_ALL=true
454
455 hipe:
456 cd lib/hipe && \
457 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
458 $(MAKE) opt BUILD_ALL=true
459
460 dialyzer:
461 ifneq ($(OTP_SMALL_BUILD),true)
462 @if test -f lib/dialyzer/SKIP ; then \
463 echo "=== Skipping dialyzer, reason:" ; \
464 cat lib/dialyzer/SKIP ; \
465 echo "===" ; \
466 else \
467 cd lib/dialyzer && \
468 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
469 $(MAKE) opt BUILD_ALL=true ; \
470 fi
471 endif
472
473 typer:
474 cd lib/typer && \
475 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
476 $(MAKE) opt BUILD_ALL=true
477
478 syntax_tools:
479 cd lib/syntax_tools && \
480 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
481 $(MAKE) opt BUILD_ALL=true
482
483 preloaded:
484 cd erts/preloaded/src && \
485 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
486 $(MAKE) opt BUILD_ALL=true
487
488 dep depend:
489 test X"$$ERTS_SKIP_DEPEND" = X"true" || (cd erts/emulator && ERL_TOP=$(ERL_TOP) $(MAKE) generate depend)
490 test X"$$ERTS_SKIP_DEPEND" = X"true" || (cd erts/lib_src && ERL_TOP=$(ERL_TOP) $(MAKE) depend)
491
492 # Creates "erl" and "erlc" in bootstrap/bin which uses the precompiled
493 # libraries in the bootstrap directory
494
958d346 @rickard-green Regenerate bootstrap/{erl,erlc} when switching target
rickard-green authored
495 .PHONY: bootstrap_setup_target
496
84adefa The R13B03 release.
Erlang/OTP authored
497 # ----------------------------------------------------------------------
498 # Bootstraps...
499 # ----------------------------------------------------------------------
500 ifeq ($(TARGET),win32)
958d346 @rickard-green Regenerate bootstrap/{erl,erlc} when switching target
rickard-green authored
501 bootstrap_setup: check_recreate_primary_bootstrap bootstrap_setup_target
84adefa The R13B03 release.
Erlang/OTP authored
502 @rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erl.exe \
503 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc.exe \
88d149a @bufflig Add escript to bootstrap/bin
bufflig authored
504 $(BOOTSTRAP_ROOT)/bootstrap/bin/escript.exe \
84adefa The R13B03 release.
Erlang/OTP authored
505 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl.ini \
506 $(BOOTSTRAP_ROOT)/bootstrap/bin/beam.dll
507 make_bootstrap_ini.sh $(BOOTSTRAP_ROOT)/bootstrap \
508 $(ERL_TOP)/bin/$(TARGET)
509 @cp $(ERL_TOP)/bin/$(TARGET)/erlc.exe \
510 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc.exe
511 @cp $(ERL_TOP)/bin/$(TARGET)/erl.exe \
512 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl.exe
88d149a @bufflig Add escript to bootstrap/bin
bufflig authored
513 @cp $(ERL_TOP)/bin/$(TARGET)/escript.exe \
514 $(BOOTSTRAP_ROOT)/bootstrap/bin/escript.exe
84adefa The R13B03 release.
Erlang/OTP authored
515 else
88d149a @bufflig Add escript to bootstrap/bin
bufflig authored
516 bootstrap_setup: check_recreate_primary_bootstrap bootstrap_setup_target $(BOOTSTRAP_ROOT)/bootstrap/bin/erl $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc $(BOOTSTRAP_ROOT)/bootstrap/bin/escript
84adefa The R13B03 release.
Erlang/OTP authored
517
958d346 @rickard-green Regenerate bootstrap/{erl,erlc} when switching target
rickard-green authored
518 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl: $(ERL_TOP)/erts/etc/unix/erl.src.src $(BOOTSTRAP_ROOT)/bootstrap/target
84adefa The R13B03 release.
Erlang/OTP authored
519 @rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erl
520 @sed -e "s;%FINAL_ROOTDIR%;$(BOOTSTRAP_ROOT)/bootstrap;" \
521 -e "s;\$$ROOTDIR/erts-.*/bin;$(ERL_TOP)/bin/$(TARGET);" \
522 -e "s;EMU=.*;EMU=beam$(TYPEMARKER);" \
523 $(ERL_TOP)/erts/etc/unix/erl.src.src > \
524 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl
525 @chmod 755 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl
526
958d346 @rickard-green Regenerate bootstrap/{erl,erlc} when switching target
rickard-green authored
527 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc: $(ERL_TOP)/bin/$(TARGET)/erlc $(BOOTSTRAP_ROOT)/bootstrap/target
84adefa The R13B03 release.
Erlang/OTP authored
528 @rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
529 @cp $(ERL_TOP)/bin/$(TARGET)/erlc $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
530 @chmod 755 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
88d149a @bufflig Add escript to bootstrap/bin
bufflig authored
531
532 $(BOOTSTRAP_ROOT)/bootstrap/bin/escript: $(ERL_TOP)/bin/$(TARGET)/escript $(BOOTSTRAP_ROOT)/bootstrap/target
533 @rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/escript
534 @cp $(ERL_TOP)/bin/$(TARGET)/escript $(BOOTSTRAP_ROOT)/bootstrap/bin/escript
535 @chmod 755 $(BOOTSTRAP_ROOT)/bootstrap/bin/escript
84adefa The R13B03 release.
Erlang/OTP authored
536 endif
537
958d346 @rickard-green Regenerate bootstrap/{erl,erlc} when switching target
rickard-green authored
538 bootstrap_setup_target:
539 @{ test -r $(BOOTSTRAP_ROOT)/bootstrap/target && \
540 test $(TARGET) = `cat $(BOOTSTRAP_ROOT)/bootstrap/target`; } || \
541 echo $(TARGET) > $(BOOTSTRAP_ROOT)/bootstrap/target
542
84adefa The R13B03 release.
Erlang/OTP authored
543 secondary_bootstrap_build:
544 cd lib && \
545 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
546 $(MAKE) opt SECONDARY_BOOTSTRAP=true
547
548 secondary_bootstrap_copy:
549 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe ; fi
550 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin ; fi
551 for x in lib/hipe/ebin/*.beam; do \
552 BN=`basename $$x`; \
553 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin/$$BN; \
554 test -f $$TF && \
555 test '!' -z "`find $$x -newer $$TF -print`" && \
556 cp $$x $$TF; \
557 test '!' -f $$TF && \
558 cp $$x $$TF; \
559 true; \
560 done
561 # if test -f lib/hipe/ebin/hipe.beam ; then cp lib/hipe/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin; fi
562 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; fi
563 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; fi
564 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include ; fi
d1242b0 @bjorng Remove lib/orber/include/* from the primary bootstrap
bjorng authored
565 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/orber ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/orber ; fi
566 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/orber/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/orber/include ; fi
84adefa The R13B03 release.
Erlang/OTP authored
567 for x in lib/parsetools/ebin/*.beam; do \
568 BN=`basename $$x`; \
569 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin/$$BN; \
570 test -f $$TF && \
571 test '!' -z "`find $$x -newer $$TF -print`" && \
572 cp $$x $$TF; \
573 test '!' -f $$TF && \
574 cp $$x $$TF; \
575 true; \
576 done
577 # cp lib/parsetools/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin
578 for x in lib/parsetools/include/*.hrl; do \
579 BN=`basename $$x`; \
580 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include/$$BN; \
581 test -f $$TF && \
582 test '!' -z "`find $$x -newer $$TF -print`" && \
583 cp $$x $$TF; \
584 test '!' -f $$TF && \
585 cp $$x $$TF; \
586 true; \
587 done
588 # cp -f lib/parsetools/include/*.hrl $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include
589 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1 ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1 ; fi
590 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin ; fi
591 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src ; fi
592 for x in lib/asn1/ebin/*.beam; do \
593 BN=`basename $$x`; \
594 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin/$$BN; \
595 test -f $$TF && \
596 test '!' -z "`find $$x -newer $$TF -print`" && \
597 cp $$x $$TF; \
598 test '!' -f $$TF && \
599 cp $$x $$TF; \
600 true; \
601 done
602 # cp lib/asn1/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin
603 for x in lib/asn1/src/*.[eh]rl; do \
604 BN=`basename $$x`; \
605 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src/$$BN; \
606 test -f $$TF && \
607 test '!' -z "`find $$x -newer $$TF -print`" && \
608 cp $$x $$TF; \
609 test '!' -f $$TF && \
610 cp $$x $$TF; \
611 true; \
612 done
613 # cp -f lib/asn1/src/*.erl lib/asn1/src/*.hrl $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src
d1242b0 @bjorng Remove lib/orber/include/* from the primary bootstrap
bjorng authored
614 for x in lib/orber/include/*.hrl; do \
615 BN=`basename $$x`; \
616 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/orber/include/$$BN; \
617 test -f $$TF && \
618 test '!' -z "`find $$x -newer $$TF -print`" && \
619 cp $$x $$TF; \
620 test '!' -f $$TF && \
621 cp $$x $$TF; \
622 true; \
623 done
84adefa The R13B03 release.
Erlang/OTP authored
624
625 tertiary_bootstrap_build:
626 cd lib && \
627 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
628 $(MAKE) opt TERTIARY_BOOTSTRAP=true
629
630 tertiary_bootstrap_copy:
631 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp ; fi
632 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin ; fi
633 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/include ; fi
634 for x in lib/snmp/ebin/*.beam; do \
635 BN=`basename $$x`; \
636 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin/$$BN; \
637 test -f $$TF && \
638 test '!' -z "`find $$x -newer $$TF -print`" && \
639 cp $$x $$TF; \
640 test '!' -f $$TF && \
641 cp $$x $$TF; \
642 true; \
643 done
644 # cp lib/snmp/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin
645 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl ; fi
646 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin ; fi
647 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/include ; fi
648 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/ic ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/ic ; fi
649 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin ; fi
650 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include ; fi
651 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx ; fi
652 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/ebin ; fi
653 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/include ; fi
4bcf607 @bjorng Include test_servers's include files in the bootstrap
bjorng authored
654 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server ; fi
655 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server/include ; fi
84adefa The R13B03 release.
Erlang/OTP authored
656 for x in lib/ic/ebin/*.beam; do \
657 BN=`basename $$x`; \
658 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin/$$BN; \
659 test -f $$TF && \
660 test '!' -z "`find $$x -newer $$TF -print`" && \
661 cp $$x $$TF; \
662 test '!' -f $$TF && \
663 cp $$x $$TF; \
664 true; \
665 done
666 # cp lib/ic/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin
667 for x in lib/ic/include/*.idl; do \
668 BN=`basename $$x`; \
669 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include/$$BN; \
670 test -f $$TF && \
671 test '!' -z "`find $$x -newer $$TF -print`" && \
672 cp $$x $$TF; \
673 test '!' -f $$TF && \
674 cp $$x $$TF; \
675 true; \
676 done
677 for x in lib/ic/include/*.h; do \
678 BN=`basename $$x`; \
679 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include/$$BN; \
680 test -f $$TF && \
681 test '!' -z "`find $$x -newer $$TF -print`" && \
682 cp $$x $$TF; \
683 test '!' -f $$TF && \
684 cp $$x $$TF; \
685 true; \
686 done
687 # cp -f lib/ic/include/*.idl lib/ic/include/*.h $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include
688 for x in lib/sasl/ebin/*.beam; do \
689 BN=`basename $$x`; \
690 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin/$$BN; \
691 test -f $$TF && \
692 test '!' -z "`find $$x -newer $$TF -print`" && \
693 cp $$x $$TF; \
694 test '!' -f $$TF && \
695 cp $$x $$TF; \
696 true; \
697 done
698 # cp lib/sasl/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin
699 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools ; fi
700 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin ; fi
701 for x in lib/syntax_tools/ebin/*.beam; do \
702 BN=`basename $$x`; \
703 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin/$$BN; \
704 test -f $$TF && \
705 test '!' -z "`find $$x -newer $$TF -print`" && \
706 cp $$x $$TF; \
707 test '!' -f $$TF && \
708 cp $$x $$TF; \
709 true; \
710 done
711 for x in lib/wx/include/*.hrl; do \
712 BN=`basename $$x`; \
713 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/wx/include/$$BN; \
714 test -f $$TF && \
715 test '!' -z "`find $$x -newer $$TF -print`" && \
716 cp $$x $$TF; \
717 test '!' -f $$TF && \
718 cp $$x $$TF; \
719 true; \
720 done
4bcf607 @bjorng Include test_servers's include files in the bootstrap
bjorng authored
721 for x in lib/test_server/include/*.hrl; do \
722 BN=`basename $$x`; \
723 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/test_server/include/$$BN; \
724 test -f $$TF && \
725 test '!' -z "`find $$x -newer $$TF -print`" && \
726 cp $$x $$TF; \
727 test '!' -f $$TF && \
728 cp $$x $$TF; \
729 true; \
730 done
84adefa The R13B03 release.
Erlang/OTP authored
731 # cp lib/syntax_tools/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin
732
733 .PHONY: check_recreate_primary_bootstrap recreate_primary_bootstrap
734
735
736 #
737 # If the source is a prebuilt delivery, no $(ERL_TOP)/bootstrap/lib
738 # directory will exist. All applications part of the primary bootstrap
739 # are delivered prebuilt though. If it is a prebuilt delivery we need
740 # to recreate the primary bootstrap, from the prebuilt result.
741 #
742 # A prebuild delivery always contain a $(ERL_TOP)/prebuilt.files file.
743 # If no such file exists, we wont try to recreate the primary bootstrap,
744 # since it will just fail producing anything useful.
745 #
746
747 check_recreate_primary_bootstrap:
748 @if test -f $(ERL_TOP)/prebuilt.files ; then \
749 if test ! -d $(ERL_TOP)/bootstrap/lib ; then \
750 $(ERL_TOP)/otp_build save_bootstrap ; \
751 fi ; \
752 fi
753
754 #
755 # recreate_primary_bootstrap assumes that if $(ERL_TOP)/prebuilt.files
756 # exist, all build results needed already exist in the application specific
757 # directories of all applications part of the primary bootstrap.
758 #
759 recreate_primary_bootstrap:
760 $(ERL_TOP)/otp_build save_bootstrap
761
762 # The first bootstrap build is rarely (never) used in open source, it's
763 # used to build the shipped bootstrap directory. The Open source bootstrap
764 # stages start with secondary bootstrap.
765 #
766 # These are the ones used, the other ones (prefixed with old_) are for BC.
767
768 # These modules should stay in the kernel directory to make building
769 # of the emulator possible
770
771 .PHONY: primary_bootstrap \
772 primary_bootstrap_build \
773 primary_bootstrap_compiler \
774 primary_bootstrap_mkdirs \
775 primary_bootstrap_copy
776
1e294a3 @bjorng Top-level Makefile: Remove clearmake support
bjorng authored
777 primary_bootstrap:
84adefa The R13B03 release.
Erlang/OTP authored
778 @echo "=== Building a bootstrap compiler in $(BOOTSTRAP_ROOT)/bootstrap"
1e294a3 @bjorng Top-level Makefile: Remove clearmake support
bjorng authored
779 $(MAKE) BOOTSTRAP_ROOT=$(BOOTSTRAP_ROOT) \
780 ERL_TOP=$(ERL_TOP) \
781 bootstrap_clean
84adefa The R13B03 release.
Erlang/OTP authored
782 cd $(ERL_TOP) && \
783 $(MAKE) TESTROOT=$(BOOTSTRAP_TOP) \
784 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
785 primary_bootstrap_build
786 cd $(ERL_TOP) && \
787 $(MAKE) TESTROOT=$(BOOTSTRAP_TOP) \
788 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
789 primary_bootstrap_copy
790 cd $(ERL_TOP)/erts/start_scripts && \
791 $(MAKE) TESTROOT=$(BOOTSTRAP_TOP) \
792 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) bootstrap_scripts
793 test $(BOOTSTRAP_ROOT) = $(ERL_TOP) \
794 || $(ERL_TOP)/otp_build \
795 copy_primary_bootstrap \
796 $(BOOTSTRAP_TOP) \
797 $(BOOTSTRAP_ROOT)
798
799 primary_bootstrap_build: primary_bootstrap_mkdirs primary_bootstrap_compiler \
800 primary_bootstrap_stdlib
801 cd lib && $(MAKE) ERLC_FLAGS='-pa $(BOOTSTRAP_COMPILER)/ebin' \
802 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
803 BOOTSTRAP=1 opt
804
805 primary_bootstrap_compiler:
806 cd lib/compiler && $(MAKE) \
807 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
808 BOOTSTRAP_COMPILER=$(BOOTSTRAP_COMPILER) \
809 BOOTSTRAP=1 \
810 opt
811
812 primary_bootstrap_stdlib:
813 cd lib/stdlib/src && $(MAKE) \
814 BOOTSTRAP_COMPILER=$(BOOTSTRAP_COMPILER) \
815 primary_bootstrap_compiler
816
817 primary_bootstrap_mkdirs:
818 test -d $(BOOTSTRAP_COMPILER)/egen \
819 || mkdir -p $(BOOTSTRAP_COMPILER)/egen
820 test -d $(BOOTSTRAP_COMPILER)/ebin \
821 || mkdir -p $(BOOTSTRAP_COMPILER)/ebin
822 test -d $(BOOTSTRAP_TOP)/lib/kernel/egen \
823 || mkdir -p $(BOOTSTRAP_TOP)/lib/kernel/egen
824 test -d $(BOOTSTRAP_TOP)/lib/kernel/ebin \
825 || mkdir -p $(BOOTSTRAP_TOP)/lib/kernel/ebin
826 test -d $(BOOTSTRAP_TOP)/lib/kernel/include \
827 || mkdir -p $(BOOTSTRAP_TOP)/lib/kernel/include
828 test -d $(BOOTSTRAP_TOP)/lib/stdlib/egen \
829 || mkdir -p $(BOOTSTRAP_TOP)/lib/stdlib/egen
830 test -d $(BOOTSTRAP_TOP)/lib/stdlib/ebin \
831 || mkdir -p $(BOOTSTRAP_TOP)/lib/stdlib/ebin
832 test -d $(BOOTSTRAP_TOP)/lib/stdlib/include \
833 || mkdir -p $(BOOTSTRAP_TOP)/lib/stdlib/include
834 test -d $(BOOTSTRAP_TOP)/lib/compiler/egen \
835 || mkdir -p $(BOOTSTRAP_TOP)/lib/compiler/egen
836 test -d $(BOOTSTRAP_TOP)/lib/compiler/ebin \
837 || mkdir -p $(BOOTSTRAP_TOP)/lib/compiler/ebin
838 test -d $(BOOTSTRAP_TOP)/lib/orber/include \
839 || mkdir -p $(BOOTSTRAP_TOP)/lib/orber/include
840
841 primary_bootstrap_copy:
842 cp -f lib/kernel/include/*.hrl $(BOOTSTRAP_TOP)/lib/kernel/include
843 cp -f lib/stdlib/include/*.hrl $(BOOTSTRAP_TOP)/lib/stdlib/include
844 cp -f lib/orber/include/* $(BOOTSTRAP_TOP)/lib/orber/include
845
846 # To remove modules left by the bootstrap building, but leave (restore)
847 # the modules in kernel which are needed for an emulator build
848 KERNEL_PRELOAD = otp_ring0 init erl_prim_loader prim_inet prim_file zlib prim_zip erlang
849 KERNEL_PRELOAD_BEAMS=$(KERNEL_PRELOAD:%=$(BOOTSTRAP_TOP)/lib/kernel/ebin/%.beam)
850
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
851 start_scripts:
852 @cd erts/start_scripts \
853 && ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} $(MAKE) script
854
84adefa The R13B03 release.
Erlang/OTP authored
855 # Creates "erl" and "erlc" scripts in bin/erl which uses the libraries in lib
856 local_setup:
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
857 @rm -f bin/erl bin/erlc bin/cerl
84adefa The R13B03 release.
Erlang/OTP authored
858 @cd erts && \
859 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
860 $(MAKE) local_setup
861
862
863
864 # ----------------------------------------------------------------------
865 # Build tests
866 # ---------------------------------------------------------------------
867
868 TEST_DIRS := \
869 lib/test_server \
870 $(wildcard lib/*/test) \
871 erts/test \
872 erts/epmd/test \
873 erts/emulator/test
874
875 .PHONY: tests release_tests $(TEST_DIRS)
876
877 tests release_tests: $(TEST_DIRS)
878
879 $(TEST_DIRS):
880 if test -f $@/Makefile; then \
881 (cd $@; $(MAKE) TESTROOT=$(TESTSUITE_ROOT) release_tests) || exit $$?; \
882 fi
883
884 # ----------------------------------------------------------------------
885 # Obsolete type of bootstrap where all stages where built with installed sytem
886 # shuld no longer be used and is soon to be removed.
887 # Abbreviations: OC = Old Compiler, NC = New Compiler,
888 # OE = Old Emulator, NE = New Emulator
889
890 old_com_bootstrap: old_bootstrap_nc_for_ne_all_stages old_bootstrap_ne old_bootstrap_scripts
891
892 #
893 # Builds the New Compiler for the New Emulator (using existing erlc
894 # and possibly new compiler) then copy everything to the release area.
895 # Use to create the commerciall bootstrap version, which should be obsolete.
896 #
897 old_bootstrap_nc_for_ne_all_stages:
898 test -d $(TESTROOT) || mkdir -p $(TESTROOT)
899 cd lib && $(MAKE) BOOTSTRAP=1 TYPE=release release
900 cd lib && $(MAKE) SECONDARY_BOOTSTRAP=1 TYPE=release release
901 cd lib && $(MAKE) TERTIARY_BOOTSTRAP=1 TYPE=release release
902
903
904
905 old_bootstrap_ne:
906 cd erts && $(MAKE) release
907
908 old_bootstrap_scripts:
909 cd erts/start_scripts && $(MAKE) release
910
911
912 # This is one strange name for a target, this actually builds and strips only
913 # the primary bootstrap, a minimal set of beam files to be able to continue
914 # bootstrap builds. It's used by other makefiles, so I refrain from
915 # changing the name right now...
916 bootstrap_nc_for_ne_no_debug_sym:
917 test -d $(TESTROOT) || mkdir -p $(TESTROOT)
918 cd lib && $(MAKE) ERLC_FLAGS='-pa $(BOOTSTRAP_COMPILER)/ebin' \
919 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) BOOTSTRAP=1 TYPE=release release
920 $(ERL_TOP)/erts/emulator/utils/beam_strip $(TESTROOT)/lib/*/ebin/*.beam
921
922 # ----------------------------------------------------------------------
923
924 #
925 # Install
926 #
927 # Order is important here, don't change it!
928 #
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
929 INST_DEP += install.dirs install.emulator install.libs install.Install install.bin
930
931 install: $(INST_DEP)
84adefa The R13B03 release.
Erlang/OTP authored
932
df88b47 @lthor OTP-8343 The documentation is now possible to build in an open source
lthor authored
933 install-docs:
934 ERL_TOP=$(ERL_TOP) INSTALLROOT=$(ERLANG_LIBDIR) PATH=$(BOOT_PREFIX)$${PATH} \
935 $(MAKE) RELEASE_ROOT=$(ERLANG_LIBDIR) release_docs
936
937
84adefa The R13B03 release.
Erlang/OTP authored
938 install.emulator:
939 cd erts && \
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
940 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
84adefa The R13B03 release.
Erlang/OTP authored
941 $(MAKE) TESTROOT=$(ERLANG_LIBDIR) release
942
943 install.libs:
944 ifeq ($(OTP_SMALL_BUILD),true)
945 cd lib && \
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
946 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
84adefa The R13B03 release.
Erlang/OTP authored
947 $(MAKE) TESTROOT=$(ERLANG_LIBDIR) release
948 else
949 cd lib && \
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
950 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
84adefa The R13B03 release.
Erlang/OTP authored
951 $(MAKE) TESTROOT=$(ERLANG_LIBDIR) BUILD_ALL=true release
952 @if test -f lib/dialyzer/SKIP ; then \
953 echo "=== Skipping dialyzer, reason:" ; \
954 cat lib/dialyzer/SKIP ; \
955 echo "===" ; \
956 else \
957 cd lib/dialyzer && \
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
958 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
84adefa The R13B03 release.
Erlang/OTP authored
959 $(MAKE) TESTROOT=$(ERLANG_LIBDIR) BUILD_ALL=true release ; \
960 fi
961 endif
962
963 install.Install:
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
964 (cd $(ERLANG_LIBDIR) \
965 && ./Install $(INSTALL_CROSS) -minimal $(ERLANG_INST_LIBDIR))
84adefa The R13B03 release.
Erlang/OTP authored
966
967 #
968 # Install erlang base public files
969 #
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
970
84adefa The R13B03 release.
Erlang/OTP authored
971 install.bin:
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
972 @ DESTDIR="$(DESTDIR)" EXTRA_PREFIX="$(EXTRA_PREFIX)" \
973 LN_S="$(LN_S)" BINDIR_SYMLINKS="$(BINDIR_SYMLINKS)" \
974 $(ERL_TOP)/make/install_bin \
975 --bindir "$(bindir)" \
976 --erlang-bindir "$(erlang_bindir)" \
977 --exec-prefix "$(exec_prefix)" \
978 $(ERL_BASE_PUB_FILES)
84adefa The R13B03 release.
Erlang/OTP authored
979
980 #
981 # Directories needed before we can install
982 #
983 install.dirs:
984 test -d $(BINDIR) || ${MKSUBDIRS} $(BINDIR)
985 ${MKSUBDIRS} $(ERLANG_LIBDIR)
986 ${MKSUBDIRS} $(ERLANG_LIBDIR)/usr/lib
987
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
988 .PHONY: strict_install
989
990 strict_install: $(IBIN_DIR) $(IBIN_FILES)
991
992 $(IBIN_FILES): $(ERL_TOP)/make/unexpected_use
993 rm -f $@
994 (cd $(dir $@) && $(LN_S) $(ERL_TOP)/make/unexpected_use $(notdir $@))
995
996 $(IBIN_DIR):
997 $(MKSUBDIRS) $@
998
84adefa The R13B03 release.
Erlang/OTP authored
999 # ----------------------------------------------------------------------
1000
1001 .PHONY: clean eclean bootstrap_root_clean bootstrap_clean
1002
1003 #
1004 # Clean targets
1005 #
1006
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored
1007 clean: check_recreate_primary_bootstrap
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored
1008 rm -f *~ *.bak config.log config.status prebuilt.files ibin/*
84adefa The R13B03 release.
Erlang/OTP authored
1009 find . -type f -name SKIP -print | xargs $(RM)
1010 cd erts && ERL_TOP=$(ERL_TOP) $(MAKE) clean
1011 cd lib && ERL_TOP=$(ERL_TOP) $(MAKE) clean BUILD_ALL=true
1012 cd lib/dialyzer && ERL_TOP=$(ERL_TOP) $(MAKE) clean
1013
1014 #
1015 # Just wipe out emulator, not libraries
1016 #
1017
1018 eclean:
1019 cd erts && ERL_TOP=$(ERL_TOP) $(MAKE) clean
1020
1021 #
1022 # Clean up bootstrap
1023 #
1024
1025 bootstrap_root_clean:
1026 rm -f $(BOOTSTRAP_ROOT)/bootstrap/lib/*/ebin/*.beam
1027 rm -f $(BOOTSTRAP_ROOT)/bootstrap/lib/*/include/*.hrl
1028 rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/*.*
1029
1030 # $(ERL_TOP)/bootstrap *should* equal $(BOOTSTRAP_TOP)
1031 #
1032 # We use $(ERL_TOP)/bootstrap instead of $(BOOTSTRAP_TOP) here as an
1033 # extra safety precaution (we would really make a mess if
1034 # $(BOOTSTRAP_TOP) for some reason should be empty).
1035 bootstrap_clean:
1036 rm -f $(ERL_TOP)/bootstrap/lib/*/ebin/*.beam
d0c862a @bjorng Fix building of primary bootstrap when versions have changed
bjorng authored
1037 rm -f $(ERL_TOP)/bootstrap/lib/*/ebin/*.app
84adefa The R13B03 release.
Erlang/OTP authored
1038 rm -f $(ERL_TOP)/bootstrap/lib/*/egen/*
1039 rm -f $(ERL_TOP)/bootstrap/lib/*/include/*.hrl
1040 rm -f $(ERL_TOP)/bootstrap/primary_compiler/ebin/*
1041 rm -f $(ERL_TOP)/bootstrap/primary_compiler/egen/*
1042 rm -f $(ERL_TOP)/bootstrap/bin/*.*
1043 rm -f $(KERNEL_PRELOAD:%=$(ERL_TOP)/lib/kernel/ebin/%.beam)
1044 test $(BOOTSTRAP_ROOT) = $(ERL_TOP) \
1045 || $(MAKE) BOOTSTRAP_ROOT=$(BOOTSTRAP_ROOT) bootstrap_root_clean
1046
1047 # ----------------------------------------------------------------------
Something went wrong with that request. Please try again.