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