]> arthur.barton.de Git - bup.git/blob - Makefile
This adds the long-awaited indexfile feature, so you no longer have to feed
[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 bup-tick \
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 runtests-python runtests-cmdline
25
26 runtests-python:
27         ./wvtest.py $(wildcard t/t*.py)
28         
29 runtests-cmdline: all
30         t/test.sh
31         
32 stupid:
33         PATH=/bin:/usr/bin $(MAKE) test
34         
35 test: all
36         ./wvtestrun $(MAKE) runtests
37
38 %: %.o
39         $(CC) $(CFLAGS) (LDFLAGS) -o $@ $< $(LIBS)
40         
41 bup: bup.py
42         rm -f $@
43         ln -s $^ $@
44         
45 bup-%: cmd-%.py
46         rm -f $@
47         ln -s $^ $@
48         
49 bup-%: cmd-%.sh
50         rm -f $@
51         ln -s $^ $@
52         
53 %.o: %.c
54         gcc -c -o $@ $^ $(CPPFLAGS) $(CFLAGS)
55
56 clean:
57         rm -f *.o *.so *~ .*~ *.pyc */*.pyc */*~ \
58                 bup bup-* randomgen \
59                 out[12] out2[tc] tags[12] tags2[tc]
60         rm -rf *.tmp