]> arthur.barton.de Git - bup.git/blob - Makefile
Makefile: Build on Windows under Cygwin.
[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
6 ifneq ($(OS),CYGWIN_NT-5.1)
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_NT-5.1)
17   LDFLAGS += -L/usr/bin
18   SOEXT:=dll
19 endif
20
21 default: all
22
23 all: bup-split bup-join bup-save bup-init bup-server bup-index bup-tick \
24         bup randomgen chashsplit.$(SOEXT)
25
26 randomgen: randomgen.o
27         $(CC) $(CFLAGS) -o $@ $<
28
29 chashsplit.$(SOEXT): chashsplitmodule.o
30         $(CC) $(CFLAGS) $(LDFLAGS) $(SHARED) -o $@ $< $(PYLIB)
31         
32 runtests: all runtests-python runtests-cmdline
33
34 runtests-python:
35         ./wvtest.py $(wildcard t/t*.py)
36         
37 runtests-cmdline: all
38         t/test.sh
39         
40 stupid:
41         PATH=/bin:/usr/bin $(MAKE) test
42         
43 test: all
44         ./wvtestrun $(MAKE) runtests
45
46 %: %.o
47         $(CC) $(CFLAGS) (LDFLAGS) -o $@ $< $(LIBS)
48         
49 bup: bup.py
50         rm -f $@
51         ln -s $^ $@
52         
53 bup-%: cmd-%.py
54         rm -f $@
55         ln -s $^ $@
56         
57 bup-%: cmd-%.sh
58         rm -f $@
59         ln -s $^ $@
60         
61 %.o: %.c
62         gcc -c -o $@ $^ $(CPPFLAGS) $(CFLAGS)
63
64 clean:
65         rm -f *.o *.so *.dll *~ .*~ *.pyc */*.pyc */*~ \
66                 bup bup-* randomgen \
67                 out[12] out2[tc] tags[12] tags2[tc]
68         rm -rf *.tmp