]> arthur.barton.de Git - bup.git/blob - Makefile
Makefile: oops, all the $^ and $< were backwards.
[bup.git] / Makefile
1 PYINCLUDE:=$(shell python2.5-config --includes)
2 PYLIB:=$(shell python2.5-config --lib)
3 OS:=$(shell uname | sed 's/[-_].*//')
4 MACHINE:=$(shell uname -m)
5 CFLAGS=-Wall -g -O2 -Werror $(PYINCLUDE) -g
6 ifneq ($(OS),CYGWIN)
7   CFLAGS += -fPIC
8 endif
9 SHARED=-shared
10 SOEXT:=.so
11
12 ifeq (${OS},Darwin)
13   CFLAGS += -arch $(MACHINE)
14   SHARED = -dynamiclib
15 endif
16 ifeq ($(OS),CYGWIN)
17   LDFLAGS += -L/usr/bin
18   EXT:=.exe
19   SOEXT:=.dll
20 endif
21
22 default: all
23
24 all: bup-split bup-join bup-save bup-init bup-server bup-index bup-tick \
25         bup memtest randomgen$(EXT) chashsplit$(SOEXT)
26
27 randomgen$(EXT): randomgen.o
28         $(CC) $(CFLAGS) -o $@ $<
29
30 chashsplit$(SOEXT): chashsplitmodule.o
31         $(CC) $(CFLAGS) $(LDFLAGS) $(SHARED) -o $@ $< $(PYLIB)
32         
33 runtests: all runtests-python runtests-cmdline
34
35 runtests-python:
36         ./wvtest.py $(wildcard t/t*.py)
37         
38 runtests-cmdline: all
39         t/test.sh
40         
41 stupid:
42         PATH=/bin:/usr/bin $(MAKE) test
43         
44 test: all
45         ./wvtestrun $(MAKE) runtests
46
47 %: %.o
48         $(CC) $(CFLAGS) (LDFLAGS) -o $@ $^ $(LIBS)
49         
50 bup: bup.py
51         rm -f $@
52         ln -s $< $@
53         
54 bup-%: cmd-%.py
55         rm -f $@
56         ln -s $< $@
57         
58 %: %.py
59         rm -f $@
60         ln -s $< $@
61         
62 bup-%: cmd-%.sh
63         rm -f $@
64         ln -s $< $@
65         
66 %.o: %.c
67         gcc -c -o $@ $< $(CPPFLAGS) $(CFLAGS)
68
69 clean:
70         rm -f *.o *.so *.dll *.exe *~ .*~ *.pyc */*.pyc */*~ \
71                 bup bup-* randomgen \
72                 out[12] out2[tc] tags[12] tags2[tc]
73         rm -rf *.tmp