Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 874 lines (760 sloc) 29.567 kb
e128232 Yurii Rashkovskii R13B01 has been imported
authored
1 #
2 # %CopyrightBegin%
3 #
4 # Copyright Ericsson AB 1998-2009. All Rights Reserved.
5 #
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/.
11 #
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.
16 #
17 # %CopyrightEnd%
18
19 # Toplevel makefile for building the Erlang system
20 #
21
22 # ----------------------------------------------------------------------
23
24 # And you'd think that this would be obvious... :-)
25 SHELL = /bin/sh
26
27 # The top directory in which Erlang is unpacked
28 ERL_TOP = @ERL_TOP@
29
30 # erts (Erlang RunTime System) version
31 ERTS = @ERTS@
32
33 # ----------------------------------------------------------------------
34
35 #
36 # The variables below control where Erlang is installed. They are
37 # configurable (unless otherwise stated). Some of them are best
38 # changed by giving special arguments to configure instead of changing
39 # them in this file. Note: If you change them in Makefile, instead of
40 # Makefile.in your changes will be lost the next time you run
41 # configure.
42 #
43
44 # prefix from autoconf, default is /usr/local (must be an absolute path)
45 prefix = @prefix@
46 exec_prefix = @exec_prefix@
47
48 # The following can be set in case you install Erlang in a different
49 # location from where you have configured it to run. This can be
50 # useful e.g. when installing on a server that stores the files with a
51 # different path from where the clients access them. Or when building
52 # rpms.
53 #INSTALL_PREFIX =
54 # Naah...override `prefix' instead.
55
56 # The directory in which user executables (ERL_BASE_PUB_FILES) are put
57 BINDIR = $(INSTALL_PREFIX)@bindir@
58
59 #
60 # Erlang base public files
61 #
62 ERL_BASE_PUB_FILES=erl erlc epmd run_erl to_erl dialyzer typer escript
63
64 # The directory which will contain installed Erlang version.
65 # (ILIBDIR is supposed to be LIBDIR *without* the install prefix)
66 ERLANG_LIBDIR = $(INSTALL_PREFIX)@libdir@/erlang
67 ERLANG_ILIBDIR = @libdir@/erlang
68
69 # You can *not* change these two, they have to stay this way for now.
70 ERLANG_BINDIR = $(ERLANG_LIBDIR)/bin
71 ERLANG_ERTSBINDIR = $(ERLANG_LIBDIR)/$(ERTS)/bin
72
73 # The directory in which man pages for above executables are put
74 ERL_MAN1DIR = $(INSTALL_PREFIX)@mandir@/man1
75 ERL_MAN1EXT = 1
76
77 # The directory in which Erlang private man pages are put. In order
78 # not to clutter up the man namespace these are by default put in the
79 # Erlang private directory $(ERLANG_ILIBDIR)/man. If you want to
80 # install the man pages together with the rest give the argument
81 # "--disable-erlang-mandir" when you run configure, which will set
82 # MAN_DIR to @mandir@.
83 # If you want a special suffix on the manpages set ERL_MANEXT to
84 # this suffix, e.g. "erl"
85 ERL_MANDIR = $(INSTALL_PREFIX)@erl_mandir@
86 ERL_MANEXT =
87
88 # ----------------------------------------------------------------------
89
90 # Must be GNU make!
91 MAKE = @MAKE_PROG@
92
93 # This should be set to the target "arch-vendor-os"
94 export TARGET = @TARGET@
95
96 # A BSD compatible install program
97 INSTALL = @INSTALL@
98 INSTALL_PROGRAM = @INSTALL_PROGRAM@
99 INSTALL_DATA = @INSTALL_DATA@
100 MKSUBDIRS = ${INSTALL} -d
101
102 # Program to create symbolic links
103 LN_S = @LN_S@
104
105 # Ranlib program, if not needed set to e.g. ":"
106 RANLIB = @RANLIB@
107
108 # ----------------------------------------------------------------------
109
110 #
111 # The directory where at least the primary bootstrap is placed under.
112 #
113 # We need to build to view private files in case we are in clearcase;
114 # therefore, we don't want BOOTSTRAP_TOP changed.
115 #
116 # PRIMARY_BOOTSTRAP_TOP would perhaps have been a better name...
117 #
118 override BOOTSTRAP_TOP = $(ERL_TOP)/bootstrap
119 # BOOTSTRAP_SRC_TOP is normally the same as BOOTSTRAP_TOP but
120 # it is allowed to be changed
121 BOOTSTRAP_SRC_TOP = $(BOOTSTRAP_TOP)
122
123 # Where to install the bootstrap directory.
124 #
125 # Typically one might want to set this to a fast local filesystem, or,
126 # the default, as ERL_TOP
127 BOOTSTRAP_ROOT = $(ERL_TOP)
128
129 # Directories which you need in the path if you wish to run the
130 # locally built system. (This can be put in front or back of the path
131 # depending on which system is preferred.)
132 LOCAL_PATH = $(ERL_TOP)/erts/bin/$(TARGET):$(ERL_TOP)/erts/bin
133 ifeq ($(TARGET),win32)
134 WIN32_WRAPPER_PATH=$(ERL_TOP)/erts/etc/win32/cygwin_tools
135 BOOT_PREFIX=$(WIN32_WRAPPER_PATH):$(BOOTSTRAP_ROOT)/bootstrap/bin:
136 else
137 BOOT_PREFIX=$(BOOTSTRAP_ROOT)/bootstrap/bin:
138 endif
139 # ----------------------------------------------------------------------
140 # Fix up RELEASE_ROOT/TESTROOT havoc
141 ifeq ($(RELEASE_ROOT),)
142 ifneq ($(TESTROOT),)
143 RELEASE_ROOT = $(TESTROOT)
144 endif
145 endif
146
147
148 # ----------------------------------------------------------------------
149
150 # A default for the release_tests, not same target dir as release.
151 # More TESTROOT havoc...
152 ifeq ($(TESTSUITE_ROOT),)
153 ifneq ($(TESTROOT),)
154 TESTSUITE_ROOT = $(TESTROOT)
155 else
156 TESTSUITE_ROOT = $(ERL_TOP)/release/tests
157 endif
158 endif
159
160 #
161 # The steps to build a working system are:
162 # * build an emulator
163 # * setup the erl and erlc program in bootstrap/bin
164 # * build additional compilers and copy them into bootstrap/lib
165 # * use the bootstrap erl and erlc to build all the libs
166 #
167 all: all_bootstraps \
168 libs local_setup dialyzer
169
170 # With all bootstraps we mean all bootstrapping that is done when
171 # the system is delivered in open source, the primary
172 # bootstrap is not included, it requires a pre built emulator...
173 all_bootstraps: depend emulator \
174 bootstrap_setup \
175 secondary_bootstrap_build secondary_bootstrap_copy \
176 tertiary_bootstrap_build tertiary_bootstrap_copy \
177 fourth_bootstrap_build fourth_bootstrap_copy
178
179 #
180 # Use these targets when you want to use the erl and erlc
181 # binaries in your PATH instead of those created from the
182 # pre-compiled Erlang modules under bootstrap/.
183 #
184 ifeq ($(findstring ose,$(TARGET)),ose)
185 noboot:
186 $(MAKE) BOOT_PREFIX= emulator libs
187 else
188 noboot:
189 $(MAKE) BOOT_PREFIX= emulator libs local_setup
190 endif
191 noboot_install:
192 $(MAKE) BOOT_PREFIX= install
193
194 .PHONY: release release_docs
195
196 release:
197 ifeq ($(OTP_SMALL_BUILD),true)
198 cd $(ERL_TOP)/lib && $(MAKE) TESTROOT=$(RELEASE_ROOT) release
199 else
200 cd $(ERL_TOP)/lib && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release
201 ifneq ($(findstring vxworks,$(TARGET)),vxworks)
202 @if test -f lib/dialyzer/SKIP ; then \
203 echo "=== Skipping dialyzer, reason:" ; \
204 cat lib/dialyzer/SKIP ; \
205 echo "===" ; \
206 else \
207 cd $(ERL_TOP)/lib/dialyzer && \
208 $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release ; \
209 fi
210 endif
211 endif
212 cd $(ERL_TOP)/erts && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release
213
214 # ---------------------------------------------------------------
215 # Target only used when building commercial ERTS patches
216 # ---------------------------------------------------------------
217 release_docs:
218 ifeq ($(OTP_SMALL_BUILD),true)
219 cd $(ERL_TOP)/lib && $(MAKE) TESTROOT=$(RELEASE_ROOT) release_docs
220 else
221 cd $(ERL_TOP)/lib && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release_docs
222 cd $(ERL_TOP)/lib/dialyzer && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release_docs
223 endif
224 cd $(ERL_TOP)/erts && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release_docs
225
226
227 # ----------------------------------------------------------------------
228 ERLANG_EARS=$(BOOTSTRAP_ROOT)/bootstrap/erts
229 ELINK=$(BOOTSTRAP_ROOT)/bootstrap/erts/bin/elink
230 BOOT_BINDIR=$(BOOTSTRAP_ROOT)/bootstrap/erts/bin
231 BEAM_EVM=$(ERL_TOP)/bin/$(TARGET)/beam_evm
232 BOOTSTRAP_COMPILER = $(BOOTSTRAP_TOP)/primary_compiler
233
234 emulator:
235 cd erts && ERL_TOP=$(ERL_TOP) $(MAKE) NO_START_SCRIPTS=true $(TYPE) FLAVOR=$(FLAVOR)
236
237 libs:
238 ifeq ($(OTP_SMALL_BUILD),true)
239 cd lib && \
240 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
241 $(MAKE) opt
242 else
243 cd lib && \
244 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
245 $(MAKE) opt BUILD_ALL=true
246 endif
247 kernel:
248 cd lib/kernel && \
249 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
250 $(MAKE) opt BUILD_ALL=true
251
252 stdlib:
253 cd lib/stdlib && \
254 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
255 $(MAKE) opt BUILD_ALL=true
256
257 compiler:
258 cd lib/compiler && \
259 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
260 $(MAKE) opt BUILD_ALL=true
261
262 hlib hipe:
263 cd lib/hipe && \
264 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
265 $(MAKE) opt BUILD_ALL=true
266
267 dialyzer:
268 ifneq ($(OTP_SMALL_BUILD),true)
269 @if test -f lib/dialyzer/SKIP ; then \
270 echo "=== Skipping dialyzer, reason:" ; \
271 cat lib/dialyzer/SKIP ; \
272 echo "===" ; \
273 else \
274 cd lib/dialyzer && \
275 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
276 $(MAKE) opt BUILD_ALL=true ; \
277 fi
278 endif
279
280 typer:
281 cd lib/typer && \
282 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
283 $(MAKE) opt BUILD_ALL=true
284
285
286 preloaded:
287 cd erts/preloaded/src && \
288 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
289 $(MAKE) opt BUILD_ALL=true
290
291 dep depend:
292 test X"$$ERTS_SKIP_DEPEND" = X"true" || (cd erts/emulator && ERL_TOP=$(ERL_TOP) $(MAKE) generate depend)
293 test X"$$ERTS_SKIP_DEPEND" = X"true" || (cd erts/lib_src && ERL_TOP=$(ERL_TOP) $(MAKE) depend)
294
295 # Creates "erl" and "erlc" in bootstrap/bin which uses the precompiled
296 # libraries in the bootstrap directory
297
298 # ----------------------------------------------------------------------
299 # Bootstraps...
300 # ----------------------------------------------------------------------
301 ifeq ($(TARGET),win32)
302 bootstrap_setup: check_recreate_primary_bootstrap
303 @rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erl.exe \
304 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc.exe \
305 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl.ini \
306 $(BOOTSTRAP_ROOT)/bootstrap/bin/beam.dll
307 make_bootstrap_ini.sh $(BOOTSTRAP_ROOT)/bootstrap \
308 $(ERL_TOP)/bin/$(TARGET)
309 @cp $(ERL_TOP)/bin/$(TARGET)/erlc.exe \
310 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc.exe
311 @cp $(ERL_TOP)/bin/$(TARGET)/erl.exe \
312 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl.exe
313 else
314 bootstrap_setup: check_recreate_primary_bootstrap $(BOOTSTRAP_ROOT)/bootstrap/bin/erl $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
315
316 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl: $(ERL_TOP)/erts/etc/unix/erl.src.src
317 @rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erl
318 @sed -e "s;%FINAL_ROOTDIR%;$(BOOTSTRAP_ROOT)/bootstrap;" \
319 -e "s;\$$ROOTDIR/erts-.*/bin;$(ERL_TOP)/bin/$(TARGET);" \
320 -e "s;EMU=.*;EMU=beam$(TYPEMARKER);" \
321 $(ERL_TOP)/erts/etc/unix/erl.src.src > \
322 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl
323 @chmod 755 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl
324
325 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc: $(ERL_TOP)/bin/$(TARGET)/erlc
326 @rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
327 @cp $(ERL_TOP)/bin/$(TARGET)/erlc $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
328 @chmod 755 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
329 endif
330
331 secondary_bootstrap_build:
332 cd lib && \
333 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
334 $(MAKE) opt SECONDARY_BOOTSTRAP=true
335
336 secondary_bootstrap_copy:
337 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe ; fi
338 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin ; fi
339 for x in lib/hipe/ebin/*.beam; do \
340 BN=`basename $$x`; \
341 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin/$$BN; \
342 test -f $$TF && \
343 test '!' -z "`find $$x -newer $$TF -print`" && \
344 cp $$x $$TF; \
345 test '!' -f $$TF && \
346 cp $$x $$TF; \
347 true; \
348 done
349 # if test -f lib/hipe/ebin/hipe.beam ; then cp lib/hipe/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin; fi
350 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; fi
351 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; fi
352 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include ; fi
353 for x in lib/parsetools/ebin/*.beam; do \
354 BN=`basename $$x`; \
355 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin/$$BN; \
356 test -f $$TF && \
357 test '!' -z "`find $$x -newer $$TF -print`" && \
358 cp $$x $$TF; \
359 test '!' -f $$TF && \
360 cp $$x $$TF; \
361 true; \
362 done
363 # cp lib/parsetools/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin
364 for x in lib/parsetools/include/*.hrl; do \
365 BN=`basename $$x`; \
366 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include/$$BN; \
367 test -f $$TF && \
368 test '!' -z "`find $$x -newer $$TF -print`" && \
369 cp $$x $$TF; \
370 test '!' -f $$TF && \
371 cp $$x $$TF; \
372 true; \
373 done
374 # cp -f lib/parsetools/include/*.hrl $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include
375 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1 ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1 ; fi
376 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin ; fi
377 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src ; fi
378 for x in lib/asn1/ebin/*.beam; do \
379 BN=`basename $$x`; \
380 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin/$$BN; \
381 test -f $$TF && \
382 test '!' -z "`find $$x -newer $$TF -print`" && \
383 cp $$x $$TF; \
384 test '!' -f $$TF && \
385 cp $$x $$TF; \
386 true; \
387 done
388 # cp lib/asn1/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin
389 for x in lib/asn1/src/*.[eh]rl; do \
390 BN=`basename $$x`; \
391 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src/$$BN; \
392 test -f $$TF && \
393 test '!' -z "`find $$x -newer $$TF -print`" && \
394 cp $$x $$TF; \
395 test '!' -f $$TF && \
396 cp $$x $$TF; \
397 true; \
398 done
399 # cp -f lib/asn1/src/*.erl lib/asn1/src/*.hrl $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src
400
401 tertiary_bootstrap_build:
402 cd lib && \
403 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
404 $(MAKE) opt TERTIARY_BOOTSTRAP=true
405
406 tertiary_bootstrap_copy:
407 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp ; fi
408 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin ; fi
409 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/include ; fi
410 for x in lib/snmp/ebin/*.beam; do \
411 BN=`basename $$x`; \
412 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin/$$BN; \
413 test -f $$TF && \
414 test '!' -z "`find $$x -newer $$TF -print`" && \
415 cp $$x $$TF; \
416 test '!' -f $$TF && \
417 cp $$x $$TF; \
418 true; \
419 done
420 # cp lib/snmp/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin
421
422 fourth_bootstrap_build:
423 cd lib && \
424 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
425 $(MAKE) opt FOURTH_BOOTSTRAP=true
426
427 fourth_bootstrap_copy:
428 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl ; fi
429 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin ; fi
430 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/include ; fi
431 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/ic ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/ic ; fi
432 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin ; fi
433 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include ; fi
434 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx ; fi
435 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/ebin ; fi
436 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/include ; fi
437 for x in lib/ic/ebin/*.beam; do \
438 BN=`basename $$x`; \
439 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin/$$BN; \
440 test -f $$TF && \
441 test '!' -z "`find $$x -newer $$TF -print`" && \
442 cp $$x $$TF; \
443 test '!' -f $$TF && \
444 cp $$x $$TF; \
445 true; \
446 done
447 # cp lib/ic/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin
448 for x in lib/ic/include/*.idl; do \
449 BN=`basename $$x`; \
450 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include/$$BN; \
451 test -f $$TF && \
452 test '!' -z "`find $$x -newer $$TF -print`" && \
453 cp $$x $$TF; \
454 test '!' -f $$TF && \
455 cp $$x $$TF; \
456 true; \
457 done
458 for x in lib/ic/include/*.h; do \
459 BN=`basename $$x`; \
460 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include/$$BN; \
461 test -f $$TF && \
462 test '!' -z "`find $$x -newer $$TF -print`" && \
463 cp $$x $$TF; \
464 test '!' -f $$TF && \
465 cp $$x $$TF; \
466 true; \
467 done
468 # cp -f lib/ic/include/*.idl lib/ic/include/*.h $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include
469 for x in lib/sasl/ebin/*.beam; do \
470 BN=`basename $$x`; \
471 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin/$$BN; \
472 test -f $$TF && \
473 test '!' -z "`find $$x -newer $$TF -print`" && \
474 cp $$x $$TF; \
475 test '!' -f $$TF && \
476 cp $$x $$TF; \
477 true; \
478 done
479 # cp lib/sasl/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin
480 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools ; fi
481 if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin ; fi
482 for x in lib/syntax_tools/ebin/*.beam; do \
483 BN=`basename $$x`; \
484 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin/$$BN; \
485 test -f $$TF && \
486 test '!' -z "`find $$x -newer $$TF -print`" && \
487 cp $$x $$TF; \
488 test '!' -f $$TF && \
489 cp $$x $$TF; \
490 true; \
491 done
492 for x in lib/wx/include/*.hrl; do \
493 BN=`basename $$x`; \
494 TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/wx/include/$$BN; \
495 test -f $$TF && \
496 test '!' -z "`find $$x -newer $$TF -print`" && \
497 cp $$x $$TF; \
498 test '!' -f $$TF && \
499 cp $$x $$TF; \
500 true; \
501 done
502
503 # cp lib/syntax_tools/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin
504
505 .PHONY: check_recreate_primary_bootstrap recreate_primary_bootstrap
506
507
508 #
509 # If the source is a prebuilt delivery, no $(ERL_TOP)/bootstrap/lib
510 # directory will exist. All applications part of the primary bootstrap
511 # are delivered prebuilt though. If it is a prebuilt delivery we need
512 # to recreate the primary bootstrap, from the prebuilt result.
513 #
514 # A prebuild delivery always contain a $(ERL_TOP)/prebuilt.files file.
515 # If no such file exists, we wont try to recreate the primary bootstrap,
516 # since it will just fail producing anything useful.
517 #
518
519 check_recreate_primary_bootstrap:
520 @if test -f $(ERL_TOP)/prebuilt.files ; then \
521 if test ! -d $(ERL_TOP)/bootstrap/lib ; then \
522 $(ERL_TOP)/otp_build save_bootstrap ; \
523 fi ; \
524 fi
525
526 #
527 # recreate_primary_bootstrap assumes that if $(ERL_TOP)/prebuilt.files
528 # exist, all build results needed already exist in the application specific
529 # directories of all applications part of the primary bootstrap.
530 #
531 recreate_primary_bootstrap:
532 $(ERL_TOP)/otp_build save_bootstrap
533
534 # The first bootstrap build is rarely (never) used in open source, it's
535 # used to build the shipped bootstrap directory. The Open source bootstrap
536 # stages start with secondary bootstrap.
537 #
538 # These are the ones used, the other ones (prefixed with old_) are for BC.
539
540 # These modules should stay in the kernel directory to make building
541 # of the emulator possible
542
543 .PHONY: primary_bootstrap \
544 primary_bootstrap_check_make \
545 primary_bootstrap_build \
546 primary_bootstrap_compiler \
547 primary_bootstrap_mkdirs \
548 primary_bootstrap_copy
549
550 primary_bootstrap: primary_bootstrap_check_make
551 @echo "=== Building a bootstrap compiler in $(BOOTSTRAP_ROOT)/bootstrap"
552 cd $(ERL_TOP) && \
553 $(MAKE) TESTROOT=$(BOOTSTRAP_TOP) \
554 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
555 primary_bootstrap_build
556 cd $(ERL_TOP) && \
557 $(MAKE) TESTROOT=$(BOOTSTRAP_TOP) \
558 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
559 primary_bootstrap_copy
560 cd $(ERL_TOP)/erts/start_scripts && \
561 $(MAKE) TESTROOT=$(BOOTSTRAP_TOP) \
562 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) bootstrap_scripts
563 test $(BOOTSTRAP_ROOT) = $(ERL_TOP) \
564 || $(ERL_TOP)/otp_build \
565 copy_primary_bootstrap \
566 $(BOOTSTRAP_TOP) \
567 $(BOOTSTRAP_ROOT)
568
569 #
570 # Dependencies are not complete in all makefiles; therefore, remove bootstrap
571 # build result and build from scratch if we are not using clearmake (which
572 # tracks dependencies itself).
573 #
574 primary_bootstrap_check_make:
575 @ case "$(MAKE)" in \
576 *clearmake*) \
577 ;; \
578 *) \
579 $(MAKE) BOOTSTRAP_ROOT=$(BOOTSTRAP_ROOT) \
580 ERL_TOP=$(ERL_TOP) \
581 bootstrap_clean \
582 ;; \
583 esac
584
585 primary_bootstrap_build: primary_bootstrap_mkdirs primary_bootstrap_compiler \
586 primary_bootstrap_stdlib
587 cd lib && $(MAKE) ERLC_FLAGS='-pa $(BOOTSTRAP_COMPILER)/ebin' \
588 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
589 BOOTSTRAP=1 opt
590
591 primary_bootstrap_compiler:
592 cd lib/compiler && $(MAKE) \
593 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
594 BOOTSTRAP_COMPILER=$(BOOTSTRAP_COMPILER) \
595 BOOTSTRAP=1 \
596 opt
597
598 primary_bootstrap_stdlib:
599 cd lib/stdlib/src && $(MAKE) \
600 BOOTSTRAP_COMPILER=$(BOOTSTRAP_COMPILER) \
601 primary_bootstrap_compiler
602
603 primary_bootstrap_mkdirs:
604 test -d $(BOOTSTRAP_COMPILER)/egen \
605 || mkdir -p $(BOOTSTRAP_COMPILER)/egen
606 test -d $(BOOTSTRAP_COMPILER)/ebin \
607 || mkdir -p $(BOOTSTRAP_COMPILER)/ebin
608 test -d $(BOOTSTRAP_TOP)/lib/kernel/egen \
609 || mkdir -p $(BOOTSTRAP_TOP)/lib/kernel/egen
610 test -d $(BOOTSTRAP_TOP)/lib/kernel/ebin \
611 || mkdir -p $(BOOTSTRAP_TOP)/lib/kernel/ebin
612 test -d $(BOOTSTRAP_TOP)/lib/kernel/include \
613 || mkdir -p $(BOOTSTRAP_TOP)/lib/kernel/include
614 test -d $(BOOTSTRAP_TOP)/lib/stdlib/egen \
615 || mkdir -p $(BOOTSTRAP_TOP)/lib/stdlib/egen
616 test -d $(BOOTSTRAP_TOP)/lib/stdlib/ebin \
617 || mkdir -p $(BOOTSTRAP_TOP)/lib/stdlib/ebin
618 test -d $(BOOTSTRAP_TOP)/lib/stdlib/include \
619 || mkdir -p $(BOOTSTRAP_TOP)/lib/stdlib/include
620 test -d $(BOOTSTRAP_TOP)/lib/compiler/egen \
621 || mkdir -p $(BOOTSTRAP_TOP)/lib/compiler/egen
622 test -d $(BOOTSTRAP_TOP)/lib/compiler/ebin \
623 || mkdir -p $(BOOTSTRAP_TOP)/lib/compiler/ebin
624 test -d $(BOOTSTRAP_TOP)/lib/orber/include \
625 || mkdir -p $(BOOTSTRAP_TOP)/lib/orber/include
626
627 primary_bootstrap_copy:
628 cp -f lib/kernel/include/*.hrl $(BOOTSTRAP_TOP)/lib/kernel/include
629 cp -f lib/stdlib/include/*.hrl $(BOOTSTRAP_TOP)/lib/stdlib/include
630 cp -f lib/orber/include/* $(BOOTSTRAP_TOP)/lib/orber/include
631
632 # To remove modules left by the bootstrap building, but leave (restore)
633 # the modules in kernel which are needed for an emulator build
634 KERNEL_PRELOAD = otp_ring0 init erl_prim_loader prim_inet prim_file zlib prim_zip erlang
635 KERNEL_PRELOAD_BEAMS=$(KERNEL_PRELOAD:%=$(BOOTSTRAP_TOP)/lib/kernel/ebin/%.beam)
636
637 # Creates "erl" and "erlc" scripts in bin/erl which uses the libraries in lib
638 local_setup:
639 @rm -f erts/bin/erl erts/bin/erlc erts/bin/cerl
640 @cd erts && \
641 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
642 $(MAKE) local_setup
643
644
645
646 # ----------------------------------------------------------------------
647 # Build tests
648 # ---------------------------------------------------------------------
649
650 # Start with building the test server
651 TESTS = test_server
652
653 # Tests that can be run on any platform (keep alphabetic order, please)
654 TESTS += \
655 asn1_test \
656 common_test_test \
657 compiler_test \
658 emulator_test \
659 epmd_test \
660 erl_interface_test \
661 ic_test \
662 inets_test \
663 inviso_test \
664 jinterface_test \
665 kernel_test \
666 megaco_test \
667 mnesia_test \
668 observer_test \
669 orber_test \
670 os_mon_test \
671 otp_mibs_test \
672 percept_test \
673 pman_test \
674 public_key_test \
675 reltool_test \
676 sasl_test \
677 snmp_test \
678 runtime_tools_test \
679 stdlib_test \
680 system_test \
681 test_server_test \
682 wx_test
683
684 # Tests that can *not* be run on VxWorks
685 ifneq ($(findstring vxworks,$(TARGET)),vxworks)
686 TESTS += \
687 cosTransactions_test \
688 cosEvent_test \
689 cosTime_test \
690 cosNotification_test \
691 cosProperty_test \
692 cosFileTransfer_test \
693 cosEventDomain_test \
694 crypto_test \
695 debugger_test \
696 edoc_test \
697 eunit_test \
698 hipe_test \
699 odbc_test \
700 parsetools_test \
701 public_key_test \
702 ssl_test \
703 ssh_test \
704 syntax_tools_test \
705 tools_test \
706 toolbar_test \
707 xmerl_test
708 endif
709
710 .PHONY: tests release_tests test_server emulator_test system_test epmd_test
711
712 tests release_tests: $(TESTS)
713
714 # Build the test_server
715 test_server:
716 cd lib/test_server && $(MAKE) TESTROOT=$(TESTSUITE_ROOT) release_tests
717
718 emulator_test:
719 cd erts/emulator/test && $(MAKE) TESTROOT=$(TESTSUITE_ROOT) release_tests
720
721 system_test:
722 cd erts/test && $(MAKE) TESTROOT=$(TESTSUITE_ROOT) release_tests
723
724 epmd_test:
725 cd erts/epmd/test && $(MAKE) TESTROOT=$(TESTSUITE_ROOT) release_tests
726
727 %_test:
728 @dir="`echo $@ | sed 's/_test$$//'`"; \
729 cd lib/$$dir/test && $(MAKE) TESTROOT=$(TESTSUITE_ROOT) release_tests
730 # Should I also set TESTROOT_DIR=$(TESTSUITE_ROOT) ?
731 # ----------------------------------------------------------------------
732
733 # ----------------------------------------------------------------------
734 # Obsolete type of bootstrap where all stages where built with installed sytem
735 # shuld no longer be used and is soon to be removed.
736 # Abbreviations: OC = Old Compiler, NC = New Compiler,
737 # OE = Old Emulator, NE = New Emulator
738
739 old_com_bootstrap: old_bootstrap_nc_for_ne_all_stages old_bootstrap_ne old_bootstrap_scripts
740
741 #
742 # Builds the New Compiler for the New Emulator (using existing erlc
743 # and possibly new compiler) then copy everything to the release area.
744 # Use to create the commerciall bootstrap version, which should be obsolete.
745 #
746 old_bootstrap_nc_for_ne_all_stages:
747 test -d $(TESTROOT) || mkdir -p $(TESTROOT)
748 cd lib && $(MAKE) BOOTSTRAP=1 TYPE=release release
749 cd lib && $(MAKE) SECONDARY_BOOTSTRAP=1 TYPE=release release
750 cd lib && $(MAKE) TERTIARY_BOOTSTRAP=1 TYPE=release release
751 cd lib && $(MAKE) FOURTH_BOOTSTRAP=1 TYPE=release release
752
753
754
755 old_bootstrap_ne:
756 cd erts && $(MAKE) release
757
758 old_bootstrap_scripts:
759 cd erts/start_scripts && $(MAKE) release
760
761
762 # This is one strange name for a target, this actually builds and strips only
763 # the primary bootstrap, a minimal set of beam files to be able to continue
764 # bootstrap builds. It's used by other makefiles, so I refrain from
765 # changing the name right now...
766 bootstrap_nc_for_ne_no_debug_sym:
767 test -d $(TESTROOT) || mkdir -p $(TESTROOT)
768 cd lib && $(MAKE) ERLC_FLAGS='-pa $(BOOTSTRAP_COMPILER)/ebin' \
769 BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) BOOTSTRAP=1 TYPE=release release
770 $(ERL_TOP)/erts/emulator/utils/beam_strip $(TESTROOT)/lib/*/ebin/*.beam
771
772 # ----------------------------------------------------------------------
773
774 #
775 # Install
776 #
777 # Order is important here, don't change it!
778 #
779 install: install.dirs install.emulator install.libs install.Install install.bin
780
781 install.emulator:
782 cd erts && \
783 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
784 $(MAKE) TESTROOT=$(ERLANG_LIBDIR) release
785
786 install.libs:
787 ifeq ($(OTP_SMALL_BUILD),true)
788 cd lib && \
789 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
790 $(MAKE) TESTROOT=$(ERLANG_LIBDIR) release
791 else
792 cd lib && \
793 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
794 $(MAKE) TESTROOT=$(ERLANG_LIBDIR) BUILD_ALL=true release
795 @if test -f lib/dialyzer/SKIP ; then \
796 echo "=== Skipping dialyzer, reason:" ; \
797 cat lib/dialyzer/SKIP ; \
798 echo "===" ; \
799 else \
800 cd lib/dialyzer && \
801 ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
802 $(MAKE) TESTROOT=$(ERLANG_LIBDIR) BUILD_ALL=true release ; \
803 fi
804 endif
805
806 install.Install:
807 cd $(ERLANG_LIBDIR) && ./Install -minimal $(ERLANG_LIBDIR)
808
809 #
810 # Install erlang base public files
811 #
812 install.bin:
813 for file in $(ERL_BASE_PUB_FILES); do \
814 rm -f $(BINDIR)/$$file; \
815 ${LN_S} $(ERLANG_BINDIR)/$$file $(BINDIR)/$$file; \
816 done
817
818 #
819 # Directories needed before we can install
820 #
821 install.dirs:
822 test -d $(BINDIR) || ${MKSUBDIRS} $(BINDIR)
823 ${MKSUBDIRS} $(ERLANG_LIBDIR)
824 ${MKSUBDIRS} $(ERLANG_LIBDIR)/usr/lib
825
826 # ----------------------------------------------------------------------
827
828 .PHONY: clean eclean bootstrap_root_clean bootstrap_clean
829
830 #
831 # Clean targets
832 #
833
834 clean: check_recreate_primary_bootstrap
835 rm -f *~ *.bak config.log config.status prebuilt.files
836 find . -type f -name SKIP -print | xargs $(RM)
837 cd erts && ERL_TOP=$(ERL_TOP) $(MAKE) clean
838 cd lib && ERL_TOP=$(ERL_TOP) $(MAKE) clean BUILD_ALL=true
839 cd lib/dialyzer && ERL_TOP=$(ERL_TOP) $(MAKE) clean
840
841 #
842 # Just wipe out emulator, not libraries
843 #
844
845 eclean:
846 cd erts && ERL_TOP=$(ERL_TOP) $(MAKE) clean
847
848 #
849 # Clean up bootstrap
850 #
851
852 bootstrap_root_clean:
853 rm -f $(BOOTSTRAP_ROOT)/bootstrap/lib/*/ebin/*.beam
854 rm -f $(BOOTSTRAP_ROOT)/bootstrap/lib/*/include/*.hrl
855 rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/*.*
856
857 # $(ERL_TOP)/bootstrap *should* equal $(BOOTSTRAP_TOP)
858 #
859 # We use $(ERL_TOP)/bootstrap instead of $(BOOTSTRAP_TOP) here as an
860 # extra safety precaution (we would really make a mess if
861 # $(BOOTSTRAP_TOP) for some reason should be empty).
862 bootstrap_clean:
863 rm -f $(ERL_TOP)/bootstrap/lib/*/ebin/*.beam
864 rm -f $(ERL_TOP)/bootstrap/lib/*/egen/*
865 rm -f $(ERL_TOP)/bootstrap/lib/*/include/*.hrl
866 rm -f $(ERL_TOP)/bootstrap/primary_compiler/ebin/*
867 rm -f $(ERL_TOP)/bootstrap/primary_compiler/egen/*
868 rm -f $(ERL_TOP)/bootstrap/bin/*.*
869 rm -f $(KERNEL_PRELOAD:%=$(ERL_TOP)/lib/kernel/ebin/%.beam)
870 test $(BOOTSTRAP_ROOT) = $(ERL_TOP) \
871 || $(MAKE) BOOTSTRAP_ROOT=$(BOOTSTRAP_ROOT) bootstrap_root_clean
872
873 # ----------------------------------------------------------------------
Something went wrong with that request. Please try again.