aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2010-08-10 13:52:01 +0200
committerRickard Green <[email protected]>2010-08-10 13:52:01 +0200
commit29d5bc047964a01e55f18baf0a31387ed3b7d2cd (patch)
tree1e4ececed688548024bad6ec65c672bfc492a2c3
parentbc8817258be92596c255103da7c0e0c7e7c855c2 (diff)
parent958d3463f1081a67cbd68b3dcf14624a72c1200f (diff)
downloadotp-29d5bc047964a01e55f18baf0a31387ed3b7d2cd.tar.gz
otp-29d5bc047964a01e55f18baf0a31387ed3b7d2cd.tar.bz2
otp-29d5bc047964a01e55f18baf0a31387ed3b7d2cd.zip
Merge branch 'rickard/bootstrap_setup/OTP-8756' into dev
* rickard/bootstrap_setup/OTP-8756: Regenerate bootstrap/{erl,erlc} when switching target
-rw-r--r--Makefile.in15
-rw-r--r--prebuild.delete1
2 files changed, 12 insertions, 4 deletions
diff --git a/Makefile.in b/Makefile.in
index 8453c3bdf5..b420628751 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -485,11 +485,13 @@ dep depend:
# Creates "erl" and "erlc" in bootstrap/bin which uses the precompiled
# libraries in the bootstrap directory
+.PHONY: bootstrap_setup_target
+
# ----------------------------------------------------------------------
# Bootstraps...
# ----------------------------------------------------------------------
ifeq ($(TARGET),win32)
-bootstrap_setup: check_recreate_primary_bootstrap
+bootstrap_setup: check_recreate_primary_bootstrap bootstrap_setup_target
@rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erl.exe \
$(BOOTSTRAP_ROOT)/bootstrap/bin/erlc.exe \
$(BOOTSTRAP_ROOT)/bootstrap/bin/erl.ini \
@@ -501,9 +503,9 @@ bootstrap_setup: check_recreate_primary_bootstrap
@cp $(ERL_TOP)/bin/$(TARGET)/erl.exe \
$(BOOTSTRAP_ROOT)/bootstrap/bin/erl.exe
else
-bootstrap_setup: check_recreate_primary_bootstrap $(BOOTSTRAP_ROOT)/bootstrap/bin/erl $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
+bootstrap_setup: check_recreate_primary_bootstrap bootstrap_setup_target $(BOOTSTRAP_ROOT)/bootstrap/bin/erl $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
-$(BOOTSTRAP_ROOT)/bootstrap/bin/erl: $(ERL_TOP)/erts/etc/unix/erl.src.src
+$(BOOTSTRAP_ROOT)/bootstrap/bin/erl: $(ERL_TOP)/erts/etc/unix/erl.src.src $(BOOTSTRAP_ROOT)/bootstrap/target
@rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erl
@sed -e "s;%FINAL_ROOTDIR%;$(BOOTSTRAP_ROOT)/bootstrap;" \
-e "s;\$$ROOTDIR/erts-.*/bin;$(ERL_TOP)/bin/$(TARGET);" \
@@ -512,12 +514,17 @@ $(BOOTSTRAP_ROOT)/bootstrap/bin/erl: $(ERL_TOP)/erts/etc/unix/erl.src.src
$(BOOTSTRAP_ROOT)/bootstrap/bin/erl
@chmod 755 $(BOOTSTRAP_ROOT)/bootstrap/bin/erl
-$(BOOTSTRAP_ROOT)/bootstrap/bin/erlc: $(ERL_TOP)/bin/$(TARGET)/erlc
+$(BOOTSTRAP_ROOT)/bootstrap/bin/erlc: $(ERL_TOP)/bin/$(TARGET)/erlc $(BOOTSTRAP_ROOT)/bootstrap/target
@rm -f $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
@cp $(ERL_TOP)/bin/$(TARGET)/erlc $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
@chmod 755 $(BOOTSTRAP_ROOT)/bootstrap/bin/erlc
endif
+bootstrap_setup_target:
+ @{ test -r $(BOOTSTRAP_ROOT)/bootstrap/target && \
+ test $(TARGET) = `cat $(BOOTSTRAP_ROOT)/bootstrap/target`; } || \
+ echo $(TARGET) > $(BOOTSTRAP_ROOT)/bootstrap/target
+
secondary_bootstrap_build:
cd lib && \
ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \
diff --git a/prebuild.delete b/prebuild.delete
index 901480a63d..b1b18adbcb 100644
--- a/prebuild.delete
+++ b/prebuild.delete
@@ -1 +1,2 @@
bootstrap/lib
+bootstrap/target