]> arthur.barton.de Git - bup.git/blob - Makefile
65ff880d644ad3a0f734463ff1427d435a3aad7d
[bup.git] / Makefile
1 CFLAGS=-Wall -g -O2 -Werror -I/usr/include/python2.5 -g -fPIC
2
3 default: all
4
5 all: bup-split bup-join bup-save bup randomgen chashsplit.so
6
7 randomgen: randomgen.o
8
9 chashsplit.so: chashsplitmodule.o
10         $(CC) -shared -o $@ $<
11         
12 runtests: all
13         ./wvtest.py $(wildcard t/t*.py)
14         
15 runtests-cmdline: all
16         @echo "Testing \"$@\" in Makefile:"
17         ./bup split --bench -b <testfile1 >tags1
18         ./bup split -vvvv -b testfile2 >tags2
19         ./bup split -t testfile2 >tags2t
20         ./bup split -c testfile2 >tags2c
21         diff -u tags1 tags2 || true
22         wc -c testfile1 testfile2
23         wc -l tags1 tags2
24         ./bup join $$(cat tags1) >out1
25         ./bup join <tags2 >out2
26         ./bup join <tags2t >out2t
27         ./bup join <tags2c >out2c
28         diff -u testfile1 out1
29         diff -u testfile2 out2
30         diff -u testfile2 out2t
31         diff -u testfile2 out2c
32         
33 test: all runtests-cmdline
34         ./wvtestrun $(MAKE) runtests
35
36 %: %.o
37         gcc -o $@ $< $(LDFLAGS) $(LIBS)
38         
39 bup: bup.py
40         rm -f $@
41         ln -s $^ $@
42         
43 bup-%: cmd-%.py
44         rm -f $@
45         ln -s $^ $@
46         
47 bup-%: cmd-%.sh
48         rm -f $@
49         ln -s $^ $@
50         
51 %.o: %.c
52         gcc -c -o $@ $^ $(CPPFLAGS) $(CFLAGS)
53
54 clean:
55         rm -f *.o *.so *~ .*~ *.pyc */*.pyc */*~ \
56                 bup bup-split bup-join bup-save randomgen \
57                 out[12] tags[12]