From 848c75d6739da336409a1192ee3db04bc8a47e39 Mon Sep 17 00:00:00 2001 From: fatbob313 Date: Wed, 17 Feb 2010 15:11:56 +0000 Subject: [PATCH] Fix Makefiles for OpenWRT. --- openwrt/Makefile.openssl | 7 +++++-- openwrt/Makefile.polarssl | 4 ++-- src/Makefile | 39 ++++++++++++++++++--------------------- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/openwrt/Makefile.openssl b/openwrt/Makefile.openssl index f989ee7..f039975 100644 --- a/openwrt/Makefile.openssl +++ b/openwrt/Makefile.openssl @@ -26,6 +26,9 @@ endef TARGET_CFLAGS := \ -DWRT_TARGET \ $(TARGET_CFLAGS) +TARGET_LDFLAGS := \ + -lcrypto -lssl \ + $(TARGET_LDFLAGS) define Build/Prepare mkdir -p $(PKG_BUILD_DIR) @@ -42,9 +45,9 @@ define Package/umurmur-openssl/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/umurmurd $(1)/usr/bin/ $(INSTALL_DIR) $(1)/etc - $(INSTALL_CONF) ./files/umurmur.conf $(1)/etc/ + $(INSTALL_CONF) ./openwrt/files/umurmur.conf $(1)/etc/ $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/umurmur.init $(1)/etc/init.d/umurmur + $(INSTALL_BIN) ./openwrt/files/umurmur.init $(1)/etc/init.d/umurmur $(INSTALL_DIR) $(1)/etc/umurmur endef diff --git a/openwrt/Makefile.polarssl b/openwrt/Makefile.polarssl index ea2b48b..9d309d0 100644 --- a/openwrt/Makefile.polarssl +++ b/openwrt/Makefile.polarssl @@ -46,9 +46,9 @@ define Package/umurmur-polarssl/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/umurmurd $(1)/usr/bin/ $(INSTALL_DIR) $(1)/etc - $(INSTALL_CONF) ./files/umurmur.conf $(1)/etc/ + $(INSTALL_CONF) ./openwrt/files/umurmur.conf $(1)/etc/ $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/umurmur.init $(1)/etc/init.d/umurmur + $(INSTALL_BIN) ./openwrt/files/umurmur.init $(1)/etc/init.d/umurmur $(INSTALL_DIR) $(1)/etc/umurmur endef diff --git a/src/Makefile b/src/Makefile index 100f845..6294682 100644 --- a/src/Makefile +++ b/src/Makefile @@ -4,36 +4,37 @@ SRCS:=client.c main.c messages.c pds.c server.c ssl.c log.c conf.c crypt.c \ OBJS:=$(patsubst %.c, %.o, $(SRCS)) # If PolarSSL is in a nonstandard place. Usually not available in e.g. Fedora. -POLARSSL_LIB:=../../../../polarssl/polarssl-0.12.1/library/libpolarssl.a -POLARSSL_INCLUDE:=../../../../polarssl/polarssl-0.12.1/include +# POLARSSL_LIB:=../../../../polarssl/polarssl-0.12.1/library/libpolarssl.a +# POLARSSL_INCLUDE:=../../../../polarssl/polarssl-0.12.1/include # **** Stuff used for debugging ****** -# For Valgrind -#CFLAGS:=$(CFLAGS) -I. -I/data/export/proj/openssl/include/ -Wall -#LDFLAGS:=$(LDFLAGS) -L/data/export/proj/openssl/lib/ -lcrypto -lssl -lconfig +# For Valgrind OpenSSL +#EXTRA_CFLAGS:=$(CFLAGS) -I/data/export/proj/openssl/include/ +#EXTRA_LDFLAGS:=$(LDFLAGS) -L/data/export/proj/openssl/lib/ -lcrypto -lssl # PolarSSL -#CFLAGS:=$(CFLAGS) -DUSE_POLARSSL -I. -I$(POLARSSL_INCLUDE) -Wall -#LDFLAGS:=$(LDFLAGS) -L $(POLARSSL_LIB) -lconfig +# CFLAGS:=$(CFLAGS) -DUSE_POLARSSL -I$(POLARSSL_INCLUDE) +# CFLAGS:=$(CFLAGS) -I$(POLARSSL_INCLUDE) +# LDFLAGS:=$(LDFLAGS) -L $(POLARSSL_LIB) -lconfig # Debug -#CFLAGS:=$(CFLAGS) -DDEBUG -g +# CFLAGS:=$(CFLAGS) -DDEBUG -g # ********** END ************ # Build support and link to PolarSSL -#EXTRA_CFLAGS:=-DUSE_POLARSSL -I$(POLARSSL_INCLUDE) -#EXTRA_LDLAGS:=-lpolarssl -#SSL_LIB:=$(POLARSSL_LIB) +# EXTRA_CFLAGS:=-DUSE_POLARSSL -I$(POLARSSL_INCLUDE) +# EXTRA_LDLAGS:=-lpolarssl +# SSL_LIB:=$(POLARSSL_LIB) # If statically linking -# OpenSSL -EXTRA_CFFLAGS:= -EXTRA_LDFLAGS:=-lcrypto -lssl +# OpenSSL - usually installed at a standard place +# EXTRA_CFLAGS:= +# EXTRA_LDFLAGS:=-lcrypto -lssl CFLAGS:=$(CFLAGS) -I. -Wall $(EXTRA_CFLAGS) -LDFLAGS:=$(LDFLAGS) -lconfig $(EXTRA_LDFLAGS) +LDFLAGS:=$(EXTRA_LDFLAGS) $(LDFLAGS) -lconfig -umurmurd:google/protobuf-c/libprotobuf_c.a depend.mak $(OBJS) +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: @@ -41,13 +42,9 @@ google/protobuf-c/libprotobuf_c.a: clean: $(MAKE) -C google/protobuf-c/ clean - rm -f *.o umurmurd depend.mak + rm -f *.o umurmurd all: umurmurd $(OBJS): Makefile -depend.mak: - $(CC) $(CFLAGS) -M $(SRCS) > depend.mak - -include depend.mak \ No newline at end of file -- 2.30.2