Skip to content
Newer
Older
100644 1030 lines (875 sloc) 34.8 KB
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
1 #
2 # %CopyrightBegin%
141b8f2 Merge branch 'fh/common_test-includes' into ccase/r13b04_dev
Erlang/OTP authored Jan 19, 2010
3 #
4 # Copyright Ericsson AB 1998-2010. All Rights Reserved.
5 #
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
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 Jan 19, 2010
11 #
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
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 Jan 19, 2010
16 #
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
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 Feb 3, 2010
30 # OTP release
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
31 OTP = OTP-@OTP_REL@
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
32
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
33 # erts (Erlang RunTime System) version
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
34 ERTS = erts-@ERTS_VSN@
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
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 Feb 3, 2010
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 Nov 20, 2009
50
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
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 Nov 20, 2009
55
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
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 Nov 20, 2009
118
119 #
120 # Erlang base public files
121 #
5cf552a @pekadan Add run_test program for Common Test
pekadan authored May 24, 2010
122 ERL_BASE_PUB_FILES=erl erlc epmd run_erl to_erl dialyzer typer escript run_test
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
123
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
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 Nov 20, 2009
128
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
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 Nov 20, 2009
132
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
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 Nov 20, 2009
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 Feb 3, 2010
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 Nov 20, 2009
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 Feb 3, 2010
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 Nov 20, 2009
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 Feb 3, 2010
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 Nov 20, 2009
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 Feb 3, 2010
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 Nov 20, 2009
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 Feb 3, 2010
349 all_bootstraps: emulator \
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
350 bootstrap_setup \
351 secondary_bootstrap_build secondary_bootstrap_copy \
352 tertiary_bootstrap_build tertiary_bootstrap_copy \
353 fourth_bootstrap_build fourth_bootstrap_copy
354
355 #
356 # Use these targets when you want to use the erl and erlc
357 # binaries in your PATH instead of those created from the
358 # pre-compiled Erlang modules under bootstrap/.
359 #
360 noboot:
361 $(MAKE) BOOT_PREFIX= emulator libs local_setup
b45b616 @bjorng Makefiles: Remove stray OSE/Delta support
bjorng authored Apr 13, 2010
362
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
363 noboot_install:
364 $(MAKE) BOOT_PREFIX= install
365
366 .PHONY: release release_docs
367
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
368 release: $(INST_DEP)
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
369 ifeq ($(OTP_SMALL_BUILD),true)
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
370 cd $(ERL_TOP)/lib && \
371 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
372 $(MAKE) TESTROOT=$(RELEASE_ROOT) release
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
373 else
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
374 cd $(ERL_TOP)/lib && \
375 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
376 $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
377 ifneq ($(findstring vxworks,$(TARGET)),vxworks)
378 @if test -f lib/dialyzer/SKIP ; then \
379 echo "=== Skipping dialyzer, reason:" ; \
380 cat lib/dialyzer/SKIP ; \
381 echo "===" ; \
382 else \
383 cd $(ERL_TOP)/lib/dialyzer && \
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
384 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
385 $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release ; \
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
386 fi
387 endif
388 endif
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
389 cd $(ERL_TOP)/erts && \
390 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
391 $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
392
393 # ---------------------------------------------------------------
394 # Target only used when building commercial ERTS patches
395 # ---------------------------------------------------------------
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
396 release_docs docs:
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
397 ifeq ($(OTP_SMALL_BUILD),true)
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
398 cd $(ERL_TOP)/lib && \
399 ERL_TOP=$(ERL_TOP) $(MAKE) TESTROOT=$(RELEASE_ROOT) $@
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
400 else
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
401 cd $(ERL_TOP)/lib && \
402 ERL_TOP=$(ERL_TOP) $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@
403 cd $(ERL_TOP)/lib/dialyzer && \
404 ERL_TOP=$(ERL_TOP) $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
405 endif
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
406 cd $(ERL_TOP)/erts && \
407 ERL_TOP=$(ERL_TOP) $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@
408 cd $(ERL_TOP)/system/doc && \
409 ERL_TOP=$(ERL_TOP) $(MAKE) TESTROOT=$(RELEASE_ROOT) $@
410
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
411 # ----------------------------------------------------------------------
412 ERLANG_EARS=$(BOOTSTRAP_ROOT)/bootstrap/erts
413 ELINK=$(BOOTSTRAP_ROOT)/bootstrap/erts/bin/elink
414 BOOT_BINDIR=$(BOOTSTRAP_ROOT)/bootstrap/erts/bin
415 BEAM_EVM=$(ERL_TOP)/bin/$(TARGET)/beam_evm
416 BOOTSTRAP_COMPILER = $(BOOTSTRAP_TOP)/primary_compiler
417
418 .PHONY: emulator libs kernel stdlib compiler hipe dialyzer typer syntax_tools preloaded
419
420 emulator:
421 cd erts && ERL_TOP=$(ERL_TOP) $(MAKE) NO_START_SCRIPTS=true $(TYPE) FLAVOR=$(FLAVOR)
422
423 libs:
424 ifeq ($(OTP_SMALL_BUILD),true)
425 cd lib && \
426 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
427 $(MAKE) opt
428 else
429 cd lib && \
430 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
431 $(MAKE) opt BUILD_ALL=true
432 endif
433 kernel:
434 cd lib/kernel && \
435 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
436 $(MAKE) opt BUILD_ALL=true
437
438 stdlib:
439 cd lib/stdlib && \
440 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
441 $(MAKE) opt BUILD_ALL=true
442
443 compiler:
444 cd lib/compiler && \
445 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
446 $(MAKE) opt BUILD_ALL=true
447
448 hipe:
449 cd lib/hipe && \
450 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
451 $(MAKE) opt BUILD_ALL=true
452
453 dialyzer:
454 ifneq ($(OTP_SMALL_BUILD),true)
455 @if test -f lib/dialyzer/SKIP ; then \
456 echo "=== Skipping dialyzer, reason:" ; \
457 cat lib/dialyzer/SKIP ; \
458 echo "===" ; \
459 else \
460 cd lib/dialyzer && \
461 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
462 $(MAKE) opt BUILD_ALL=true ; \
463 fi
464 endif
465
466 typer:
467 cd lib/typer && \
468 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
469 $(MAKE) opt BUILD_ALL=true
470
471 syntax_tools:
472 cd lib/syntax_tools && \
473 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
474 $(MAKE) opt BUILD_ALL=true
475
476 preloaded:
477 cd erts/preloaded/src && \
478 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
479 $(MAKE) opt BUILD_ALL=true
480
481 dep depend:
482 test X"$$ERTS_SKIP_DEPEND" = X"true" || (cd erts/emulator && ERL_TOP=$(ERL_TOP) $(MAKE) generate depend)
483 test X"$$ERTS_SKIP_DEPEND" = X"true" || (cd erts/lib_src && ERL_TOP=$(ERL_TOP) $(MAKE) depend)
484
485 # Creates "erl" and "erlc" in bootstrap/bin which uses the precompiled
486 # libraries in the bootstrap directory
487
958d346 @rickard-green Regenerate bootstrap/{erl,erlc} when switching target
rickard-green authored Aug 9, 2010
488 .PHONY: bootstrap_setup_target
489
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
490 # ----------------------------------------------------------------------
491 # Bootstraps...
492 # ----------------------------------------------------------------------
493 ifeq ($(TARGET),win32)
958d346 @rickard-green Regenerate bootstrap/{erl,erlc} when switching target
rickard-green authored Aug 9, 2010
494 bootstrap_setup: check_recreate_primary_bootstrap bootstrap_setup_target
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
495 @rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erl.exe \
496 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc.exe \
497 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl.ini \
498 $(BOOTSTRAP_ROOT)/bootstrap/bin/beam.dll
499 make_bootstrap_ini.sh $(BOOTSTRAP_ROOT)/bootstrap \
500 $(ERL_TOP)/bin/$(TARGET)
501 @cp $(ERL_TOP)/bin/$(TARGET)/erlc.exe \
502 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc.exe
503 @cp $(ERL_TOP)/bin/$(TARGET)/erl.exe \
504 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl.exe
505 else
958d346 @rickard-green Regenerate bootstrap/{erl,erlc} when switching target
rickard-green authored Aug 9, 2010
506 bootstrap_setup: check_recreate_primary_bootstrap bootstrap_setup_target $(BOOTSTRAP_ROOT)/bootstrap/bin/erl $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
507
958d346 @rickard-green Regenerate bootstrap/{erl,erlc} when switching target
rickard-green authored Aug 9, 2010
508 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl: $(ERL_TOP)/erts/etc/unix/erl.src.src $(BOOTSTRAP_ROOT)/bootstrap/target
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
509 @rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erl
510 @sed -e "s;%FINAL_ROOTDIR%;$(BOOTSTRAP_ROOT)/bootstrap;" \
511 -e "s;\$$ROOTDIR/erts-.*/bin;$(ERL_TOP)/bin/$(TARGET);" \
512 -e "s;EMU=.*;EMU=beam$(TYPEMARKER);" \
513 $(ERL_TOP)/erts/etc/unix/erl.src.src > \
514 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl
515 @chmod 755 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl
516
958d346 @rickard-green Regenerate bootstrap/{erl,erlc} when switching target
rickard-green authored Aug 9, 2010
517 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc: $(ERL_TOP)/bin/$(TARGET)/erlc $(BOOTSTRAP_ROOT)/bootstrap/target
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
518 @rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
519 @cp $(ERL_TOP)/bin/$(TARGET)/erlc $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
520 @chmod 755 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
521 endif
522
958d346 @rickard-green Regenerate bootstrap/{erl,erlc} when switching target
rickard-green authored Aug 9, 2010
523 bootstrap_setup_target:
524 @{ test -r $(BOOTSTRAP_ROOT)/bootstrap/target && \
525 test $(TARGET) = `cat $(BOOTSTRAP_ROOT)/bootstrap/target`; } || \
526 echo $(TARGET) > $(BOOTSTRAP_ROOT)/bootstrap/target
527
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
528 secondary_bootstrap_build:
529 cd lib && \
530 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
531 $(MAKE) opt SECONDARY_BOOTSTRAP=true
532
533 secondary_bootstrap_copy:
534 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe ; fi
535 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin ; fi
536 for x in lib/hipe/ebin/*.beam; do \
537 BN=`basename $$x`; \
538 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin/$$BN; \
539 test -f $$TF && \
540 test '!' -z "`find $$x -newer $$TF -print`" && \
541 cp $$x $$TF; \
542 test '!' -f $$TF && \
543 cp $$x $$TF; \
544 true; \
545 done
546 # if test -f lib/hipe/ebin/hipe.beam ; then cp lib/hipe/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin; fi
547 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; fi
548 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; fi
549 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include ; fi
550 for x in lib/parsetools/ebin/*.beam; do \
551 BN=`basename $$x`; \
552 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin/$$BN; \
553 test -f $$TF && \
554 test '!' -z "`find $$x -newer $$TF -print`" && \
555 cp $$x $$TF; \
556 test '!' -f $$TF && \
557 cp $$x $$TF; \
558 true; \
559 done
560 # cp lib/parsetools/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin
561 for x in lib/parsetools/include/*.hrl; do \
562 BN=`basename $$x`; \
563 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include/$$BN; \
564 test -f $$TF && \
565 test '!' -z "`find $$x -newer $$TF -print`" && \
566 cp $$x $$TF; \
567 test '!' -f $$TF && \
568 cp $$x $$TF; \
569 true; \
570 done
571 # cp -f lib/parsetools/include/*.hrl $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include
572 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1 ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1 ; fi
573 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin ; fi
574 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src ; fi
575 for x in lib/asn1/ebin/*.beam; do \
576 BN=`basename $$x`; \
577 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin/$$BN; \
578 test -f $$TF && \
579 test '!' -z "`find $$x -newer $$TF -print`" && \
580 cp $$x $$TF; \
581 test '!' -f $$TF && \
582 cp $$x $$TF; \
583 true; \
584 done
585 # cp lib/asn1/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin
586 for x in lib/asn1/src/*.[eh]rl; do \
587 BN=`basename $$x`; \
588 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src/$$BN; \
589 test -f $$TF && \
590 test '!' -z "`find $$x -newer $$TF -print`" && \
591 cp $$x $$TF; \
592 test '!' -f $$TF && \
593 cp $$x $$TF; \
594 true; \
595 done
596 # cp -f lib/asn1/src/*.erl lib/asn1/src/*.hrl $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src
597
598 tertiary_bootstrap_build:
599 cd lib && \
600 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
601 $(MAKE) opt TERTIARY_BOOTSTRAP=true
602
603 tertiary_bootstrap_copy:
604 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp ; fi
605 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin ; fi
606 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/include ; fi
607 for x in lib/snmp/ebin/*.beam; do \
608 BN=`basename $$x`; \
609 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin/$$BN; \
610 test -f $$TF && \
611 test '!' -z "`find $$x -newer $$TF -print`" && \
612 cp $$x $$TF; \
613 test '!' -f $$TF && \
614 cp $$x $$TF; \
615 true; \
616 done
617 # cp lib/snmp/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin
618
619 fourth_bootstrap_build:
620 cd lib && \
621 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
622 $(MAKE) opt FOURTH_BOOTSTRAP=true
623
624 fourth_bootstrap_copy:
625 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl ; fi
626 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin ; fi
627 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/include ; fi
628 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/ic ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/ic ; fi
629 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin ; fi
630 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include ; fi
631 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx ; fi
632 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/ebin ; fi
633 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 Jan 15, 2010
634 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server ; fi
635 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 Nov 20, 2009
636 for x in lib/ic/ebin/*.beam; do \
637 BN=`basename $$x`; \
638 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin/$$BN; \
639 test -f $$TF && \
640 test '!' -z "`find $$x -newer $$TF -print`" && \
641 cp $$x $$TF; \
642 test '!' -f $$TF && \
643 cp $$x $$TF; \
644 true; \
645 done
646 # cp lib/ic/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin
647 for x in lib/ic/include/*.idl; do \
648 BN=`basename $$x`; \
649 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include/$$BN; \
650 test -f $$TF && \
651 test '!' -z "`find $$x -newer $$TF -print`" && \
652 cp $$x $$TF; \
653 test '!' -f $$TF && \
654 cp $$x $$TF; \
655 true; \
656 done
657 for x in lib/ic/include/*.h; do \
658 BN=`basename $$x`; \
659 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include/$$BN; \
660 test -f $$TF && \
661 test '!' -z "`find $$x -newer $$TF -print`" && \
662 cp $$x $$TF; \
663 test '!' -f $$TF && \
664 cp $$x $$TF; \
665 true; \
666 done
667 # cp -f lib/ic/include/*.idl lib/ic/include/*.h $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include
668 for x in lib/sasl/ebin/*.beam; do \
669 BN=`basename $$x`; \
670 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin/$$BN; \
671 test -f $$TF && \
672 test '!' -z "`find $$x -newer $$TF -print`" && \
673 cp $$x $$TF; \
674 test '!' -f $$TF && \
675 cp $$x $$TF; \
676 true; \
677 done
678 # cp lib/sasl/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin
679 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools ; fi
680 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin ; fi
681 for x in lib/syntax_tools/ebin/*.beam; do \
682 BN=`basename $$x`; \
683 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin/$$BN; \
684 test -f $$TF && \
685 test '!' -z "`find $$x -newer $$TF -print`" && \
686 cp $$x $$TF; \
687 test '!' -f $$TF && \
688 cp $$x $$TF; \
689 true; \
690 done
691 for x in lib/wx/include/*.hrl; do \
692 BN=`basename $$x`; \
693 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/wx/include/$$BN; \
694 test -f $$TF && \
695 test '!' -z "`find $$x -newer $$TF -print`" && \
696 cp $$x $$TF; \
697 test '!' -f $$TF && \
698 cp $$x $$TF; \
699 true; \
700 done
4bcf607 @bjorng Include test_servers's include files in the bootstrap
bjorng authored Jan 15, 2010
701 for x in lib/test_server/include/*.hrl; do \
702 BN=`basename $$x`; \
703 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/test_server/include/$$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
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
711
712 # cp lib/syntax_tools/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin
713
714 .PHONY: check_recreate_primary_bootstrap recreate_primary_bootstrap
715
716
717 #
718 # If the source is a prebuilt delivery, no $(ERL_TOP)/bootstrap/lib
719 # directory will exist. All applications part of the primary bootstrap
720 # are delivered prebuilt though. If it is a prebuilt delivery we need
721 # to recreate the primary bootstrap, from the prebuilt result.
722 #
723 # A prebuild delivery always contain a $(ERL_TOP)/prebuilt.files file.
724 # If no such file exists, we wont try to recreate the primary bootstrap,
725 # since it will just fail producing anything useful.
726 #
727
728 check_recreate_primary_bootstrap:
729 @if test -f $(ERL_TOP)/prebuilt.files ; then \
730 if test ! -d $(ERL_TOP)/bootstrap/lib ; then \
731 $(ERL_TOP)/otp_build save_bootstrap ; \
732 fi ; \
733 fi
734
735 #
736 # recreate_primary_bootstrap assumes that if $(ERL_TOP)/prebuilt.files
737 # exist, all build results needed already exist in the application specific
738 # directories of all applications part of the primary bootstrap.
739 #
740 recreate_primary_bootstrap:
741 $(ERL_TOP)/otp_build save_bootstrap
742
743 # The first bootstrap build is rarely (never) used in open source, it's
744 # used to build the shipped bootstrap directory. The Open source bootstrap
745 # stages start with secondary bootstrap.
746 #
747 # These are the ones used, the other ones (prefixed with old_) are for BC.
748
749 # These modules should stay in the kernel directory to make building
750 # of the emulator possible
751
752 .PHONY: primary_bootstrap \
753 primary_bootstrap_build \
754 primary_bootstrap_compiler \
755 primary_bootstrap_mkdirs \
756 primary_bootstrap_copy
757
1e294a3 @bjorng Top-level Makefile: Remove clearmake support
bjorng authored Aug 3, 2010
758 primary_bootstrap:
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
759 @echo "=== Building a bootstrap compiler in $(BOOTSTRAP_ROOT)/bootstrap"
1e294a3 @bjorng Top-level Makefile: Remove clearmake support
bjorng authored Aug 3, 2010
760 $(MAKE) BOOTSTRAP_ROOT=$(BOOTSTRAP_ROOT) \
761 ERL_TOP=$(ERL_TOP) \
762 bootstrap_clean
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
763 cd $(ERL_TOP) && \
764 $(MAKE) TESTROOT=$(BOOTSTRAP_TOP) \
765 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
766 primary_bootstrap_build
767 cd $(ERL_TOP) && \
768 $(MAKE) TESTROOT=$(BOOTSTRAP_TOP) \
769 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
770 primary_bootstrap_copy
771 cd $(ERL_TOP)/erts/start_scripts && \
772 $(MAKE) TESTROOT=$(BOOTSTRAP_TOP) \
773 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) bootstrap_scripts
774 test $(BOOTSTRAP_ROOT) = $(ERL_TOP) \
775 || $(ERL_TOP)/otp_build \
776 copy_primary_bootstrap \
777 $(BOOTSTRAP_TOP) \
778 $(BOOTSTRAP_ROOT)
779
780 primary_bootstrap_build: primary_bootstrap_mkdirs primary_bootstrap_compiler \
781 primary_bootstrap_stdlib
782 cd lib && $(MAKE) ERLC_FLAGS='-pa $(BOOTSTRAP_COMPILER)/ebin' \
783 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
784 BOOTSTRAP=1 opt
785
786 primary_bootstrap_compiler:
787 cd lib/compiler && $(MAKE) \
788 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
789 BOOTSTRAP_COMPILER=$(BOOTSTRAP_COMPILER) \
790 BOOTSTRAP=1 \
791 opt
792
793 primary_bootstrap_stdlib:
794 cd lib/stdlib/src && $(MAKE) \
795 BOOTSTRAP_COMPILER=$(BOOTSTRAP_COMPILER) \
796 primary_bootstrap_compiler
797
798 primary_bootstrap_mkdirs:
799 test -d $(BOOTSTRAP_COMPILER)/egen \
800 || mkdir -p $(BOOTSTRAP_COMPILER)/egen
801 test -d $(BOOTSTRAP_COMPILER)/ebin \
802 || mkdir -p $(BOOTSTRAP_COMPILER)/ebin
803 test -d $(BOOTSTRAP_TOP)/lib/kernel/egen \
804 || mkdir -p $(BOOTSTRAP_TOP)/lib/kernel/egen
805 test -d $(BOOTSTRAP_TOP)/lib/kernel/ebin \
806 || mkdir -p $(BOOTSTRAP_TOP)/lib/kernel/ebin
807 test -d $(BOOTSTRAP_TOP)/lib/kernel/include \
808 || mkdir -p $(BOOTSTRAP_TOP)/lib/kernel/include
809 test -d $(BOOTSTRAP_TOP)/lib/stdlib/egen \
810 || mkdir -p $(BOOTSTRAP_TOP)/lib/stdlib/egen
811 test -d $(BOOTSTRAP_TOP)/lib/stdlib/ebin \
812 || mkdir -p $(BOOTSTRAP_TOP)/lib/stdlib/ebin
813 test -d $(BOOTSTRAP_TOP)/lib/stdlib/include \
814 || mkdir -p $(BOOTSTRAP_TOP)/lib/stdlib/include
815 test -d $(BOOTSTRAP_TOP)/lib/compiler/egen \
816 || mkdir -p $(BOOTSTRAP_TOP)/lib/compiler/egen
817 test -d $(BOOTSTRAP_TOP)/lib/compiler/ebin \
818 || mkdir -p $(BOOTSTRAP_TOP)/lib/compiler/ebin
819 test -d $(BOOTSTRAP_TOP)/lib/orber/include \
820 || mkdir -p $(BOOTSTRAP_TOP)/lib/orber/include
821
822 primary_bootstrap_copy:
823 cp -f lib/kernel/include/*.hrl $(BOOTSTRAP_TOP)/lib/kernel/include
824 cp -f lib/stdlib/include/*.hrl $(BOOTSTRAP_TOP)/lib/stdlib/include
825 cp -f lib/orber/include/* $(BOOTSTRAP_TOP)/lib/orber/include
826
827 # To remove modules left by the bootstrap building, but leave (restore)
828 # the modules in kernel which are needed for an emulator build
829 KERNEL_PRELOAD = otp_ring0 init erl_prim_loader prim_inet prim_file zlib prim_zip erlang
830 KERNEL_PRELOAD_BEAMS=$(KERNEL_PRELOAD:%=$(BOOTSTRAP_TOP)/lib/kernel/ebin/%.beam)
831
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
832 start_scripts:
833 @cd erts/start_scripts \
834 && ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} $(MAKE) script
835
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
836 # Creates "erl" and "erlc" scripts in bin/erl which uses the libraries in lib
837 local_setup:
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
838 @rm -f bin/erl bin/erlc bin/cerl
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
839 @cd erts && \
840 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
841 $(MAKE) local_setup
842
843
844
845 # ----------------------------------------------------------------------
846 # Build tests
847 # ---------------------------------------------------------------------
848
849 TEST_DIRS := \
850 lib/test_server \
851 $(wildcard lib/*/test) \
852 erts/test \
853 erts/epmd/test \
854 erts/emulator/test
855
856 .PHONY: tests release_tests $(TEST_DIRS)
857
858 tests release_tests: $(TEST_DIRS)
859
860 $(TEST_DIRS):
861 if test -f $@/Makefile; then \
862 (cd $@; $(MAKE) TESTROOT=$(TESTSUITE_ROOT) release_tests) || exit $$?; \
863 fi
864
865 # ----------------------------------------------------------------------
866 # Obsolete type of bootstrap where all stages where built with installed sytem
867 # shuld no longer be used and is soon to be removed.
868 # Abbreviations: OC = Old Compiler, NC = New Compiler,
869 # OE = Old Emulator, NE = New Emulator
870
871 old_com_bootstrap: old_bootstrap_nc_for_ne_all_stages old_bootstrap_ne old_bootstrap_scripts
872
873 #
874 # Builds the New Compiler for the New Emulator (using existing erlc
875 # and possibly new compiler) then copy everything to the release area.
876 # Use to create the commerciall bootstrap version, which should be obsolete.
877 #
878 old_bootstrap_nc_for_ne_all_stages:
879 test -d $(TESTROOT) || mkdir -p $(TESTROOT)
880 cd lib && $(MAKE) BOOTSTRAP=1 TYPE=release release
881 cd lib && $(MAKE) SECONDARY_BOOTSTRAP=1 TYPE=release release
882 cd lib && $(MAKE) TERTIARY_BOOTSTRAP=1 TYPE=release release
883 cd lib && $(MAKE) FOURTH_BOOTSTRAP=1 TYPE=release release
884
885
886
887 old_bootstrap_ne:
888 cd erts && $(MAKE) release
889
890 old_bootstrap_scripts:
891 cd erts/start_scripts && $(MAKE) release
892
893
894 # This is one strange name for a target, this actually builds and strips only
895 # the primary bootstrap, a minimal set of beam files to be able to continue
896 # bootstrap builds. It's used by other makefiles, so I refrain from
897 # changing the name right now...
898 bootstrap_nc_for_ne_no_debug_sym:
899 test -d $(TESTROOT) || mkdir -p $(TESTROOT)
900 cd lib && $(MAKE) ERLC_FLAGS='-pa $(BOOTSTRAP_COMPILER)/ebin' \
901 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) BOOTSTRAP=1 TYPE=release release
902 $(ERL_TOP)/erts/emulator/utils/beam_strip $(TESTROOT)/lib/*/ebin/*.beam
903
904 # ----------------------------------------------------------------------
905
906 #
907 # Install
908 #
909 # Order is important here, don't change it!
910 #
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
911 INST_DEP += install.dirs install.emulator install.libs install.Install install.bin
912
913 install: $(INST_DEP)
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
914
df88b47 @lthor OTP-8343 The documentation is now possible to build in an open source
lthor authored Jan 26, 2010
915 install-docs:
916 ERL_TOP=$(ERL_TOP) INSTALLROOT=$(ERLANG_LIBDIR) PATH=$(BOOT_PREFIX)$${PATH} \
917 $(MAKE) RELEASE_ROOT=$(ERLANG_LIBDIR) release_docs
918
919
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
920 install.emulator:
921 cd erts && \
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
922 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
923 $(MAKE) TESTROOT=$(ERLANG_LIBDIR) release
924
925 install.libs:
926 ifeq ($(OTP_SMALL_BUILD),true)
927 cd lib && \
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
928 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
929 $(MAKE) TESTROOT=$(ERLANG_LIBDIR) release
930 else
931 cd lib && \
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
932 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
933 $(MAKE) TESTROOT=$(ERLANG_LIBDIR) BUILD_ALL=true release
934 @if test -f lib/dialyzer/SKIP ; then \
935 echo "=== Skipping dialyzer, reason:" ; \
936 cat lib/dialyzer/SKIP ; \
937 echo "===" ; \
938 else \
939 cd lib/dialyzer && \
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
940 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
941 $(MAKE) TESTROOT=$(ERLANG_LIBDIR) BUILD_ALL=true release ; \
942 fi
943 endif
944
945 install.Install:
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
946 (cd $(ERLANG_LIBDIR) \
947 && ./Install $(INSTALL_CROSS) -minimal $(ERLANG_INST_LIBDIR))
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
948
949 #
950 # Install erlang base public files
951 #
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
952
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
953 install.bin:
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
954 @ DESTDIR="$(DESTDIR)" EXTRA_PREFIX="$(EXTRA_PREFIX)" \
955 LN_S="$(LN_S)" BINDIR_SYMLINKS="$(BINDIR_SYMLINKS)" \
956 $(ERL_TOP)/make/install_bin \
957 --bindir "$(bindir)" \
958 --erlang-bindir "$(erlang_bindir)" \
959 --exec-prefix "$(exec_prefix)" \
960 $(ERL_BASE_PUB_FILES)
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
961
962 #
963 # Directories needed before we can install
964 #
965 install.dirs:
966 test -d $(BINDIR) || ${MKSUBDIRS} $(BINDIR)
967 ${MKSUBDIRS} $(ERLANG_LIBDIR)
968 ${MKSUBDIRS} $(ERLANG_LIBDIR)/usr/lib
969
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
970 .PHONY: strict_install
971
972 strict_install: $(IBIN_DIR) $(IBIN_FILES)
973
974 $(IBIN_FILES): $(ERL_TOP)/make/unexpected_use
975 rm -f $@
976 (cd $(dir $@) && $(LN_S) $(ERL_TOP)/make/unexpected_use $(notdir $@))
977
978 $(IBIN_DIR):
979 $(MKSUBDIRS) $@
980
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
981 # ----------------------------------------------------------------------
982
983 .PHONY: clean eclean bootstrap_root_clean bootstrap_clean
984
985 #
986 # Clean targets
987 #
988
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
989 clean: check_recreate_primary_bootstrap
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
990 rm -f *~ *.bak config.log config.status prebuilt.files ibin/*
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
991 find . -type f -name SKIP -print | xargs $(RM)
992 cd erts && ERL_TOP=$(ERL_TOP) $(MAKE) clean
993 cd lib && ERL_TOP=$(ERL_TOP) $(MAKE) clean BUILD_ALL=true
994 cd lib/dialyzer && ERL_TOP=$(ERL_TOP) $(MAKE) clean
995
996 #
997 # Just wipe out emulator, not libraries
998 #
999
1000 eclean:
1001 cd erts && ERL_TOP=$(ERL_TOP) $(MAKE) clean
1002
1003 #
1004 # Clean up bootstrap
1005 #
1006
1007 bootstrap_root_clean:
1008 rm -f $(BOOTSTRAP_ROOT)/bootstrap/lib/*/ebin/*.beam
1009 rm -f $(BOOTSTRAP_ROOT)/bootstrap/lib/*/include/*.hrl
1010 rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/*.*
1011
1012 # $(ERL_TOP)/bootstrap *should* equal $(BOOTSTRAP_TOP)
1013 #
1014 # We use $(ERL_TOP)/bootstrap instead of $(BOOTSTRAP_TOP) here as an
1015 # extra safety precaution (we would really make a mess if
1016 # $(BOOTSTRAP_TOP) for some reason should be empty).
1017 bootstrap_clean:
1018 rm -f $(ERL_TOP)/bootstrap/lib/*/ebin/*.beam
d0c862a @bjorng Fix building of primary bootstrap when versions have changed
bjorng authored Aug 3, 2010
1019 rm -f $(ERL_TOP)/bootstrap/lib/*/ebin/*.app
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
1020 rm -f $(ERL_TOP)/bootstrap/lib/*/egen/*
1021 rm -f $(ERL_TOP)/bootstrap/lib/*/include/*.hrl
1022 rm -f $(ERL_TOP)/bootstrap/primary_compiler/ebin/*
1023 rm -f $(ERL_TOP)/bootstrap/primary_compiler/egen/*
1024 rm -f $(ERL_TOP)/bootstrap/bin/*.*
1025 rm -f $(KERNEL_PRELOAD:%=$(ERL_TOP)/lib/kernel/ebin/%.beam)
1026 test $(BOOTSTRAP_ROOT) = $(ERL_TOP) \
1027 || $(MAKE) BOOTSTRAP_ROOT=$(BOOTSTRAP_ROOT) bootstrap_root_clean
1028
1029 # ----------------------------------------------------------------------
Something went wrong with that request. Please try again.