]> arthur.barton.de Git - bup.git/blobdiff - Makefile
Add "/t/sampledata/var" to .gitignore
[bup.git] / Makefile
index 181d42c1aebd7e528bd1c10a331b8994f6e8ae3e..11896134586681951ea2ea55de7c40033d4bd256 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,7 @@
+
+sampledata_rev := $(shell t/configure-sampledata --revision)
+current_sampledata := t/sampledata/var/rev/v$(sampledata_rev)
+
 OS:=$(shell uname | sed 's/[-_].*//')
 CFLAGS := -Wall -O2 -Werror -Wno-unknown-pragmas $(PYINCLUDE) $(CFLAGS)
 CFLAGS := -D_FILE_OFFSET_BITS=64 $(CFLAGS)
@@ -13,15 +17,18 @@ else
   test_tmp := $(CURDIR)/t/tmp
 endif
 
-.PHONY: all
-all: bup Documentation/all
-       t/configure-sampledata --setup
+initial_setup := $(shell ./configure-version --update)
+bup_deps := bup lib/bup/_version.py lib/bup/_helpers$(SOEXT) cmds
 
-bup: lib/bup/_version.py lib/bup/_helpers$(SOEXT) cmds main.py
-       -ln -s main.py bup
-       test -L bup
+all: $(bup_deps) Documentation/all $(current_sampledata)
 
-Documentation/all: bup
+bup:
+       ln -s main.py bup
+
+Documentation/all: $(bup_deps)
+
+$(current_sampledata):
+       t/configure-sampledata --setup
 
 INSTALL=install
 PYTHON=python
@@ -76,15 +83,10 @@ lib/bup/_helpers$(SOEXT): \
        LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)" $(PYTHON) csetup.py build
        cp lib/bup/build/*/_helpers$(SOEXT) lib/bup/
 
-# This must be completely atomic since it may be run (often) in
-# parallel when "-j" is specified, either via targets here, or via
-# tests that use an install tree as data.
-.PHONY: lib/bup/_version.py
 lib/bup/_version.py:
-       rm -f $@.tmp-$$$$ \
-       && ./format-subst.pl $@.pre > $@.tmp-$$$$ \
-       && (if ! test -e $@ || ! cmp $@ $@.tmp-$$$$; then mv $@.tmp-$$$$ $@; fi) \
-       && rm -f $@.tmp-$$$$
+       @echo "Something has gone wrong; $@ should already exist."
+       @echo 'Check "./configure-version --update"'
+       @false
 
 t/tmp:
        mkdir t/tmp
@@ -179,7 +181,6 @@ clean: Documentation/clean config/clean
                .*~ *~ */*~ lib/*/*~ lib/*/*/*~ \
                *.pyc */*.pyc lib/*/*.pyc lib/*/*/*.pyc \
                bup bup-* cmd/bup-* \
-               lib/bup/_version.py lib/bup/_version.py.tmp-* \
                randomgen memtest \
                testfs.img lib/bup/t/testfs.img
        if test -e t/mnt; then t/cleanup-mounts-under t/mnt; fi
@@ -190,4 +191,5 @@ clean: Documentation/clean config/clean
          then umount lib/bup/t/testfs || true; fi
        rm -rf *.tmp *.tmp.meta t/*.tmp lib/*/*/*.tmp build lib/bup/build lib/bup/t/testfs
        if test -e t/tmp; then t/force-delete t/tmp; fi
+       ./configure-version --clean
        t/configure-sampledata --clean