forked from servo/servo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.backup
18 lines (15 loc) · 928 Bytes
/
Makefile.backup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# 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