1
# ``The contents of this file are subject to the Erlang Public License,
4
# Copyright Ericsson AB 1998-2009. All Rights Reserved.
6
# The contents of this file are subject to the Erlang Public License,
2
7
# Version 1.1, (the "License"); you may not use this file except in
3
8
# compliance with the License. You should have received a copy of the
4
9
# Erlang Public License along with this software. If not, it can be
5
# retrieved via the world wide web at http://www.erlang.org/.
10
# retrieved online at http://www.erlang.org/.
7
12
# Software distributed under the License is distributed on an "AS IS"
8
13
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
9
14
# the License for the specific language governing rights and limitations
10
15
# under the License.
12
# The Initial Developer of the Original Code is Ericsson Utvecklings AB.
13
# Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
14
# AB. All Rights Reserved.''
18
19
# Toplevel makefile for building the Erlang system
281
282
ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
282
283
$(MAKE) opt BUILD_ALL=true
287
cd erts/preloaded/src && \
288
ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
289
$(MAKE) opt BUILD_ALL=true
285
292
cd erts/emulator && ERL_TOP=$(ERL_TOP) $(MAKE) generate depend
286
293
cd erts/lib_src && ERL_TOP=$(ERL_TOP) $(MAKE) depend
291
298
# ----------------------------------------------------------------------
293
300
# ----------------------------------------------------------------------
301
ifeq ($(TARGET),win32)
295
302
bootstrap_setup: check_recreate_primary_bootstrap
296
ifeq ($(TARGET),win32)
297
303
@rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erl.exe \
298
304
$(BOOTSTRAP_ROOT)/bootstrap/bin/erlc.exe \
299
305
$(BOOTSTRAP_ROOT)/bootstrap/bin/erl.ini \
305
311
@cp $(ERL_TOP)/bin/$(TARGET)/erl.exe \
306
312
$(BOOTSTRAP_ROOT)/bootstrap/bin/erl.exe
308
@rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erl \
309
$(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
314
bootstrap_setup: check_recreate_primary_bootstrap $(BOOTSTRAP_ROOT)/bootstrap/bin/erl $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
316
$(BOOTSTRAP_ROOT)/bootstrap/bin/erl: $(ERL_TOP)/erts/etc/unix/erl.src.src
317
@rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erl
310
318
@sed -e "s;%FINAL_ROOTDIR%;$(BOOTSTRAP_ROOT)/bootstrap;" \
311
319
-e "s;\$$ROOTDIR/erts-.*/bin;$(ERL_TOP)/bin/$(TARGET);" \
312
320
-e "s;EMU=.*;EMU=beam$(TYPEMARKER);" \
313
321
$(ERL_TOP)/erts/etc/unix/erl.src.src > \
314
322
$(BOOTSTRAP_ROOT)/bootstrap/bin/erl
323
@chmod 755 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl
325
$(BOOTSTRAP_ROOT)/bootstrap/bin/erlc: $(ERL_TOP)/bin/$(TARGET)/erlc
326
@rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
315
327
@cp $(ERL_TOP)/bin/$(TARGET)/erlc $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
316
@chmod 755 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl \
317
$(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
328
@chmod 755 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
320
331
secondary_bootstrap_build:
325
336
secondary_bootstrap_copy:
326
337
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe ; fi
327
338
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin ; fi
328
if test -f lib/hipe/ebin/hipe.beam ; then cp lib/hipe/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin; fi
339
for x in lib/hipe/ebin/*.beam; do \
341
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin/$$BN; \
343
test '!' -z "`find $$x -newer $$TF -print`" && \
345
test '!' -f $$TF && \
349
# if test -f lib/hipe/ebin/hipe.beam ; then cp lib/hipe/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin; fi
329
350
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; fi
330
351
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; fi
331
352
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include ; fi
332
cp lib/parsetools/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin
333
cp -f lib/parsetools/include/*.hrl $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include
353
for x in lib/parsetools/ebin/*.beam; do \
355
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin/$$BN; \
357
test '!' -z "`find $$x -newer $$TF -print`" && \
359
test '!' -f $$TF && \
363
# cp lib/parsetools/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin
364
for x in lib/parsetools/include/*.hrl; do \
366
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include/$$BN; \
368
test '!' -z "`find $$x -newer $$TF -print`" && \
370
test '!' -f $$TF && \
374
# cp -f lib/parsetools/include/*.hrl $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include
334
375
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1 ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1 ; fi
335
376
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin ; fi
336
377
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src ; fi
337
cp lib/asn1/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin
338
cp -f lib/asn1/src/*.erl lib/asn1/src/*.hrl $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src
378
for x in lib/asn1/ebin/*.beam; do \
380
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin/$$BN; \
382
test '!' -z "`find $$x -newer $$TF -print`" && \
384
test '!' -f $$TF && \
388
# cp lib/asn1/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/ebin
389
for x in lib/asn1/src/*.[eh]rl; do \
391
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src/$$BN; \
393
test '!' -z "`find $$x -newer $$TF -print`" && \
395
test '!' -f $$TF && \
399
# cp -f lib/asn1/src/*.erl lib/asn1/src/*.hrl $(BOOTSTRAP_ROOT)/bootstrap/lib/asn1/src
340
401
tertiary_bootstrap_build:
346
407
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp ; fi
347
408
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin ; fi
348
409
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/include ; fi
349
cp lib/snmp/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin
410
for x in lib/snmp/ebin/*.beam; do \
412
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin/$$BN; \
414
test '!' -z "`find $$x -newer $$TF -print`" && \
416
test '!' -f $$TF && \
420
# cp lib/snmp/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/snmp/ebin
351
422
fourth_bootstrap_build:
360
431
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/ic ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/ic ; fi
361
432
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin ; fi
362
433
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include ; fi
363
cp lib/ic/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin
364
cp -f lib/ic/include/*.idl lib/ic/include/*.h $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include
365
cp lib/sasl/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin
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 \
439
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin/$$BN; \
441
test '!' -z "`find $$x -newer $$TF -print`" && \
443
test '!' -f $$TF && \
447
# cp lib/ic/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin
448
for x in lib/ic/include/*.idl; do \
450
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include/$$BN; \
452
test '!' -z "`find $$x -newer $$TF -print`" && \
454
test '!' -f $$TF && \
458
for x in lib/ic/include/*.h; do \
460
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/include/$$BN; \
462
test '!' -z "`find $$x -newer $$TF -print`" && \
464
test '!' -f $$TF && \
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 \
471
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin/$$BN; \
473
test '!' -z "`find $$x -newer $$TF -print`" && \
475
test '!' -f $$TF && \
479
# cp lib/sasl/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/sasl/ebin
366
480
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools ; fi
367
481
if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin ; fi
368
cp lib/syntax_tools/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin
482
for x in lib/syntax_tools/ebin/*.beam; do \
484
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin/$$BN; \
486
test '!' -z "`find $$x -newer $$TF -print`" && \
488
test '!' -f $$TF && \
492
for x in lib/wx/include/*.hrl; do \
494
TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/wx/include/$$BN; \
496
test '!' -z "`find $$x -newer $$TF -print`" && \
498
test '!' -f $$TF && \
503
# cp lib/syntax_tools/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin
370
505
.PHONY: check_recreate_primary_bootstrap recreate_primary_bootstrap
405
540
# These modules should stay in the kernel directory to make building
406
541
# of the emulator possible
407
KERNEL_PRELOAD = otp_ring0 init erl_prim_loader prim_inet prim_file zlib prim_zip erlang
409
543
.PHONY: primary_bootstrap \
410
544
primary_bootstrap_check_make \
423
557
$(MAKE) TESTROOT=$(BOOTSTRAP_TOP) \
424
558
BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) \
425
559
primary_bootstrap_copy
426
cd lib/kernel/src && \
427
$(MAKE) ERLC_FLAGS='-pa $(BOOTSTRAP_COMPILER)/ebin' \
428
$(KERNEL_PRELOAD:%=../ebin/%.beam)
429
560
cd $(ERL_TOP)/erts/start_scripts && \
430
561
$(MAKE) TESTROOT=$(BOOTSTRAP_TOP) \
431
562
BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) bootstrap_scripts
501
632
# To remove modules left by the bootstrap building, but leave (restore)
502
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
503
635
KERNEL_PRELOAD_BEAMS=$(KERNEL_PRELOAD:%=$(BOOTSTRAP_TOP)/lib/kernel/ebin/%.beam)
505
637
# Creates "erl" and "erlc" scripts in bin/erl which uses the libraries in lib