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/_hashsplit$(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
37 [ ! -e Documentation/.docs-available ] || \
38 $(INSTALL) -o 0 -g 0 -m 0644 \
39 $(wildcard Documentation/*.1) \
41 [ ! -e Documentation/.docs-available ] || \
42 $(INSTALL) -o 0 -g 0 -m 0644 \
43 $(wildcard Documentation/*.html) \
45 $(INSTALL) -o 0 -g 0 -m 0755 bup $(BINDIR)
46 $(INSTALL) -o 0 -g 0 -m 0755 \
47 $(wildcard cmd/bup-*) \
49 $(INSTALL) -o 0 -g 0 -m 0644 \
50 $(wildcard lib/bup/*.so lib/bup/*.py) \
59 lib/bup/_hashsplit$(SOEXT): lib/bup/_hashsplit.c lib/bup/csetup.py
61 cd lib/bup && $(PYTHON) csetup.py build
62 cp lib/bup/build/*/_hashsplit$(SOEXT) lib/bup/
64 .PHONY: lib/bup/_version.py
67 ./format-subst.pl $@.pre >$@.new
70 runtests: all runtests-python runtests-cmdline
73 $(PYTHON) wvtest.py $(wildcard t/t*.py)
79 PATH=/bin:/usr/bin $(MAKE) test
82 ./wvtestrun $(MAKE) PYTHON=$(PYTHON) runtests
85 $(CC) $(CFLAGS) (LDFLAGS) -o $@ $^ $(LIBS)
91 cmds: $(patsubst cmd/%-cmd.py,cmd/bup-%,$(wildcard cmd/*-cmd.py))
93 cmd/bup-%: cmd/%-cmd.py
106 gcc -c -o $@ $< $(CPPFLAGS) $(CFLAGS)
108 clean: Documentation/clean
109 rm -f *.o *.so */*/*.so *.dll *.exe .*~ *~ */*~ */*/*~ \
110 *.pyc */*.pyc */*/*.pyc \
111 bup bup-* cmd/bup-* lib/bup/_version.py randomgen memtest \
112 out[12] out2[tc] tags[12] tags2[tc]
113 rm -rf *.tmp build lib/bup/build