1 OS:=$(shell uname | sed 's/[-_].*//')
2 CFLAGS:=-Wall -O2 -Werror $(PYINCLUDE)
11 all: bup Documentation/all
13 bup: lib/bup/_version.py lib/bup/_helpers$(SOEXT) cmds
15 Documentation/all: bup
19 MANDIR=$(DESTDIR)/usr/share/man
20 DOCDIR=$(DESTDIR)/usr/share/doc/bup
21 BINDIR=$(DESTDIR)/usr/bin
22 LIBDIR=$(DESTDIR)/usr/lib/bup
24 $(INSTALL) -d $(MANDIR)/man1 $(DOCDIR) $(BINDIR) \
25 $(LIBDIR)/bup $(LIBDIR)/cmd $(LIBDIR)/tornado \
26 $(LIBDIR)/web $(LIBDIR)/web/static
27 [ ! -e Documentation/.docs-available ] || \
31 [ ! -e Documentation/.docs-available ] || \
33 Documentation/*.html \
35 $(INSTALL) -m 0755 bup $(BINDIR)
60 config/config.h: config/Makefile config/configure config/configure.inc \
61 $(wildcard config/*.in)
62 cd config && make config.h
64 lib/bup/_helpers$(SOEXT): \
66 lib/bup/bupsplit.c lib/bup/_helpers.c lib/bup/csetup.py
69 LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)" $(PYTHON) csetup.py build
70 cp lib/bup/build/*/_helpers$(SOEXT) lib/bup/
72 .PHONY: lib/bup/_version.py
75 ./format-subst.pl $@.pre >$@.new
78 runtests: all runtests-python runtests-cmdline
81 $(PYTHON) wvtest.py t/t*.py lib/*/t/t*.py
88 PATH=/bin:/usr/bin $(MAKE) test
91 ./wvtestrun $(MAKE) PYTHON=$(PYTHON) runtests
100 $(patsubst cmd/%-cmd.py,cmd/bup-%,$(wildcard cmd/*-cmd.py)) \
101 $(patsubst cmd/%-cmd.sh,cmd/bup-%,$(wildcard cmd/*-cmd.sh))
103 cmd/bup-%: cmd/%-cmd.py
115 cmd/bup-%: cmd/%-cmd.sh
119 # update the local 'man' and 'html' branches with pregenerated output files, for
120 # people who don't have pandoc (and maybe to aid in google searches or something)
121 export-docs: Documentation/all
122 git update-ref refs/heads/man origin/man '' 2>/dev/null || true
123 git update-ref refs/heads/html origin/html '' 2>/dev/null || true
124 GIT_INDEX_FILE=gitindex.tmp; export GIT_INDEX_FILE; \
125 rm -f $${GIT_INDEX_FILE} && \
126 git add -f Documentation/*.1 && \
127 git update-ref refs/heads/man \
128 $$(echo "Autogenerated man pages for $$(git describe)" \
129 | git commit-tree $$(git write-tree --prefix=Documentation) \
130 -p refs/heads/man) && \
131 rm -f $${GIT_INDEX_FILE} && \
132 git add -f Documentation/*.html && \
133 git update-ref refs/heads/html \
134 $$(echo "Autogenerated html pages for $$(git describe)" \
135 | git commit-tree $$(git write-tree --prefix=Documentation) \
138 # push the pregenerated doc files to origin/man and origin/html
139 push-docs: export-docs
140 git push origin man html
142 # import pregenerated doc files from origin/man and origin/html, in case you
143 # don't have pandoc but still want to be able to install the docs.
144 import-docs: Documentation/clean
145 git archive origin/html | (cd Documentation; tar -xvf -)
146 git archive origin/man | (cd Documentation; tar -xvf -)
148 # tgit.py plays with permissions on lib/bup/t/pybuptest.tmp, so we should
149 # ensure that we can delete the directory before doing it.
150 clean: Documentation/clean
151 rm -f *.o lib/*/*.o *.so lib/*/*.so *.dll *.exe \
152 .*~ *~ */*~ lib/*/*~ lib/*/*/*~ \
153 *.pyc */*.pyc lib/*/*.pyc lib/*/*/*.pyc \
154 bup bup-* cmd/bup-* lib/bup/_version.py randomgen memtest \
155 out[12] out2[tc] tags[12] tags2[tc] \
156 testfs.img lib/bup/t/testfs.img
157 rm -rf *.tmp t/*.tmp lib/*/*/*.tmp build lib/bup/build
158 if test -e testfs; then rmdir testfs; fi
159 if test -e lib/bup/t/testfs; then rmdir lib/bup/t/testfs; fi