1# -*- makefile -*-
2
3srcdir := .
4top_srcdir := ..
5
6
7CC:=gcc
8AR:=ar
9RANLIB:=ranlib
10
11PROGRAMS:=btlist btget btcheck
12LIBBT:=libbt.a
13SRCS:=\
14	benc.c \
15	bts.c \
16	types.c \
17	random.c \
18	strbuf.c \
19	stream.c \
20	peer.c \
21	segmenter.c \
22	util.c \
23	bitset.c \
24	context.c \
25	bterror.c \
26        udpproto.c \
27	peerexchange.c
28OBJS:= ${SRCS:.c=.o}
29
30CPPFLAGS:=
31CFLAGS:=-g -Wall -I../include -I$(top_srcdir)/include
32
33LIBS:=-lresolv -luuid -lssl -lcurl  `curl-config --libs` -lm
34LDFLAGS:=-g -L.
35VERSION=1.06
36MAKEDEPEND=makedepend
37
38all: ${LIBBT} ${PROGRAMS}
39
40install: all
41	mv ${PROGRAMS} libbt.a ../bin
42static:
43	-rm ${PROGRAMS}
44	make "LDFLAGS=${LDFLAGS} -static"
45docs:
46	doxygen *.c
47depend:
48	${MAKEDEPEND} ${CFLAGS} - ${SRCS}
49btcheck: libbt.a btcheck.c
50	${CC} ${CFLAGS} -DVERSION=${VERSION} ${LDFLAGS} -o btcheck btcheck.c -lbt ${LIBS}
51
52btlist: ${LIBBT} btlist.c
53	${CC} ${CFLAGS} -DVERSION=${VERSION} ${LDFLAGS} -o btlist btlist.c -lbt ${LIBS}
54
55btget: ${LIBBT} btget.c
56	${CC} ${CFLAGS} -DVERSION=${VERSION} ${LDFLAGS} -o btget btget.c -lbt ${LIBS}
57
58clean:
59	rm -f ${OBJS} btcheck.o btlist.o btget.o
60
61distclean: clean
62	rm -f ${PROGRAMS} ${LIBBT}
63	cp Makefile.default Makefile
64
65libbt.a: ${OBJS}
66	${AR} rc $@ ${OBJS}
67	${RANLIB} $@
68
69.c.o:
70	${CC} -c ${CFLAGS} ${CPPFLAGS} $< -o $@
71# DO NOT DELETE
72
73benc.o: ../include/config.h ../include/benc.h ../include/types.h
74benc.o: ../include/util.h ../include/bts.h ../include/bterror.h
75bitset.o: ../include/config.h ../include/bitset.h ../include/random.h
76bitset.o: ../include/util.h
77block.o: ../include/config.h
78btcheck.o: ../include/config.h ../include/types.h ../include/util.h
79btcheck.o: ../include/benc.h ../include/bts.h ../include/segmenter.h
80btcheck.o: ../include/bitset.h ../include/context.h ../include/peer.h
81btcheck.o: ../include/stream.h ../include/strbuf.h
82bterror.o: ../include/bterror.h
83btget.o: ../include/config.h ../include/util.h ../include/bts.h
84btget.o: ../include/benc.h ../include/types.h ../include/random.h
85btget.o: ../include/peer.h ../include/stream.h ../include/strbuf.h
86btget.o: ../include/bitset.h ../include/segmenter.h ../include/context.h
87btget.o: ../include/bterror.h ../include/udpproto.h ../include/peerexchange.h
88btlist.o: ../include/config.h ../include/bts.h ../include/types.h
89btlist.o: ../include/util.h ../include/benc.h
90bts.o: ../include/config.h ../include/bts.h ../include/util.h
91context.o: ../include/config.h ../include/random.h ../include/udpproto.h
92context.o: ../include/util.h ../include/context.h ../include/types.h
93context.o: ../include/segmenter.h ../include/bitset.h ../include/peer.h
94context.o: ../include/stream.h ../include/strbuf.h ../include/bts.h
95context.o: ../include/benc.h
96peer.o: ../include/config.h ../include/bterror.h ../include/btmessage.h
97peer.o: ../include/peer.h ../include/stream.h ../include/strbuf.h
98peer.o: ../include/bitset.h ../include/segmenter.h ../include/util.h
99peer.o: ../include/context.h ../include/types.h ../include/bts.h
100peer.o: ../include/benc.h ../include/peerexchange.h
101peerexchange.o: ../include/config.h ../include/peerexchange.h
102peerexchange.o: ../include/types.h ../include/util.h ../include/context.h
103peerexchange.o: ../include/segmenter.h ../include/bitset.h ../include/peer.h
104peerexchange.o: ../include/stream.h ../include/strbuf.h ../include/bts.h
105peerexchange.o: ../include/benc.h
106random.o: ../include/config.h
107segmenter.o: ../include/config.h ../include/util.h ../include/types.h
108segmenter.o: ../include/segmenter.h ../include/bitset.h
109strbuf.o: ../include/config.h ../include/util.h ../include/strbuf.h
110stream.o: ../include/config.h ../include/bterror.h ../include/stream.h
111stream.o: ../include/strbuf.h ../include/util.h
112types.o: ../include/config.h ../include/util.h ../include/types.h
113udpproto.o: ../include/udpproto.h ../include/util.h ../include/context.h
114udpproto.o: ../include/types.h ../include/segmenter.h ../include/bitset.h
115udpproto.o: ../include/peer.h ../include/stream.h ../include/strbuf.h
116udpproto.o: ../include/random.h
117util.o: ../include/config.h ../include/bterror.h ../include/util.h
118