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 lib/bup/_helpers$(SOEXT): \
61 lib/bup/bupsplit.c lib/bup/_helpers.c lib/bup/csetup.py
63 cd lib/bup && LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)" $(PYTHON) csetup.py build
64 cp lib/bup/build/*/_helpers$(SOEXT) lib/bup/
66 .PHONY: lib/bup/_version.py
69 ./format-subst.pl $@.pre >$@.new
72 runtests: all runtests-python runtests-cmdline
75 $(PYTHON) wvtest.py t/t*.py lib/*/t/t*.py
82 PATH=/bin:/usr/bin $(MAKE) test
85 ./wvtestrun $(MAKE) PYTHON=$(PYTHON) runtests
94 $(patsubst cmd/%-cmd.py,cmd/bup-%,$(wildcard cmd/*-cmd.py)) \
95 $(patsubst cmd/%-cmd.sh,cmd/bup-%,$(wildcard cmd/*-cmd.sh))
97 cmd/bup-%: cmd/%-cmd.py
109 cmd/bup-%: cmd/%-cmd.sh
113 # update the local 'man' and 'html' branches with pregenerated output files, for
114 # people who don't have pandoc (and maybe to aid in google searches or something)
115 export-docs: Documentation/all
116 git update-ref refs/heads/man origin/man '' 2>/dev/null || true
117 git update-ref refs/heads/html origin/html '' 2>/dev/null || true
118 GIT_INDEX_FILE=gitindex.tmp; export GIT_INDEX_FILE; \
119 rm -f $${GIT_INDEX_FILE} && \
120 git add -f Documentation/*.1 && \
121 git update-ref refs/heads/man \
122 $$(echo "Autogenerated man pages for $$(git describe)" \
123 | git commit-tree $$(git write-tree --prefix=Documentation) \
124 -p refs/heads/man) && \
125 rm -f $${GIT_INDEX_FILE} && \
126 git add -f Documentation/*.html && \
127 git update-ref refs/heads/html \
128 $$(echo "Autogenerated html pages for $$(git describe)" \
129 | git commit-tree $$(git write-tree --prefix=Documentation) \
132 # push the pregenerated doc files to origin/man and origin/html
133 push-docs: export-docs
134 git push origin man html
136 # import pregenerated doc files from origin/man and origin/html, in case you
137 # don't have pandoc but still want to be able to install the docs.
138 import-docs: Documentation/clean
139 git archive origin/html | (cd Documentation; tar -xvf -)
140 git archive origin/man | (cd Documentation; tar -xvf -)
142 # tgit.py plays with permissions on lib/bup/t/pybuptest.tmp, so we should
143 # ensure that we can delete the directory before doing it.
144 clean: Documentation/clean
145 rm -f *.o lib/*/*.o *.so lib/*/*.so *.dll *.exe \
146 .*~ *~ */*~ lib/*/*~ lib/*/*/*~ \
147 *.pyc */*.pyc lib/*/*.pyc lib/*/*/*.pyc \
148 bup bup-* cmd/bup-* lib/bup/_version.py randomgen memtest \
149 out[12] out2[tc] tags[12] tags2[tc] \
150 testfs.img lib/bup/t/testfs.img
151 rm -rf *.tmp t/*.tmp lib/*/*/*.tmp build lib/bup/build
152 if test -e testfs; then rmdir testfs; fi
153 if test -e lib/bup/t/testfs; then rmdir lib/bup/t/testfs; fi