394
394
# directories of all applications part of the primary bootstrap.
396
396
recreate_primary_bootstrap:
397
@if test ! -f $(ERL_TOP)/prebuilt.files ; then \
398
echo "Cannot recreate bootstrap; this is not a pre-built source distribution" ; \
400
if test -d $(ERL_TOP)/bootstrap/lib ; then \
401
echo "Bootstrap already exist" ; \
403
echo "Recreating primary bootstrap" ; \
404
$(MAKE) ERL_TOP=$(ERL_TOP) \
405
BOOTSTRAP_SRC_TOP=$(ERL_TOP) \
406
BOOTSTRAP_ROOT=$(ERL_TOP) \
407
primary_bootstrap_to_bootstrap_root_copy ; \
397
$(ERL_TOP)/otp_build save_bootstrap
411
399
# The first bootstrap build is rarely (never) used in open source, it's
412
400
# used to build the shipped bootstrap directory. The Open source bootstrap
417
405
# These modules should stay in the kernel directory to make building
418
406
# of the emulator possible
419
KERNEL_PRELOAD = otp_ring0 init erl_prim_loader prim_inet prim_file erlang
407
KERNEL_PRELOAD = otp_ring0 init erl_prim_loader prim_inet prim_file zlib prim_zip erlang
421
409
.PHONY: primary_bootstrap \
422
410
primary_bootstrap_check_make \
423
411
primary_bootstrap_build \
424
412
primary_bootstrap_compiler \
425
413
primary_bootstrap_mkdirs \
426
primary_bootstrap_copy \
427
primary_bootstrap_to_bootstrap_root_copy
414
primary_bootstrap_copy
429
416
primary_bootstrap: primary_bootstrap_check_make
430
417
@echo "=== Building a bootstrap compiler in $(BOOTSTRAP_ROOT)/bootstrap"
442
429
cd $(ERL_TOP)/erts/start_scripts && \
443
430
$(MAKE) TESTROOT=$(BOOTSTRAP_TOP) \
444
431
BOOTSTRAP_TOP=$(BOOTSTRAP_TOP) bootstrap_scripts
445
test $(BOOTSTRAP_ROOT) = $(ERL_TOP) || \
446
$(MAKE) ERL_TOP=$(ERL_TOP) \
447
BOOTSTRAP_SRC_TOP=$(BOOTSTRAP_TOP) \
448
BOOTSTRAP_ROOT=$(BOOTSTRAP_ROOT) \
449
primary_bootstrap_to_bootstrap_root_copy
432
test $(BOOTSTRAP_ROOT) = $(ERL_TOP) \
433
|| $(ERL_TOP)/otp_build \
434
copy_primary_bootstrap \
452
439
# Dependencies are not complete in all makefiles; therefore, remove bootstrap
511
498
cp -f lib/stdlib/include/*.hrl $(BOOTSTRAP_TOP)/lib/stdlib/include
512
499
cp -f lib/orber/include/* $(BOOTSTRAP_TOP)/lib/orber/include
514
primary_bootstrap_to_bootstrap_root_copy:
515
test -d $(BOOTSTRAP_ROOT)/bootstrap/lib/kernel/ebin \
516
|| mkdir -p $(BOOTSTRAP_ROOT)/bootstrap/lib/kernel/ebin
517
test -d $(BOOTSTRAP_ROOT)/bootstrap/lib/kernel/include \
518
|| mkdir -p $(BOOTSTRAP_ROOT)/bootstrap/lib/kernel/include
519
cp -f $(BOOTSTRAP_SRC_TOP)/lib/kernel/ebin/*.beam \
520
$(BOOTSTRAP_ROOT)/bootstrap/lib/kernel/ebin
521
cp -f $(BOOTSTRAP_SRC_TOP)/lib/kernel/ebin/*.app* \
522
$(BOOTSTRAP_ROOT)/bootstrap/lib/kernel/ebin
523
cp -f $(BOOTSTRAP_SRC_TOP)/lib/kernel/include/*.hrl \
524
$(BOOTSTRAP_ROOT)/bootstrap/lib/kernel/include
525
test -d $(BOOTSTRAP_ROOT)/bootstrap/lib/stdlib/ebin \
526
|| mkdir -p $(BOOTSTRAP_ROOT)/bootstrap/lib/stdlib/ebin
527
test -d $(BOOTSTRAP_ROOT)/bootstrap/lib/stdlib/include \
528
|| mkdir -p $(BOOTSTRAP_ROOT)/bootstrap/lib/stdlib/include
529
cp -f $(BOOTSTRAP_SRC_TOP)/lib/stdlib/ebin/*.beam \
530
$(BOOTSTRAP_ROOT)/bootstrap/lib/stdlib/ebin
531
cp -f $(BOOTSTRAP_SRC_TOP)/lib/stdlib/ebin/*.app* \
532
$(BOOTSTRAP_ROOT)/bootstrap/lib/stdlib/ebin
533
cp -f $(BOOTSTRAP_SRC_TOP)/lib/stdlib/include/*.hrl \
534
$(BOOTSTRAP_ROOT)/bootstrap/lib/stdlib/include
535
test -d $(BOOTSTRAP_ROOT)/bootstrap/lib/compiler/ebin \
536
|| mkdir -p $(BOOTSTRAP_ROOT)/bootstrap/lib/compiler/ebin
537
cp -f $(BOOTSTRAP_SRC_TOP)/lib/compiler/ebin/*.beam \
538
$(BOOTSTRAP_ROOT)/bootstrap/lib/compiler/ebin
539
cp -f $(BOOTSTRAP_SRC_TOP)/lib/compiler/ebin/*.app* \
540
$(BOOTSTRAP_ROOT)/bootstrap/lib/compiler/ebin
541
test -d $(BOOTSTRAP_ROOT)/bootstrap/lib/orber/include \
542
|| mkdir -p $(BOOTSTRAP_ROOT)/bootstrap/lib/orber/include
543
cp -f $(BOOTSTRAP_SRC_TOP)/lib/orber/include/* \
544
$(BOOTSTRAP_ROOT)/bootstrap/lib/orber/include
545
ifneq ($(BOOTSTRAP_SRC_TOP),$(ERL_TOP))
546
test -d $(BOOTSTRAP_ROOT)/bootstrap/bin \
547
|| mkdir -p $(BOOTSTRAP_ROOT)/bootstrap/bin
548
cp -f $(BOOTSTRAP_SRC_TOP)/bin/* \
549
$(BOOTSTRAP_ROOT)/bootstrap/bin
552
501
# To remove modules left by the bootstrap building, but leave (restore)
553
502
# the modules in kernel which are needed for an emulator build
554
503
KERNEL_PRELOAD_BEAMS=$(KERNEL_PRELOAD:%=$(BOOTSTRAP_TOP)/lib/kernel/ebin/%.beam)