Fix Makefiles for OpenWRT.
[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 OpenSSL
12 #EXTRA_CFLAGS:=$(CFLAGS) -I/data/export/proj/openssl/include/
13 #EXTRA_LDFLAGS:=$(LDFLAGS) -L/data/export/proj/openssl/lib/ -lcrypto -lssl
14
15 # PolarSSL
16 # CFLAGS:=$(CFLAGS) -DUSE_POLARSSL -I$(POLARSSL_INCLUDE)
17 # CFLAGS:=$(CFLAGS) -I$(POLARSSL_INCLUDE)
18 # LDFLAGS:=$(LDFLAGS) -L $(POLARSSL_LIB) -lconfig
19
20 # Debug
21 # CFLAGS:=$(CFLAGS) -DDEBUG -g
22 # ********** END ************
23
24
25 # Build support and link to PolarSSL
26 # EXTRA_CFLAGS:=-DUSE_POLARSSL -I$(POLARSSL_INCLUDE)
27 # EXTRA_LDLAGS:=-lpolarssl
28 # SSL_LIB:=$(POLARSSL_LIB) # If statically linking
29
30 # OpenSSL - usually installed at a standard place
31 # EXTRA_CFLAGS:=
32 # EXTRA_LDFLAGS:=-lcrypto -lssl 
33
34 CFLAGS:=$(CFLAGS) -I. -Wall $(EXTRA_CFLAGS)
35 LDFLAGS:=$(EXTRA_LDFLAGS) $(LDFLAGS) -lconfig 
36
37 umurmurd:google/protobuf-c/libprotobuf_c.a $(OBJS)
38         $(CC) $(LDFLAGS) $(OBJS) $(SSL_LIB) google/protobuf-c/libprotobuf_c.a -o umurmurd
39
40 google/protobuf-c/libprotobuf_c.a:
41         $(MAKE) -C google/protobuf-c/
42
43 clean:
44         $(MAKE) -C google/protobuf-c/ clean
45         rm -f *.o umurmurd
46
47 all: umurmurd
48
49 $(OBJS): Makefile
50