]> arthur.barton.de Git - bup.git/blob - Makefile
Move python library files to lib/bup/
[bup.git] / Makefile
1 OS:=$(shell uname | sed 's/[-_].*//')
2 CFLAGS=-Wall -g -O2 -Werror $(PYINCLUDE) -g
3 ifneq ($(OS),CYGWIN)
4   CFLAGS += -fPIC
5 endif
6 SHARED=-shared
7 SOEXT:=.so
8
9 ifeq (${OS},Darwin)
10   MACHINE:=$(shell arch)
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 bup-fuse bup-ls bup-damage bup-fsck bup-margin bup-drecurse \
24         bup-random bup-ftp bup-newliner bup-memtest \
25         bup lib/bup/_hashsplit$(SOEXT) \
26         Documentation/all
27         
28 %/all:
29         $(MAKE) -C $* all
30         
31 %/clean:
32         $(MAKE) -C $* clean
33
34 lib/bup/_hashsplit$(SOEXT): lib/bup/_hashsplit.c lib/bup/csetup.py
35         @rm -f $@
36         cd lib/bup && python csetup.py build
37         cp lib/bup/build/*/_hashsplit$(SOEXT) lib/bup/
38         
39 runtests: all runtests-python runtests-cmdline
40
41 runtests-python:
42         ./wvtest.py $(wildcard t/t*.py)
43         
44 runtests-cmdline: all
45         t/test.sh
46         
47 stupid:
48         PATH=/bin:/usr/bin $(MAKE) test
49         
50 test: all
51         ./wvtestrun $(MAKE) runtests
52
53 %: %.o
54         $(CC) $(CFLAGS) (LDFLAGS) -o $@ $^ $(LIBS)
55         
56 bup: main.py
57         rm -f $@
58         ln -s $< $@
59         
60 bup-%: cmd-%.py
61         rm -f $@
62         ln -s $< $@
63         
64 %: %.py
65         rm -f $@
66         ln -s $< $@
67         
68 bup-%: cmd-%.sh
69         rm -f $@
70         ln -s $< $@
71         
72 %.o: %.c
73         gcc -c -o $@ $< $(CPPFLAGS) $(CFLAGS)
74
75 clean: Documentation/clean
76         rm -f *.o *.so */*/*.so *.dll *.exe .*~ *~ */*~ */*/*~ \
77                 *.pyc */*.pyc */*/*.pyc\
78                 bup bup-* randomgen memtest \
79                 out[12] out2[tc] tags[12] tags2[tc]
80         rm -rf *.tmp build lib/bup/build