Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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