1 OS:=$(shell uname | sed 's/[-_].*//')
2 CFLAGS := -Wall -O2 -Werror -Wno-unknown-pragmas $(PYINCLUDE) $(CFLAGS)
3 CFLAGS := -D_FILE_OFFSET_BITS=64 $(CFLAGS)
13 test_tmp := $(CURDIR)/t/tmp
18 all: bup Documentation/all
19 t/configure-sampledata --setup
21 bup: lib/bup/_version.py lib/bup/_helpers$(SOEXT) cmds main.py
24 Documentation/all: bup
29 MANDIR=$(DESTDIR)$(PREFIX)/share/man
30 DOCDIR=$(DESTDIR)$(PREFIX)/share/doc/bup
31 BINDIR=$(DESTDIR)$(PREFIX)/bin
32 LIBDIR=$(DESTDIR)$(PREFIX)/lib/bup
34 $(INSTALL) -d $(MANDIR)/man1 $(DOCDIR) $(BINDIR) \
35 $(LIBDIR)/bup $(LIBDIR)/cmd \
36 $(LIBDIR)/web $(LIBDIR)/web/static
37 [ ! -e Documentation/.docs-available ] || \
41 [ ! -e Documentation/.docs-available ] || \
43 Documentation/*.html \
45 $(INSTALL) -pm 0755 bup $(BINDIR)
67 config/config.h: config/Makefile config/configure config/configure.inc \
68 $(wildcard config/*.in)
69 cd config && $(MAKE) config.h
71 lib/bup/_helpers$(SOEXT): \
73 lib/bup/bupsplit.c lib/bup/_helpers.c lib/bup/csetup.py
76 LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)" $(PYTHON) csetup.py build
77 cp lib/bup/build/*/_helpers$(SOEXT) lib/bup/
79 .PHONY: lib/bup/_version.py
82 ./format-subst.pl $@.pre >$@.new
85 runtests: all runtests-python runtests-cmdline
88 test -e t/tmp || mkdir t/tmp
89 TMPDIR="$(test_tmp)" $(PYTHON) wvtest.py t/t*.py lib/*/t/t*.py
92 test -e t/tmp || mkdir t/tmp
93 TMPDIR="$(test_tmp)" t/test-fuse.sh
94 TMPDIR="$(test_tmp)" t/test-drecurse.sh
95 TMPDIR="$(test_tmp)" t/test-cat-file.sh
96 TMPDIR="$(test_tmp)" t/test-compression.sh
97 TMPDIR="$(test_tmp)" t/test-fsck.sh
98 TMPDIR="$(test_tmp)" t/test-index-clear.sh
99 TMPDIR="$(test_tmp)" t/test-index-check-device.sh
100 TMPDIR="$(test_tmp)" t/test-ls.sh
101 TMPDIR="$(test_tmp)" t/test-meta.sh
102 TMPDIR="$(test_tmp)" t/test-on.sh
103 TMPDIR="$(test_tmp)" t/test-restore-map-owner.sh
104 TMPDIR="$(test_tmp)" t/test-restore-single-file.sh
105 TMPDIR="$(test_tmp)" t/test-rm-between-index-and-save.sh
106 TMPDIR="$(test_tmp)" t/test-sparse-files.sh
107 TMPDIR="$(test_tmp)" t/test-command-without-init-fails.sh
108 TMPDIR="$(test_tmp)" t/test-redundant-saves.sh
109 TMPDIR="$(test_tmp)" t/test-save-creates-no-unrefs.sh
110 TMPDIR="$(test_tmp)" t/test-save-restore-excludes.sh
111 TMPDIR="$(test_tmp)" t/test-save-strip-graft.sh
112 TMPDIR="$(test_tmp)" t/test-import-rdiff-backup.sh
113 TMPDIR="$(test_tmp)" t/test-xdev.sh
114 TMPDIR="$(test_tmp)" t/test.sh
117 PATH=/bin:/usr/bin $(MAKE) test
120 ./wvtestrun $(MAKE) PYTHON=$(PYTHON) runtests
125 $(patsubst cmd/%-cmd.py,cmd/bup-%,$(wildcard cmd/*-cmd.py)) \
126 $(patsubst cmd/%-cmd.sh,cmd/bup-%,$(wildcard cmd/*-cmd.sh))
128 cmd/bup-%: cmd/%-cmd.py
140 cmd/bup-%: cmd/%-cmd.sh
144 # update the local 'man' and 'html' branches with pregenerated output files, for
145 # people who don't have pandoc (and maybe to aid in google searches or something)
146 export-docs: Documentation/all
147 git update-ref refs/heads/man origin/man '' 2>/dev/null || true
148 git update-ref refs/heads/html origin/html '' 2>/dev/null || true
149 GIT_INDEX_FILE=gitindex.tmp; export GIT_INDEX_FILE; \
150 rm -f $${GIT_INDEX_FILE} && \
151 git add -f Documentation/*.1 && \
152 git update-ref refs/heads/man \
153 $$(echo "Autogenerated man pages for $$(git describe --always)" \
154 | git commit-tree $$(git write-tree --prefix=Documentation) \
155 -p refs/heads/man) && \
156 rm -f $${GIT_INDEX_FILE} && \
157 git add -f Documentation/*.html && \
158 git update-ref refs/heads/html \
159 $$(echo "Autogenerated html pages for $$(git describe --always)" \
160 | git commit-tree $$(git write-tree --prefix=Documentation) \
163 # push the pregenerated doc files to origin/man and origin/html
164 push-docs: export-docs
165 git push origin man html
167 # import pregenerated doc files from origin/man and origin/html, in case you
168 # don't have pandoc but still want to be able to install the docs.
169 import-docs: Documentation/clean
170 git archive origin/html | (cd Documentation; tar -xvf -)
171 git archive origin/man | (cd Documentation; tar -xvf -)
173 clean: Documentation/clean config/clean
174 rm -f *.o lib/*/*.o *.so lib/*/*.so *.dll lib/*/*.dll *.exe \
175 .*~ *~ */*~ lib/*/*~ lib/*/*/*~ \
176 *.pyc */*.pyc lib/*/*.pyc lib/*/*/*.pyc \
177 bup bup-* cmd/bup-* lib/bup/_version.py randomgen memtest \
178 testfs.img lib/bup/t/testfs.img
179 if test -e t/mnt; then t/cleanup-mounts-under t/mnt; fi
180 if test -e t/mnt; then rm -r t/mnt; fi
181 if test -e t/tmp; then t/cleanup-mounts-under t/tmp; fi
182 # FIXME: migrate these to t/mnt/
183 if test -e lib/bup/t/testfs; \
184 then umount lib/bup/t/testfs || true; fi
185 rm -rf *.tmp *.tmp.meta t/*.tmp lib/*/*/*.tmp build lib/bup/build lib/bup/t/testfs
186 if test -e t/tmp; then t/force-delete t/tmp; fi
187 t/configure-sampledata --clean