diff --git a/mk/snap.mk b/mk/snap.mk index 50fda3e36673..94caac602857 100644 --- a/mk/snap.mk +++ b/mk/snap.mk @@ -1,3 +1,10 @@ -snap: - $(CFG_SRC_DIR)src/etc/make-snapshot.py \ No newline at end of file +snap-stage1: stage1/rustc stage1/glue.o stage1/$(CFG_STDLIB) + $(CFG_SRC_DIR)src/etc/make-snapshot.py stage1 + +snap-stage2: stage2/rustc stage2/glue.o stage2/$(CFG_STDLIB) + $(CFG_SRC_DIR)src/etc/make-snapshot.py stage2 + +snap-stage3: stage3/rustc stage3/glue.o stage3/$(CFG_STDLIB) + $(CFG_SRC_DIR)src/etc/make-snapshot.py stage3 + diff --git a/src/etc/make-snapshot.py b/src/etc/make-snapshot.py index d02c09487ee5..d46500cdf119 100755 --- a/src/etc/make-snapshot.py +++ b/src/etc/make-snapshot.py @@ -1,4 +1,4 @@ #!/usr/bin/env python -import snapshot -print(snapshot.make_snapshot()) +import snapshot, sys +print(snapshot.make_snapshot(sys.argv[1])) diff --git a/src/etc/snapshot.py b/src/etc/snapshot.py index 8eaa37917fa8..35bbc3ef9f00 100644 --- a/src/etc/snapshot.py +++ b/src/etc/snapshot.py @@ -102,7 +102,7 @@ def hash_file(x): return scrub(h.hexdigest()) -def make_snapshot(): +def make_snapshot(stage): kernel = get_kernel() platform = get_platform() rev = local_rev_short_sha() @@ -112,7 +112,7 @@ def make_snapshot(): tar = tarfile.open(file0, "w:bz2") for name in snapshot_files[kernel]: - tar.add(os.path.join("stage2", name), + tar.add(os.path.join(stage, name), "rust-stage0/" + name) tar.close()