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