]> arthur.barton.de Git - bup.git/blob - Makefile
52679c8d0f319339903b71ced713f7340f0dc1a3
[bup.git] / Makefile
1 PYINCLUDE:=$(shell python2.5-config --includes)
2 PYLIB:=$(shell python2.5-config --lib)
3 OS:=$(shell uname)
4 MACHINE:=$(shell uname -m)
5 CFLAGS=-Wall -g -O2 -Werror $(PYINCLUDE) -g -fPIC
6 SHARED=-shared
7
8 ifeq (${OS},Darwin)
9   CFLAGS += -arch $(MACHINE)
10   SHARED = -dynamiclib
11 endif
12
13 default: all
14
15 all: bup-split bup-join bup-save bup-init bup-server bup-index \
16         bup randomgen chashsplit.so
17
18 randomgen: randomgen.o
19         $(CC) $(CFLAGS) -o $@ $<
20
21 chashsplit.so: chashsplitmodule.o
22         $(CC) $(CFLAGS) $(SHARED) -o $@ $< $(PYLIB)
23         
24 runtests: all
25         ./wvtest.py $(wildcard t/t*.py)
26         
27 runtests-cmdline: all
28         ./test-sh
29         
30 stupid:
31         PATH=/bin:/usr/bin $(MAKE) test
32         
33 test: all runtests-cmdline
34         ./wvtestrun $(MAKE) runtests
35
36 %: %.o
37         $(CC) $(CFLAGS) (LDFLAGS) -o $@ $< $(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-* randomgen \
57                 out[12] out2[tc] tags[12] tags2[tc]
58         rm -rf *.tmp