servo/Makefile.backup
2014-06-13 15:58:29 +05:30

18 lines
928 B
Text

# Build commands for backing up and restoring the Rust build.
# Because Rust takes a very long time to build and changes infrequently,
# the bots want to reuse it between builds. They can do so by running
# `make backup-rust` and `make restore-rust`.
#
# backup-rust is run before the build directory is cleaned. if it fails, that's ok.
#
# restore-rust is run after configure and before invoking make. if it fails, we must abort.
-include .config.mk.last
.PHONY: backup-rust
backup-rust:
@if [ -d $(CFG_BUILD_DIR)src/compiler/rust/ ]; 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 [ ! -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