]> arthur.barton.de Git - bup.git/blob - Makefile
More compile options for MacOS X.
[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 randomgen chashsplit.so
16
17 randomgen: randomgen.o
18         $(CC) $(CFLAGS) -o $@ $<
19
20 chashsplit.so: chashsplitmodule.o
21         $(CC) $(CFLAGS) $(SHARED) -o $@ $< $(PYLIB)
22         
23 runtests: all
24         ./wvtest.py $(wildcard t/t*.py)
25         
26 runtests-cmdline: all
27         ./test-sh
28         
29 stupid:
30         PATH=/bin:/usr/bin $(MAKE) test
31         
32 test: all runtests-cmdline
33         ./wvtestrun $(MAKE) runtests
34
35 %: %.o
36         $(CC) $(CFLAGS) (LDFLAGS) -o $@ $< $(LIBS)
37         
38 bup: bup.py
39         rm -f $@
40         ln -s $^ $@
41         
42 bup-%: cmd-%.py
43         rm -f $@
44         ln -s $^ $@
45         
46 bup-%: cmd-%.sh
47         rm -f $@
48         ln -s $^ $@
49         
50 %.o: %.c
51         gcc -c -o $@ $^ $(CPPFLAGS) $(CFLAGS)
52
53 clean:
54         rm -f *.o *.so *~ .*~ *.pyc */*.pyc */*~ \
55                 bup bup-* randomgen \
56                 out[12] out2[tc] tags[12] tags2[tc]
57         rm -rf *.tmp