1 OS:=$(shell uname | sed 's/[-_].*//')
2 CFLAGS:=-Wall -O2 -Werror $(PYINCLUDE)
11 all: bup Documentation/all
12 t/configure-sampledata --setup
14 bup: lib/bup/_version.py lib/bup/_helpers$(SOEXT) cmds
16 Documentation/all: bup
21 MANDIR=$(DESTDIR)$(PREFIX)/share/man
22 DOCDIR=$(DESTDIR)$(PREFIX)/share/doc/bup
23 BINDIR=$(DESTDIR)$(PREFIX)/bin
24 LIBDIR=$(DESTDIR)$(PREFIX)/lib/bup
26 $(INSTALL) -d $(MANDIR)/man1 $(DOCDIR) $(BINDIR) \
27 $(LIBDIR)/bup $(LIBDIR)/cmd $(LIBDIR)/tornado \
28 $(LIBDIR)/web $(LIBDIR)/web/static
29 [ ! -e Documentation/.docs-available ] || \
33 [ ! -e Documentation/.docs-available ] || \
35 Documentation/*.html \
37 $(INSTALL) -m 0755 bup $(BINDIR)
62 config/config.h: config/Makefile config/configure config/configure.inc \
63 $(wildcard config/*.in)
64 cd config && $(MAKE) config.h
66 lib/bup/_helpers$(SOEXT): \
68 lib/bup/bupsplit.c lib/bup/_helpers.c lib/bup/csetup.py
71 LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)" $(PYTHON) csetup.py build
72 cp lib/bup/build/*/_helpers$(SOEXT) lib/bup/
74 .PHONY: lib/bup/_version.py
77 ./format-subst.pl $@.pre >$@.new
80 runtests: all runtests-python runtests-cmdline
85 $(filter-out lib/bup/t/tmetadata.py,$(wildcard lib/*/t/t*.py))
86 $(PYTHON) wvtest.py lib/bup/t/tmetadata.py
89 t/test-index-check-device.sh
91 t/test-restore-single-file.sh
92 t/test-rm-between-index-and-save.sh
96 PATH=/bin:/usr/bin $(MAKE) test
99 ./wvtestrun $(MAKE) PYTHON=$(PYTHON) runtests
108 $(patsubst cmd/%-cmd.py,cmd/bup-%,$(wildcard cmd/*-cmd.py)) \
109 $(patsubst cmd/%-cmd.sh,cmd/bup-%,$(wildcard cmd/*-cmd.sh))
111 cmd/bup-%: cmd/%-cmd.py
123 cmd/bup-%: cmd/%-cmd.sh
127 # update the local 'man' and 'html' branches with pregenerated output files, for
128 # people who don't have pandoc (and maybe to aid in google searches or something)
129 export-docs: Documentation/all
130 git update-ref refs/heads/man origin/man '' 2>/dev/null || true
131 git update-ref refs/heads/html origin/html '' 2>/dev/null || true
132 GIT_INDEX_FILE=gitindex.tmp; export GIT_INDEX_FILE; \
133 rm -f $${GIT_INDEX_FILE} && \
134 git add -f Documentation/*.1 && \
135 git update-ref refs/heads/man \
136 $$(echo "Autogenerated man pages for $$(git describe)" \
137 | git commit-tree $$(git write-tree --prefix=Documentation) \
138 -p refs/heads/man) && \
139 rm -f $${GIT_INDEX_FILE} && \
140 git add -f Documentation/*.html && \
141 git update-ref refs/heads/html \
142 $$(echo "Autogenerated html pages for $$(git describe)" \
143 | git commit-tree $$(git write-tree --prefix=Documentation) \
146 # push the pregenerated doc files to origin/man and origin/html
147 push-docs: export-docs
148 git push origin man html
150 # import pregenerated doc files from origin/man and origin/html, in case you
151 # don't have pandoc but still want to be able to install the docs.
152 import-docs: Documentation/clean
153 git archive origin/html | (cd Documentation; tar -xvf -)
154 git archive origin/man | (cd Documentation; tar -xvf -)
156 clean: Documentation/clean config/clean
157 rm -f *.o lib/*/*.o *.so lib/*/*.so *.dll lib/*/*.dll *.exe \
158 .*~ *~ */*~ lib/*/*~ lib/*/*/*~ \
159 *.pyc */*.pyc lib/*/*.pyc lib/*/*/*.pyc \
160 bup bup-* cmd/bup-* lib/bup/_version.py randomgen memtest \
161 out[12] out2[tc] tags[12] tags2[tc] \
162 testfs.img lib/bup/t/testfs.img
163 umount t/mnt/* || true
164 if test -e t/mnt; then rm -r t/mnt; fi
165 # FIXME: migrate these to t/mnt/
166 if test -e bupmeta.tmp/testfs; \
167 then umount bupmeta.tmp/testfs || true; fi
168 if test -e lib/bup/t/testfs; \
169 then umount lib/bup/t/testfs || true; fi
170 if test -e bupmeta.tmp/testfs-limited; \
171 then umount bupmeta.tmp/testfs-limited || true; fi
172 rm -rf *.tmp *.tmp.meta t/*.tmp lib/*/*/*.tmp build lib/bup/build lib/bup/t/testfs
173 if test -e t/tmp; then rm -r t/tmp; fi
174 t/configure-sampledata --clean