Update to version 0.2.3
[umurmur.git] / src / Makefile
index e66f475ec9e31f5fe5f89f3d0c88f76e841ea4a0..fc82e2aa122869fc5259944797e5d164211970e2 100644 (file)
@@ -1,22 +1,45 @@
-# build helloworld executable when user executes "make" 
+SRCS:=client.c main.c messages.c pds.c server.c ssl.c log.c conf.c crypt.c \
+       timer.c messagehandler.c channel.c Mumble.pb-c.c voicetarget.c
 
-SRCS:=client.c main.c messages.c pds.c server.c ssl.c log.c conf.c crypt.c timer.c messagehandler.c channel.c
 OBJS:=$(patsubst %.c, %.o, $(SRCS))
-CFLAGS:=$(CFLAGS) -Wall -Os -g
-LDFLAGS:=$(LDFLAGS) -lcrypto -lssl -lconfig
 
-umurmurd:$(OBJS) depend.mak
-       $(CC) $(LDFLAGS) $(OBJS) -o umurmurd
+# **** Stuff used for debugging ******
+# For Valgrind OpenSSL
+#EXTRA_CFLAGS:=$(CFLAGS) -I/data/export/proj/openssl/include/
+#EXTRA_LDFLAGS:=$(LDFLAGS) -L/data/export/proj/openssl/lib/ -lcrypto -lssl
+
+# Debug
+CFLAGS:=$(CFLAGS) -DDEBUG -g
+# ********** Debug stuff END ************
+
+
+# Build support and link to PolarSSL
+# If PolarSSL is in a nonstandard place.
+POLARSSL_LIB:=../../../polarssl/polarssl-0.12.1/library/libpolarssl.a
+SSL_LIB:=$(POLARSSL_LIB) # If statically linking
+POLARSSL_INCLUDE:=../../../polarssl/polarssl-0.12.1/include
+EXTRA_CFLAGS:=-DUSE_POLARSSL -I$(POLARSSL_INCLUDE)
+# EXTRA_LDLAGS:=-lpolarssl
+
+
+# OpenSSL - usually installed at a standard place
+# EXTRA_CFLAGS:=
+# EXTRA_LDFLAGS:=-lcrypto -lssl 
+
+CFLAGS:=$(CFLAGS) -I. -Wall $(EXTRA_CFLAGS)
+LDFLAGS:=$(EXTRA_LDFLAGS) $(LDFLAGS) -lconfig 
+
+umurmurd:google/protobuf-c/libprotobuf_c.a $(OBJS)
+       $(CC) $(LDFLAGS) $(OBJS) $(SSL_LIB) google/protobuf-c/libprotobuf_c.a -o umurmurd
+
+google/protobuf-c/libprotobuf_c.a:
+       $(MAKE) -C google/protobuf-c/
 
-# remove object files and executable when user executes "make clean"
 clean:
-       rm *.o umurmurd 
+       $(MAKE) -C google/protobuf-c/ clean
+       rm -f *.o umurmurd
 
-all: umurmur
+all: umurmurd
 
 $(OBJS): Makefile
 
-depend.mak:
-       $(CC) -M $(SRCS) > depend.mak
-
-include depend.mak
\ No newline at end of file