Skip to content
Newer
Older
100644 988 lines (843 sloc) 33.5 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 #
92bbb54 @bufflig Teach toplevel makefile to always use newly built escript.
bufflig authored Mar 31, 2011
4 # Copyright Ericsson AB 1998-2011. All Rights Reserved.
141b8f2 Merge branch 'fh/common_test-includes' into ccase/r13b04_dev
Erlang/OTP authored Jan 19, 2010
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
ce2c963 @bjorng Top-level Makefile: Suppress parallel make
bjorng authored Jun 15, 2011
22 .NOTPARALLEL:
23
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
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 Feb 3, 2010
32 # OTP release
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
33 OTP = OTP-@OTP_REL@
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
34
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
35 # erts (Erlang RunTime System) version
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
36 ERTS = erts-@ERTS_VSN@
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
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 Feb 3, 2010
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 Nov 20, 2009
52
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
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 Nov 20, 2009
57
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
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 Nov 20, 2009
120
121 #
122 # Erlang base public files
123 #
5cf552a @pekadan Add run_test program for Common Test
pekadan authored May 24, 2010
124 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
125
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
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 Nov 20, 2009
130
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
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 Nov 20, 2009
134
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
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 Nov 20, 2009
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 Nov 10, 2011
161 TARGET := @TARGET@
162 include $(ERL_TOP)/make/target.mk
163 export TARGET
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
164
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
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 Nov 20, 2009
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 Feb 3, 2010
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 Nov 20, 2009
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 BOOT_PREFIX=$(WIN32_WRAPPER_PATH):$(BOOTSTRAP_ROOT)/bootstrap/bin:
223 else
224 BOOT_PREFIX=$(BOOTSTRAP_ROOT)/bootstrap/bin:
225 endif
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
226
227 # ----------------------------------------------------------------------
228
229 # The following is currently only used for determining what to prevent
230 # usage of during strict install or release.
231 include $(ERL_TOP)/make/$(TARGET)/otp_ded.mk
232 CC = @CC@
233 LD = @LD@
234 CXX = @CXX@
235
236 IBIN_DIR = $(ERL_TOP)/ibin
237 #
238 # If $(OTP_STRICT_INSTALL) equals `yes' we prefix the PATH with $(IBIN_DIR)
239 # when doing `release' or `install'. This directory contains `erlc', `gcc',
240 # `ld' etc, that unconditionally will fail if used. This is used during the
241 # daily builds in order to pick up on things being erroneously built during
242 # the `release' and `install' phases.
243 #
244 INST_FORBID = gcc g++ cc c++ cxx cl gcc.sh cc.sh ld ld.sh
245 INST_FORBID += javac.sh javac guavac gcj jikes bock
246 INST_FORBID += $(notdir $(CC)) $(notdir $(LD)) $(notdir $(CXX))
247 INST_FORBID += $(notdir $(DED_CC)) $(notdir $(DED_LD))
248 INST_FORBID += $(ERL_BASE_PUB_FILES)
249 IBIN_FILES = $(addprefix $(IBIN_DIR)/,$(sort $(INST_FORBID))) # sort will
250 # remove
251 # duplicates
252
253 ifeq ($(OTP_STRICT_INSTALL),yes)
254
255 INST_PATH_PREFIX=$(IBIN_DIR):
256 INST_DEP = strict_install
257 ifneq ($(CROSS_COMPILING),yes)
258 INST_DEP += strict_install_all_bootstraps
259 endif
260
261 else # --- Normal case, i.e., not strict install ---
262
263 #
264 # By default we allow build during install and release phase; therefore,
265 # make sure that the bootstrap system is available in the path.
266 #
267 INST_PATH_PREFIX=$(BOOT_PREFIX)
268 # If cross compiling `erlc', in path might have be used; therefore,
269 # avoid triggering a bootstrap build...
270 INST_DEP =
271 ifneq ($(CROSS_COMPILING),yes)
272 INST_DEP += all_bootstraps
273 endif
274
275 endif # --- Normal case, i.e., not strict install ---
276
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
277 # ----------------------------------------------------------------------
278 # Fix up RELEASE_ROOT/TESTROOT havoc
279 ifeq ($(RELEASE_ROOT),)
280 ifneq ($(TESTROOT),)
281 RELEASE_ROOT = $(TESTROOT)
282 endif
283 endif
284
285
286 # ----------------------------------------------------------------------
287
288 # A default for the release_tests, not same target dir as release.
289 # More TESTROOT havoc...
290 ifeq ($(TESTSUITE_ROOT),)
291 ifneq ($(TESTROOT),)
292 TESTSUITE_ROOT = $(TESTROOT)
293 else
294 TESTSUITE_ROOT = $(ERL_TOP)/release/tests
295 endif
296 endif
297
298 #
299 # The steps to build a working system are:
300 # * build an emulator
301 # * setup the erl and erlc program in bootstrap/bin
302 # * build additional compilers and copy them into bootstrap/lib
303 # * use the bootstrap erl and erlc to build all the libs
304 #
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
305
306 .PHONY: all bootstrap all_bootstraps
307
308 ifneq ($(CROSS_COMPILING),yes)
309 # Not cross compiling
310
311 ifeq ($(BOOTSTRAP_ONLY),yes)
312 all: bootstrap
313 else
314 # The normal case; not cross compiling, and not bootstrap only build.
778b1e2 @bjorng dialyzer: Remove special-case build in the top Makefile
bjorng authored Jul 7, 2011
315 all: bootstrap libs local_setup
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
316 endif
317
318 else
319 # Cross compiling
320
778b1e2 @bjorng dialyzer: Remove special-case build in the top Makefile
bjorng authored Jul 7, 2011
321 all: cross_check_erl depend emulator libs start_scripts
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
322
323 endif
324
325 cross_check_erl:
326 @PATH=$(BOOT_PREFIX)$${PATH} $(ERL_TOP)/make/cross_check_erl \
327 -target $(TARGET) -otp $(OTP) -erl_top $(ERL_TOP) \
328 -force $(ERL_XCOMP_FORCE_DIFFERENT_OTP)
329
330 is_cross_configured:
331 @echo @CROSS_COMPILING@
332
333 target_configured:
334 @echo @TARGET@
335
336 bootstrap: depend all_bootstraps
337
338
339
340 ifeq ($(OTP_STRICT_INSTALL),yes)
341
342 .PHONY: strict_install_all_bootstraps
343
344 strict_install_all_bootstraps:
345 $(MAKE) BOOT_PREFIX=$(INST_PATH_PREFIX) OTP_STRICT_INSTALL=$(OTP_STRICT_INSTALL) all_bootstraps
346
347 endif
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
348
349 # With all bootstraps we mean all bootstrapping that is done when
350 # the system is delivered in open source, the primary
351 # 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
352 all_bootstraps: emulator \
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
353 bootstrap_setup \
354 secondary_bootstrap_build secondary_bootstrap_copy \
bb3f5af @bjorng Merge the fourth bootstrap stage into the third bootstrap stage
bjorng authored Sep 14, 2011
355 tertiary_bootstrap_build tertiary_bootstrap_copy
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
356
357 #
358 # Use these targets when you want to use the erl and erlc
359 # binaries in your PATH instead of those created from the
360 # pre-compiled Erlang modules under bootstrap/.
361 #
362 noboot:
363 $(MAKE) BOOT_PREFIX= emulator libs local_setup
b45b616 @bjorng Makefiles: Remove stray OSE/Delta support
bjorng authored Apr 13, 2010
364
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
365 noboot_install:
366 $(MAKE) BOOT_PREFIX= install
367
368 .PHONY: release release_docs
369
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
370 release: $(INST_DEP)
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
371 ifeq ($(OTP_SMALL_BUILD),true)
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
372 cd $(ERL_TOP)/lib && \
373 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
374 $(MAKE) TESTROOT=$(RELEASE_ROOT) release
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
375 else
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
376 cd $(ERL_TOP)/lib && \
377 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
378 $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
379 endif
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
380 cd $(ERL_TOP)/erts && \
381 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
382 $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
383
384 # ---------------------------------------------------------------
385 # Target only used when building commercial ERTS patches
386 # ---------------------------------------------------------------
2f93254 Prepare erl_docgen for using Dialyzer specs and types
Hans Bolinder authored Jul 8, 2010
387 release_docs docs: mod2app
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
388 ifeq ($(OTP_SMALL_BUILD),true)
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
389 cd $(ERL_TOP)/lib && \
92bbb54 @bufflig Teach toplevel makefile to always use newly built escript.
bufflig authored Mar 31, 2011
390 PATH=$(ERL_TOP)/bin:$${PATH} ERL_TOP=$(ERL_TOP) \
391 $(MAKE) TESTROOT=$(RELEASE_ROOT) $@
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
392 else
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
393 cd $(ERL_TOP)/lib && \
92bbb54 @bufflig Teach toplevel makefile to always use newly built escript.
bufflig authored Mar 31, 2011
394 PATH=$(ERL_TOP)/bin:$${PATH} ERL_TOP=$(ERL_TOP) \
395 $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
396 endif
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
397 cd $(ERL_TOP)/erts && \
92bbb54 @bufflig Teach toplevel makefile to always use newly built escript.
bufflig authored Mar 31, 2011
398 PATH=$(ERL_TOP)/bin:$${PATH} ERL_TOP=$(ERL_TOP) \
399 $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
400 cd $(ERL_TOP)/system/doc && \
92bbb54 @bufflig Teach toplevel makefile to always use newly built escript.
bufflig authored Mar 31, 2011
401 PATH=$(ERL_TOP)/bin:$${PATH} \
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
402 ERL_TOP=$(ERL_TOP) $(MAKE) TESTROOT=$(RELEASE_ROOT) $@
403
92bbb54 @bufflig Teach toplevel makefile to always use newly built escript.
bufflig authored Mar 31, 2011
404 mod2app:
405 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 Jul 8, 2010
406
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
407 # ----------------------------------------------------------------------
408 ERLANG_EARS=$(BOOTSTRAP_ROOT)/bootstrap/erts
409 ELINK=$(BOOTSTRAP_ROOT)/bootstrap/erts/bin/elink
410 BOOT_BINDIR=$(BOOTSTRAP_ROOT)/bootstrap/erts/bin
411 BEAM_EVM=$(ERL_TOP)/bin/$(TARGET)/beam_evm
412 BOOTSTRAP_COMPILER = $(BOOTSTRAP_TOP)/primary_compiler
413
778b1e2 @bjorng dialyzer: Remove special-case build in the top Makefile
bjorng authored Jul 7, 2011
414 .PHONY: emulator libs kernel stdlib compiler hipe typer syntax_tools preloaded
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
415
416 emulator:
417 cd erts && ERL_TOP=$(ERL_TOP) $(MAKE) NO_START_SCRIPTS=true $(TYPE) FLAVOR=$(FLAVOR)
418
419 libs:
420 ifeq ($(OTP_SMALL_BUILD),true)
421 cd lib && \
422 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
423 $(MAKE) opt
424 else
425 cd lib && \
426 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
427 $(MAKE) opt BUILD_ALL=true
428 endif
429 kernel:
430 cd lib/kernel && \
431 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
432 $(MAKE) opt BUILD_ALL=true
433
434 stdlib:
435 cd lib/stdlib && \
436 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
437 $(MAKE) opt BUILD_ALL=true
438
439 compiler:
440 cd lib/compiler && \
441 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
442 $(MAKE) opt BUILD_ALL=true
443
444 hipe:
445 cd lib/hipe && \
446 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
447 $(MAKE) opt BUILD_ALL=true
448
449 typer:
450 cd lib/typer && \
451 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
452 $(MAKE) opt BUILD_ALL=true
453
454 syntax_tools:
455 cd lib/syntax_tools && \
456 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
457 $(MAKE) opt BUILD_ALL=true
458
459 preloaded:
460 cd erts/preloaded/src && \
461 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
462 $(MAKE) opt BUILD_ALL=true
463
464 dep depend:
20f410f @bjorng erts: Fix dependency generation
bjorng authored Jun 15, 2011
465 test X"$$ERTS_SKIP_DEPEND" = X"true" || (cd erts/emulator && ERL_TOP=$(ERL_TOP) $(MAKE) generate)
466 test X"$$ERTS_SKIP_DEPEND" = X"true" || (cd erts/emulator && ERL_TOP=$(ERL_TOP) $(MAKE) depend)
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
467 test X"$$ERTS_SKIP_DEPEND" = X"true" || (cd erts/lib_src && ERL_TOP=$(ERL_TOP) $(MAKE) depend)
468
469 # Creates "erl" and "erlc" in bootstrap/bin which uses the precompiled
470 # libraries in the bootstrap directory
471
958d346 @rickard-green Regenerate bootstrap/{erl,erlc} when switching target
rickard-green authored Aug 9, 2010
472 .PHONY: bootstrap_setup_target
473
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
474 # ----------------------------------------------------------------------
475 # Bootstraps...
476 # ----------------------------------------------------------------------
477 ifeq ($(TARGET),win32)
958d346 @rickard-green Regenerate bootstrap/{erl,erlc} when switching target
rickard-green authored Aug 9, 2010
478 bootstrap_setup: check_recreate_primary_bootstrap bootstrap_setup_target
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
479 @rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erl.exe \
480 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc.exe \
88d149a @bufflig Add escript to bootstrap/bin
bufflig authored May 17, 2011
481 $(BOOTSTRAP_ROOT)/bootstrap/bin/escript.exe \
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
482 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl.ini \
483 $(BOOTSTRAP_ROOT)/bootstrap/bin/beam.dll
484 make_bootstrap_ini.sh $(BOOTSTRAP_ROOT)/bootstrap \
485 $(ERL_TOP)/bin/$(TARGET)
486 @cp $(ERL_TOP)/bin/$(TARGET)/erlc.exe \
487 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc.exe
488 @cp $(ERL_TOP)/bin/$(TARGET)/erl.exe \
489 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl.exe
88d149a @bufflig Add escript to bootstrap/bin
bufflig authored May 17, 2011
490 @cp $(ERL_TOP)/bin/$(TARGET)/escript.exe \
491 $(BOOTSTRAP_ROOT)/bootstrap/bin/escript.exe
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
492 else
88d149a @bufflig Add escript to bootstrap/bin
bufflig authored May 17, 2011
493 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 Nov 20, 2009
494
958d346 @rickard-green Regenerate bootstrap/{erl,erlc} when switching target
rickard-green authored Aug 9, 2010
495 $(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
496 @rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erl
497 @sed -e "s;%FINAL_ROOTDIR%;$(BOOTSTRAP_ROOT)/bootstrap;" \
498 -e "s;\$$ROOTDIR/erts-.*/bin;$(ERL_TOP)/bin/$(TARGET);" \
499 -e "s;EMU=.*;EMU=beam$(TYPEMARKER);" \
500 $(ERL_TOP)/erts/etc/unix/erl.src.src > \
501 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl
502 @chmod 755 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl
503
958d346 @rickard-green Regenerate bootstrap/{erl,erlc} when switching target
rickard-green authored Aug 9, 2010
504 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc: $(ERL_TOP)/bin/$(TARGET)/erlc $(BOOTSTRAP_ROOT)/bootstrap/target
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
505 @rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
506 @cp $(ERL_TOP)/bin/$(TARGET)/erlc $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
507 @chmod 755 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
88d149a @bufflig Add escript to bootstrap/bin
bufflig authored May 17, 2011
508
509 $(BOOTSTRAP_ROOT)/bootstrap/bin/escript: $(ERL_TOP)/bin/$(TARGET)/escript $(BOOTSTRAP_ROOT)/bootstrap/target
510 @rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/escript
511 @cp $(ERL_TOP)/bin/$(TARGET)/escript $(BOOTSTRAP_ROOT)/bootstrap/bin/escript
512 @chmod 755 $(BOOTSTRAP_ROOT)/bootstrap/bin/escript
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
513 endif
514
958d346 @rickard-green Regenerate bootstrap/{erl,erlc} when switching target
rickard-green authored Aug 9, 2010
515 bootstrap_setup_target:
516 @{ test -r $(BOOTSTRAP_ROOT)/bootstrap/target && \
517 test $(TARGET) = `cat $(BOOTSTRAP_ROOT)/bootstrap/target`; } || \
518 echo $(TARGET) > $(BOOTSTRAP_ROOT)/bootstrap/target
519
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
520 secondary_bootstrap_build:
521 cd lib && \
522 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
523 $(MAKE) opt SECONDARY_BOOTSTRAP=true
524
525 secondary_bootstrap_copy:
526 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe ; fi
527 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin ; fi
528 for x in lib/hipe/ebin/*.beam; do \
529 BN=`basename $$x`; \
530 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin/$$BN; \
531 test -f $$TF && \
532 test '!' -z "`find $$x -newer $$TF -print`" && \
533 cp $$x $$TF; \
534 test '!' -f $$TF && \
535 cp $$x $$TF; \
536 true; \
537 done
538 # if test -f lib/hipe/ebin/hipe.beam ; then cp lib/hipe/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin; fi
539 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; fi
540 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; fi
541 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 Sep 14, 2011
542 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/orber ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/orber ; fi
543 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 Nov 20, 2009
544 for x in lib/parsetools/ebin/*.beam; do \
545 BN=`basename $$x`; \
546 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin/$$BN; \
547 test -f $$TF && \
548 test '!' -z "`find $$x -newer $$TF -print`" && \
549 cp $$x $$TF; \
550 test '!' -f $$TF && \
551 cp $$x $$TF; \
552 true; \
553 done
554 # cp lib/parsetools/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin
555 for x in lib/parsetools/include/*.hrl; do \
556 BN=`basename $$x`; \
557 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include/$$BN; \
558 test -f $$TF && \
559 test '!' -z "`find $$x -newer $$TF -print`" && \
560 cp $$x $$TF; \
561 test '!' -f $$TF && \
562 cp $$x $$TF; \
563 true; \
564 done
565 # cp -f lib/parsetools/include/*.hrl $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include
566 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1 ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1 ; fi
567 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin ; fi
568 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src ; fi
569 for x in lib/asn1/ebin/*.beam; do \
570 BN=`basename $$x`; \
571 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin/$$BN; \
572 test -f $$TF && \
573 test '!' -z "`find $$x -newer $$TF -print`" && \
574 cp $$x $$TF; \
575 test '!' -f $$TF && \
576 cp $$x $$TF; \
577 true; \
578 done
579 # cp lib/asn1/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin
580 for x in lib/asn1/src/*.[eh]rl; do \
581 BN=`basename $$x`; \
582 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src/$$BN; \
583 test -f $$TF && \
584 test '!' -z "`find $$x -newer $$TF -print`" && \
585 cp $$x $$TF; \
586 test '!' -f $$TF && \
587 cp $$x $$TF; \
588 true; \
589 done
590 # 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 Sep 14, 2011
591 for x in lib/orber/include/*.hrl; do \
592 BN=`basename $$x`; \
593 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/orber/include/$$BN; \
594 test -f $$TF && \
595 test '!' -z "`find $$x -newer $$TF -print`" && \
596 cp $$x $$TF; \
597 test '!' -f $$TF && \
598 cp $$x $$TF; \
599 true; \
600 done
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
601
602 tertiary_bootstrap_build:
603 cd lib && \
604 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
605 $(MAKE) opt TERTIARY_BOOTSTRAP=true
606
607 tertiary_bootstrap_copy:
608 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp ; fi
609 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin ; fi
610 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/include ; fi
611 for x in lib/snmp/ebin/*.beam; do \
612 BN=`basename $$x`; \
613 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin/$$BN; \
614 test -f $$TF && \
615 test '!' -z "`find $$x -newer $$TF -print`" && \
616 cp $$x $$TF; \
617 test '!' -f $$TF && \
618 cp $$x $$TF; \
619 true; \
620 done
621 # cp lib/snmp/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin
622 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl ; fi
623 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin ; fi
624 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/include ; fi
625 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/ic ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/ic ; fi
626 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin ; fi
627 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include ; fi
628 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx ; fi
629 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/ebin ; fi
630 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
631 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server ; fi
632 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
633 for x in lib/ic/ebin/*.beam; do \
634 BN=`basename $$x`; \
635 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin/$$BN; \
636 test -f $$TF && \
637 test '!' -z "`find $$x -newer $$TF -print`" && \
638 cp $$x $$TF; \
639 test '!' -f $$TF && \
640 cp $$x $$TF; \
641 true; \
642 done
643 # cp lib/ic/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin
644 for x in lib/ic/include/*.idl; do \
645 BN=`basename $$x`; \
646 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include/$$BN; \
647 test -f $$TF && \
648 test '!' -z "`find $$x -newer $$TF -print`" && \
649 cp $$x $$TF; \
650 test '!' -f $$TF && \
651 cp $$x $$TF; \
652 true; \
653 done
654 for x in lib/ic/include/*.h; do \
655 BN=`basename $$x`; \
656 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include/$$BN; \
657 test -f $$TF && \
658 test '!' -z "`find $$x -newer $$TF -print`" && \
659 cp $$x $$TF; \
660 test '!' -f $$TF && \
661 cp $$x $$TF; \
662 true; \
663 done
664 # cp -f lib/ic/include/*.idl lib/ic/include/*.h $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include
665 for x in lib/sasl/ebin/*.beam; do \
666 BN=`basename $$x`; \
667 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin/$$BN; \
668 test -f $$TF && \
669 test '!' -z "`find $$x -newer $$TF -print`" && \
670 cp $$x $$TF; \
671 test '!' -f $$TF && \
672 cp $$x $$TF; \
673 true; \
674 done
675 # cp lib/sasl/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin
676 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools ; fi
677 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin ; fi
678 for x in lib/syntax_tools/ebin/*.beam; do \
679 BN=`basename $$x`; \
680 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin/$$BN; \
681 test -f $$TF && \
682 test '!' -z "`find $$x -newer $$TF -print`" && \
683 cp $$x $$TF; \
684 test '!' -f $$TF && \
685 cp $$x $$TF; \
686 true; \
687 done
688 for x in lib/wx/include/*.hrl; do \
689 BN=`basename $$x`; \
690 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/wx/include/$$BN; \
691 test -f $$TF && \
692 test '!' -z "`find $$x -newer $$TF -print`" && \
693 cp $$x $$TF; \
694 test '!' -f $$TF && \
695 cp $$x $$TF; \
696 true; \
697 done
7fdc3f2 @dgud [wx] Avoid missing wx_object behaviour warning
dgud authored Dec 7, 2011
698 # copy wx_object to remove undef behaviour warnings
699 for x in lib/wx/ebin/wx_object.beam; do \
700 BN=`basename $$x`; \
701 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/wx/ebin/$$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
709
4bcf607 @bjorng Include test_servers's include files in the bootstrap
bjorng authored Jan 15, 2010
710 for x in lib/test_server/include/*.hrl; do \
711 BN=`basename $$x`; \
712 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/test_server/include/$$BN; \
713 test -f $$TF && \
714 test '!' -z "`find $$x -newer $$TF -print`" && \
715 cp $$x $$TF; \
716 test '!' -f $$TF && \
717 cp $$x $$TF; \
718 true; \
719 done
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
720 # cp lib/syntax_tools/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin
721
722 .PHONY: check_recreate_primary_bootstrap recreate_primary_bootstrap
723
724
725 #
726 # If the source is a prebuilt delivery, no $(ERL_TOP)/bootstrap/lib
727 # directory will exist. All applications part of the primary bootstrap
728 # are delivered prebuilt though. If it is a prebuilt delivery we need
729 # to recreate the primary bootstrap, from the prebuilt result.
730 #
731 # A prebuild delivery always contain a $(ERL_TOP)/prebuilt.files file.
732 # If no such file exists, we wont try to recreate the primary bootstrap,
733 # since it will just fail producing anything useful.
734 #
735
736 check_recreate_primary_bootstrap:
737 @if test -f $(ERL_TOP)/prebuilt.files ; then \
738 if test ! -d $(ERL_TOP)/bootstrap/lib ; then \
739 $(ERL_TOP)/otp_build save_bootstrap ; \
740 fi ; \
741 fi
742
743 #
744 # recreate_primary_bootstrap assumes that if $(ERL_TOP)/prebuilt.files
745 # exist, all build results needed already exist in the application specific
746 # directories of all applications part of the primary bootstrap.
747 #
748 recreate_primary_bootstrap:
749 $(ERL_TOP)/otp_build save_bootstrap
750
751 # The first bootstrap build is rarely (never) used in open source, it's
752 # used to build the shipped bootstrap directory. The Open source bootstrap
753 # stages start with secondary bootstrap.
754 #
755 # These are the ones used, the other ones (prefixed with old_) are for BC.
756
757 # These modules should stay in the kernel directory to make building
758 # of the emulator possible
759
760 .PHONY: primary_bootstrap \
761 primary_bootstrap_build \
762 primary_bootstrap_compiler \
763 primary_bootstrap_mkdirs \
764 primary_bootstrap_copy
765
1e294a3 @bjorng Top-level Makefile: Remove clearmake support
bjorng authored Aug 3, 2010
766 primary_bootstrap:
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
767 @echo "=== Building a bootstrap compiler in $(BOOTSTRAP_ROOT)/bootstrap"
1e294a3 @bjorng Top-level Makefile: Remove clearmake support
bjorng authored Aug 3, 2010
768 $(MAKE) BOOTSTRAP_ROOT=$(BOOTSTRAP_ROOT) \
769 ERL_TOP=$(ERL_TOP) \
770 bootstrap_clean
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
771 cd $(ERL_TOP) && \
772 $(MAKE) TESTROOT=$(BOOTSTRAP_TOP) \
773 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
774 primary_bootstrap_build
775 cd $(ERL_TOP) && \
776 $(MAKE) TESTROOT=$(BOOTSTRAP_TOP) \
777 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
778 primary_bootstrap_copy
779 cd $(ERL_TOP)/erts/start_scripts && \
780 $(MAKE) TESTROOT=$(BOOTSTRAP_TOP) \
781 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) bootstrap_scripts
782 test $(BOOTSTRAP_ROOT) = $(ERL_TOP) \
783 || $(ERL_TOP)/otp_build \
784 copy_primary_bootstrap \
785 $(BOOTSTRAP_TOP) \
786 $(BOOTSTRAP_ROOT)
787
788 primary_bootstrap_build: primary_bootstrap_mkdirs primary_bootstrap_compiler \
789 primary_bootstrap_stdlib
790 cd lib && $(MAKE) ERLC_FLAGS='-pa $(BOOTSTRAP_COMPILER)/ebin' \
791 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
792 BOOTSTRAP=1 opt
793
794 primary_bootstrap_compiler:
795 cd lib/compiler && $(MAKE) \
796 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
797 BOOTSTRAP_COMPILER=$(BOOTSTRAP_COMPILER) \
798 BOOTSTRAP=1 \
799 opt
800
801 primary_bootstrap_stdlib:
802 cd lib/stdlib/src && $(MAKE) \
803 BOOTSTRAP_COMPILER=$(BOOTSTRAP_COMPILER) \
804 primary_bootstrap_compiler
805
806 primary_bootstrap_mkdirs:
807 test -d $(BOOTSTRAP_COMPILER)/egen \
808 || mkdir -p $(BOOTSTRAP_COMPILER)/egen
809 test -d $(BOOTSTRAP_COMPILER)/ebin \
810 || mkdir -p $(BOOTSTRAP_COMPILER)/ebin
811 test -d $(BOOTSTRAP_TOP)/lib/kernel/egen \
812 || mkdir -p $(BOOTSTRAP_TOP)/lib/kernel/egen
813 test -d $(BOOTSTRAP_TOP)/lib/kernel/ebin \
814 || mkdir -p $(BOOTSTRAP_TOP)/lib/kernel/ebin
815 test -d $(BOOTSTRAP_TOP)/lib/kernel/include \
816 || mkdir -p $(BOOTSTRAP_TOP)/lib/kernel/include
817 test -d $(BOOTSTRAP_TOP)/lib/stdlib/egen \
818 || mkdir -p $(BOOTSTRAP_TOP)/lib/stdlib/egen
819 test -d $(BOOTSTRAP_TOP)/lib/stdlib/ebin \
820 || mkdir -p $(BOOTSTRAP_TOP)/lib/stdlib/ebin
821 test -d $(BOOTSTRAP_TOP)/lib/stdlib/include \
822 || mkdir -p $(BOOTSTRAP_TOP)/lib/stdlib/include
823 test -d $(BOOTSTRAP_TOP)/lib/compiler/egen \
824 || mkdir -p $(BOOTSTRAP_TOP)/lib/compiler/egen
825 test -d $(BOOTSTRAP_TOP)/lib/compiler/ebin \
826 || mkdir -p $(BOOTSTRAP_TOP)/lib/compiler/ebin
827 test -d $(BOOTSTRAP_TOP)/lib/orber/include \
828 || mkdir -p $(BOOTSTRAP_TOP)/lib/orber/include
829
830 primary_bootstrap_copy:
831 cp -f lib/kernel/include/*.hrl $(BOOTSTRAP_TOP)/lib/kernel/include
832 cp -f lib/stdlib/include/*.hrl $(BOOTSTRAP_TOP)/lib/stdlib/include
833 cp -f lib/orber/include/* $(BOOTSTRAP_TOP)/lib/orber/include
834
835 # To remove modules left by the bootstrap building, but leave (restore)
836 # the modules in kernel which are needed for an emulator build
837 KERNEL_PRELOAD = otp_ring0 init erl_prim_loader prim_inet prim_file zlib prim_zip erlang
838 KERNEL_PRELOAD_BEAMS=$(KERNEL_PRELOAD:%=$(BOOTSTRAP_TOP)/lib/kernel/ebin/%.beam)
839
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
840 start_scripts:
841 @cd erts/start_scripts \
842 && ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} $(MAKE) script
843
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
844 # Creates "erl" and "erlc" scripts in bin/erl which uses the libraries in lib
845 local_setup:
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
846 @rm -f bin/erl bin/erlc bin/cerl
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
847 @cd erts && \
848 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
849 $(MAKE) local_setup
850
851
852
853 # ----------------------------------------------------------------------
854 # Build tests
855 # ---------------------------------------------------------------------
856
857 TEST_DIRS := \
858 lib/test_server \
859 $(wildcard lib/*/test) \
860 erts/test \
861 erts/epmd/test \
862 erts/emulator/test
863
864 .PHONY: tests release_tests $(TEST_DIRS)
865
866 tests release_tests: $(TEST_DIRS)
867
868 $(TEST_DIRS):
869 if test -f $@/Makefile; then \
5065129 @psyeugenic otp: Add paths to erlc for release_tests
psyeugenic authored Nov 9, 2011
870 (cd $@; $(MAKE) TESTROOT=$(TESTSUITE_ROOT) \
871 PATH=$(ERL_TOP)/bin:$(BOOT_PREFIX)$${PATH} release_tests) || exit $$?; \
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
872 fi
873
874 #
875 # Install
876 #
877 # Order is important here, don't change it!
878 #
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
879 INST_DEP += install.dirs install.emulator install.libs install.Install install.bin
880
881 install: $(INST_DEP)
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
882
df88b47 @lthor OTP-8343 The documentation is now possible to build in an open source
lthor authored Jan 26, 2010
883 install-docs:
884 ERL_TOP=$(ERL_TOP) INSTALLROOT=$(ERLANG_LIBDIR) PATH=$(BOOT_PREFIX)$${PATH} \
885 $(MAKE) RELEASE_ROOT=$(ERLANG_LIBDIR) release_docs
886
887
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
888 install.emulator:
889 cd erts && \
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
890 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
891 $(MAKE) TESTROOT=$(ERLANG_LIBDIR) release
892
893 install.libs:
894 ifeq ($(OTP_SMALL_BUILD),true)
895 cd lib && \
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
896 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
897 $(MAKE) TESTROOT=$(ERLANG_LIBDIR) release
898 else
899 cd lib && \
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
900 ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
901 $(MAKE) TESTROOT=$(ERLANG_LIBDIR) BUILD_ALL=true release
902 endif
903
904 install.Install:
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
905 (cd $(ERLANG_LIBDIR) \
906 && ./Install $(INSTALL_CROSS) -minimal $(ERLANG_INST_LIBDIR))
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
907
908 #
909 # Install erlang base public files
910 #
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
911
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
912 install.bin:
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
913 @ DESTDIR="$(DESTDIR)" EXTRA_PREFIX="$(EXTRA_PREFIX)" \
914 LN_S="$(LN_S)" BINDIR_SYMLINKS="$(BINDIR_SYMLINKS)" \
915 $(ERL_TOP)/make/install_bin \
916 --bindir "$(bindir)" \
917 --erlang-bindir "$(erlang_bindir)" \
918 --exec-prefix "$(exec_prefix)" \
919 $(ERL_BASE_PUB_FILES)
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
920
921 #
922 # Directories needed before we can install
923 #
924 install.dirs:
925 test -d $(BINDIR) || ${MKSUBDIRS} $(BINDIR)
926 ${MKSUBDIRS} $(ERLANG_LIBDIR)
927 ${MKSUBDIRS} $(ERLANG_LIBDIR)/usr/lib
928
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
929 .PHONY: strict_install
930
931 strict_install: $(IBIN_DIR) $(IBIN_FILES)
932
933 $(IBIN_FILES): $(ERL_TOP)/make/unexpected_use
934 rm -f $@
935 (cd $(dir $@) && $(LN_S) $(ERL_TOP)/make/unexpected_use $(notdir $@))
936
937 $(IBIN_DIR):
938 $(MKSUBDIRS) $@
939
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
940 # ----------------------------------------------------------------------
941
942 .PHONY: clean eclean bootstrap_root_clean bootstrap_clean
943
944 #
945 # Clean targets
946 #
947
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
948 clean: check_recreate_primary_bootstrap
1b78e85 @rickard-green OTP-8323 Cross compilation improvements and other build system
rickard-green authored Feb 3, 2010
949 rm -f *~ *.bak config.log config.status prebuilt.files ibin/*
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
950 find . -type f -name SKIP -print | xargs $(RM)
951 cd erts && ERL_TOP=$(ERL_TOP) $(MAKE) clean
952 cd lib && ERL_TOP=$(ERL_TOP) $(MAKE) clean BUILD_ALL=true
953
954 #
955 # Just wipe out emulator, not libraries
956 #
957
958 eclean:
959 cd erts && ERL_TOP=$(ERL_TOP) $(MAKE) clean
960
961 #
962 # Clean up bootstrap
963 #
964
965 bootstrap_root_clean:
966 rm -f $(BOOTSTRAP_ROOT)/bootstrap/lib/*/ebin/*.beam
967 rm -f $(BOOTSTRAP_ROOT)/bootstrap/lib/*/include/*.hrl
968 rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/*.*
969
970 # $(ERL_TOP)/bootstrap *should* equal $(BOOTSTRAP_TOP)
971 #
972 # We use $(ERL_TOP)/bootstrap instead of $(BOOTSTRAP_TOP) here as an
973 # extra safety precaution (we would really make a mess if
974 # $(BOOTSTRAP_TOP) for some reason should be empty).
975 bootstrap_clean:
976 rm -f $(ERL_TOP)/bootstrap/lib/*/ebin/*.beam
d0c862a @bjorng Fix building of primary bootstrap when versions have changed
bjorng authored Aug 3, 2010
977 rm -f $(ERL_TOP)/bootstrap/lib/*/ebin/*.app
84adefa The R13B03 release.
Erlang/OTP authored Nov 20, 2009
978 rm -f $(ERL_TOP)/bootstrap/lib/*/egen/*
979 rm -f $(ERL_TOP)/bootstrap/lib/*/include/*.hrl
980 rm -f $(ERL_TOP)/bootstrap/primary_compiler/ebin/*
981 rm -f $(ERL_TOP)/bootstrap/primary_compiler/egen/*
982 rm -f $(ERL_TOP)/bootstrap/bin/*.*
983 rm -f $(KERNEL_PRELOAD:%=$(ERL_TOP)/lib/kernel/ebin/%.beam)
984 test $(BOOTSTRAP_ROOT) = $(ERL_TOP) \
985 || $(MAKE) BOOTSTRAP_ROOT=$(BOOTSTRAP_ROOT) bootstrap_root_clean
986
987 # ----------------------------------------------------------------------
Something went wrong with that request. Please try again.