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
20 MANDIR=$(DESTDIR)$(PREFIX)/share/man
21 DOCDIR=$(DESTDIR)$(PREFIX)/share/doc/bup
22 BINDIR=$(DESTDIR)$(PREFIX)/bin
23 LIBDIR=$(DESTDIR)$(PREFIX)/lib/bup
25 $(INSTALL) -d $(MANDIR)/man1 $(DOCDIR) $(BINDIR) \
26 $(LIBDIR)/bup $(LIBDIR)/cmd $(LIBDIR)/tornado \
27 $(LIBDIR)/web $(LIBDIR)/web/static
28 [ ! -e Documentation/.docs-available ] || \
32 [ ! -e Documentation/.docs-available ] || \
34 Documentation/*.html \
36 $(INSTALL) -m 0755 bup $(BINDIR)
61 config/config.h: config/Makefile config/configure config/configure.inc \
62 $(wildcard config/*.in)
63 cd config && $(MAKE) config.h
65 lib/bup/_helpers$(SOEXT): \
67 lib/bup/bupsplit.c lib/bup/_helpers.c lib/bup/csetup.py
70 LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS)" $(PYTHON) csetup.py build
71 cp lib/bup/build/*/_helpers$(SOEXT) lib/bup/
73 .PHONY: lib/bup/_version.py
76 ./format-subst.pl $@.pre >$@.new
79 runtests: all runtests-python runtests-cmdline
84 $(filter-out lib/bup/t/tmetadata.py,$(wildcard lib/*/t/t*.py))
85 [ -z "$(TEST_META)" ] || \
86 $(PYTHON) wvtest.py lib/bup/t/tmetadata.py
90 [ -z "$(TEST_META)" ] || t/test-meta.sh
93 PATH=/bin:/usr/bin $(MAKE) test
96 ./wvtestrun $(MAKE) PYTHON=$(PYTHON) runtests
105 $(patsubst cmd/%-cmd.py,cmd/bup-%,$(wildcard cmd/*-cmd.py)) \
106 $(patsubst cmd/%-cmd.sh,cmd/bup-%,$(wildcard cmd/*-cmd.sh))
108 cmd/bup-%: cmd/%-cmd.py
120 cmd/bup-%: cmd/%-cmd.sh
124 # update the local 'man' and 'html' branches with pregenerated output files, for
125 # people who don't have pandoc (and maybe to aid in google searches or something)
126 export-docs: Documentation/all
127 git update-ref refs/heads/man origin/man '' 2>/dev/null || true
128 git update-ref refs/heads/html origin/html '' 2>/dev/null || true
129 GIT_INDEX_FILE=gitindex.tmp; export GIT_INDEX_FILE; \
130 rm -f $${GIT_INDEX_FILE} && \
131 git add -f Documentation/*.1 && \
132 git update-ref refs/heads/man \
133 $$(echo "Autogenerated man pages for $$(git describe)" \
134 | git commit-tree $$(git write-tree --prefix=Documentation) \
135 -p refs/heads/man) && \
136 rm -f $${GIT_INDEX_FILE} && \
137 git add -f Documentation/*.html && \
138 git update-ref refs/heads/html \
139 $$(echo "Autogenerated html pages for $$(git describe)" \
140 | git commit-tree $$(git write-tree --prefix=Documentation) \
143 # push the pregenerated doc files to origin/man and origin/html
144 push-docs: export-docs
145 git push origin man html
147 # import pregenerated doc files from origin/man and origin/html, in case you
148 # don't have pandoc but still want to be able to install the docs.
149 import-docs: Documentation/clean
150 git archive origin/html | (cd Documentation; tar -xvf -)
151 git archive origin/man | (cd Documentation; tar -xvf -)
153 clean: Documentation/clean
154 rm -f *.o lib/*/*.o *.so lib/*/*.so *.dll lib/*/*.dll *.exe \
155 .*~ *~ */*~ lib/*/*~ lib/*/*/*~ \
156 *.pyc */*.pyc lib/*/*.pyc lib/*/*/*.pyc \
157 bup bup-* cmd/bup-* lib/bup/_version.py randomgen memtest \
158 out[12] out2[tc] tags[12] tags2[tc] \
159 testfs.img lib/bup/t/testfs.img
160 rm -rf *.tmp t/*.tmp lib/*/*/*.tmp build lib/bup/build
161 if test -e testfs; then rmdir testfs; fi
162 if test -e lib/bup/t/testfs; then rmdir lib/bup/t/testfs; fi