100f84576bd4bb463dcdedbd2c3149c9af83f610
[umurmur.git] / src / Makefile
1 SRCS:=client.c main.c messages.c pds.c server.c ssl.c log.c conf.c crypt.c \
2         timer.c messagehandler.c channel.c Mumble.pb-c.c voicetarget.c
3
4 OBJS:=$(patsubst %.c, %.o, $(SRCS))
5
6 # If PolarSSL is in a nonstandard place. Usually not available in e.g. Fedora.
7 POLARSSL_LIB:=../../../../polarssl/polarssl-0.12.1/library/libpolarssl.a
8 POLARSSL_INCLUDE:=../../../../polarssl/polarssl-0.12.1/include
9
10 # **** Stuff used for debugging ******
11 # For Valgrind
12 #CFLAGS:=$(CFLAGS) -I. -I/data/export/proj/openssl/include/ -Wall
13 #LDFLAGS:=$(LDFLAGS) -L/data/export/proj/openssl/lib/ -lcrypto -lssl -lconfig
14
15 # PolarSSL
16 #CFLAGS:=$(CFLAGS) -DUSE_POLARSSL -I. -I$(POLARSSL_INCLUDE) -Wall
17 #LDFLAGS:=$(LDFLAGS) -L  $(POLARSSL_LIB) -lconfig
18
19 # Debug
20 #CFLAGS:=$(CFLAGS) -DDEBUG -g
21 # ********** END ************
22
23
24 # Build support and link to PolarSSL
25 #EXTRA_CFLAGS:=-DUSE_POLARSSL -I$(POLARSSL_INCLUDE)
26 #EXTRA_LDLAGS:=-lpolarssl
27 #SSL_LIB:=$(POLARSSL_LIB)
28
29 # OpenSSL
30 EXTRA_CFFLAGS:=
31 EXTRA_LDFLAGS:=-lcrypto -lssl 
32
33 CFLAGS:=$(CFLAGS) -I. -Wall $(EXTRA_CFLAGS)
34 LDFLAGS:=$(LDFLAGS) -lconfig $(EXTRA_LDFLAGS)
35
36 umurmurd:google/protobuf-c/libprotobuf_c.a depend.mak $(OBJS)
37         $(CC) $(LDFLAGS) $(OBJS) $(SSL_LIB) google/protobuf-c/libprotobuf_c.a -o umurmurd
38
39 google/protobuf-c/libprotobuf_c.a:
40         $(MAKE) -C google/protobuf-c/
41
42 clean:
43         $(MAKE) -C google/protobuf-c/ clean
44         rm -f *.o umurmurd depend.mak
45
46 all: umurmurd
47
48 $(OBJS): Makefile
49
50 depend.mak:
51         $(CC) $(CFLAGS) -M $(SRCS) > depend.mak
52
53 include depend.mak