From 676c5b6949e3e906a22e03923f96d3360441889f Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Tue, 29 Apr 2014 11:10:22 -0600 Subject: [PATCH] Change how backup/restore make task works. Now we write $SRC/.config.mk.last to store the most recent configure variables for the backup and restore task. Also, they no longer fail if they can't find the variables, and will skip the backup/restore stages and keep going. --- .gitignore | 1 + Makefile.backup | 9 +++++---- configure | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 92fdd68adc7..0f266544995 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ .DS_Store servo-test Servo.app +.config.mk.last build* objdir parser.out diff --git a/Makefile.backup b/Makefile.backup index bbf570888da..dd91f7f48fb 100644 --- a/Makefile.backup +++ b/Makefile.backup @@ -7,11 +7,12 @@ # # restore-rust is run after configure and before invoking make. if it fails, we must abort. -include config.mk +-include .config.mk.last -.PHONY: backup-rust restore-rust +.PHONY: backup-rust backup-rust: - -mv $(CFG_BUILD_DIR)src/compiler/rust ../$(CFG_TARGET) + @if [ ! -z "$(CFG_BUILD_DIR)" ]; then echo "Backing up Rust"; mv $(CFG_BUILD_DIR)src/compiler/rust ../$(CFG_TARGET); else echo "Skipping Rust backup"; fi +.PHONY: restore-rust restore-rust: - if [ -d ../$(CFG_TARGET) ]; then rm -rf $(CFG_BUILD_DIR)src/compiler/rust; mv ../$(CFG_TARGET) $(CFG_BUILD_DIR)src/compiler/rust; fi + @if [ ! -z "$(CFG_BUILD_DIR)" -a -d ../$(CFG_TARGET) ]; then echo "Restoring Rust from backup"; rm -rf $(CFG_BUILD_DIR)src/compiler/rust; mv ../$(CFG_TARGET) $(CFG_BUILD_DIR)src/compiler/rust; else echo "Skipping Rust restore"; fi diff --git a/configure b/configure index 6500fb8eeb3..3312d91037a 100755 --- a/configure +++ b/configure @@ -565,6 +565,7 @@ putvar CFG_ENABLE_DEBUG_SKIA msg copy_if_changed ${CFG_SRC_DIR}Makefile.in ${CFG_BUILD_HOME}Makefile move_if_changed ${CFG_BUILD_HOME}config.tmp ${CFG_BUILD_HOME}config.mk +copy_if_changed ${CFG_BUILD_HOME}config.mk ${CFG_SRC_DIR}/.config.mk.last rm -f ${CFG_BUILD_HOME}config.tmp touch ${CFG_BUILD_HOME}config.stamp