1 OS:=$(shell uname | sed 's/[-_].*//')
2 CFLAGS=-Wall -g -O2 -Werror $(PYINCLUDE) -g
10 MACHINE:=$(shell arch)
11 CFLAGS += -arch $(MACHINE)
22 all: bup Documentation/all
24 bup: lib/bup/_version.py lib/bup/_helpers$(SOEXT) cmds
26 Documentation/all: bup
30 MANDIR=$(DESTDIR)/usr/share/man
31 DOCDIR=$(DESTDIR)/usr/share/doc/bup
32 BINDIR=$(DESTDIR)/usr/bin
33 LIBDIR=$(DESTDIR)/usr/lib/bup
35 $(INSTALL) -d $(MANDIR)/man1 $(DOCDIR) $(BINDIR) \
36 $(LIBDIR)/bup $(LIBDIR)/cmd $(LIBDIR)/tornado \
37 $(LIBDIR)/web $(LIBDIR)/web/static
38 [ ! -e Documentation/.docs-available ] || \
42 [ ! -e Documentation/.docs-available ] || \
44 Documentation/*.html \
46 $(INSTALL) -m 0755 bup $(BINDIR)
71 lib/bup/_helpers$(SOEXT): \
72 lib/bup/bupsplit.c lib/bup/_helpers.c lib/bup/csetup.py
74 cd lib/bup && $(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 $(PYTHON) wvtest.py t/t*.py lib/*/t/t*.py
93 PATH=/bin:/usr/bin $(MAKE) test
96 ./wvtestrun $(MAKE) PYTHON=$(PYTHON) runtests
101 $(CC) $(CFLAGS) (LDFLAGS) -o $@ $^ $(LIBS)
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
128 gcc -c -o $@ $< $(CPPFLAGS) $(CFLAGS)
130 # update the local 'man' and 'html' branches with pregenerated output files, for
131 # people who don't have pandoc (and maybe to aid in google searches or something)
132 export-docs: Documentation/all
133 git update-ref refs/heads/man origin/man '' 2>/dev/null || true
134 git update-ref refs/heads/html origin/html '' 2>/dev/null || true
135 GIT_INDEX_FILE=gitindex.tmp; export GIT_INDEX_FILE; \
136 rm -f $${GIT_INDEX_FILE} && \
137 git add -f Documentation/*.1 && \
138 git update-ref refs/heads/man \
139 $$(echo "Autogenerated man pages for $$(git describe)" \
140 | git commit-tree $$(git write-tree --prefix=Documentation) \
141 -p refs/heads/man) && \
142 rm -f $${GIT_INDEX_FILE} && \
143 git add -f Documentation/*.html && \
144 git update-ref refs/heads/html \
145 $$(echo "Autogenerated html pages for $$(git describe)" \
146 | git commit-tree $$(git write-tree --prefix=Documentation) \
149 # push the pregenerated doc files to origin/man and origin/html
150 push-docs: export-docs
151 git push origin man html
153 # import pregenerated doc files from origin/man and origin/html, in case you
154 # don't have pandoc but still want to be able to install the docs.
155 import-docs: Documentation/clean
156 git archive origin/html | (cd Documentation; tar -xvf -)
157 git archive origin/man | (cd Documentation; tar -xvf -)
159 clean: Documentation/clean
160 rm -f *.o lib/*/*.o *.so lib/*/*.so *.dll *.exe \
161 .*~ *~ */*~ lib/*/*~ lib/*/*/*~ \
162 *.pyc */*.pyc lib/*/*.pyc lib/*/*/*.pyc \
163 bup bup-* cmd/bup-* lib/bup/_version.py randomgen memtest \
164 out[12] out2[tc] tags[12] tags2[tc]
165 rm -rf *.tmp t/*.tmp lib/*/*/*.tmp build lib/bup/build