From 429a7c275134fc3dc607e4ee7e3d5f2f7822262e Mon Sep 17 00:00:00 2001 From: michael-grunder Date: Tue, 25 Jun 2024 22:17:18 -0700 Subject: [PATCH] Minor makefile update * We also want to optimize when linking * Remove some dead assignments --- Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 35fe1f90..0235a65f 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,6 @@ TEST_DIR = tests INCLUDE_DIR = include/valkey TEST_SRCS = $(TEST_DIR)/client_test.c -TEST_OBJS = $(patsubst $(TEST_DIR)/%.c,$(OBJ_DIR)/%.o,$(TEST_SRCS)) TEST_BINS = $(patsubst $(TEST_DIR)/%.c,$(TEST_DIR)/%,$(TEST_SRCS)) SOURCES = $(filter-out $(wildcard $(SRC_DIR)/*ssl*.c), $(wildcard $(SRC_DIR)/*.c)) @@ -71,7 +70,7 @@ DYLIB_MAJOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(LIBVALKEY_MAJOR) DYLIB_ROOT_NAME=$(LIBNAME).$(DYLIBSUFFIX) DYLIBNAME=$(LIB_DIR)/$(DYLIB_ROOT_NAME) -DYLIB_MAKE_CMD=$(CC) $(PLATFORM_FLAGS) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) +DYLIB_MAKE_CMD=$(CC) $(OPTIMIZATION) $(PLATFORM_FLAGS) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) STLIB_ROOT_NAME=$(LIBNAME).$(STLIBSUFFIX) STLIBNAME=$(LIB_DIR)/$(STLIB_ROOT_NAME) STLIB_MAKE_CMD=$(AR) rcs @@ -85,7 +84,7 @@ SSL_DYLIB_MAJOR_NAME=$(SSL_LIBNAME).$(DYLIBSUFFIX).$(LIBVALKEY_MAJOR) SSL_ROOT_DYLIB_NAME=$(SSL_LIBNAME).$(DYLIBSUFFIX) SSL_DYLIBNAME=$(LIB_DIR)/$(SSL_LIBNAME).$(DYLIBSUFFIX) SSL_STLIBNAME=$(LIB_DIR)/$(SSL_LIBNAME).$(STLIBSUFFIX) -SSL_DYLIB_MAKE_CMD=$(CC) $(PLATFORM_FLAGS) -shared -Wl,-soname,$(SSL_DYLIB_MINOR_NAME) +SSL_DYLIB_MAKE_CMD=$(CC) $(OPTIMIZATION) $(PLATFORM_FLAGS) -shared -Wl,-soname,$(SSL_DYLIB_MINOR_NAME) USE_SSL?=0 @@ -155,7 +154,7 @@ ifeq ($(uname_S),SunOS) SUN_SHARED_FLAG=-shared endif REAL_LDFLAGS+= -ldl -lnsl -lsocket - DYLIB_MAKE_CMD=$(CC) $(SUN_SHARED_FLAG) -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) $(LDFLAGS) + DYLIB_MAKE_CMD=$(CC) $(OPTIMIZATION) $(SUN_SHARED_FLAG) -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) $(LDFLAGS) SSL_DYLIB_MAKE_CMD=$(CC) $(SUN_SHARED_FLAG) -o $(SSL_DYLIBNAME) -h $(SSL_DYLIB_MINOR_NAME) $(LDFLAGS) $(SSL_LDFLAGS) endif ifeq ($(uname_S),Darwin) @@ -187,7 +186,7 @@ $(OBJ_DIR)/%.o: $(TEST_DIR)/%.c | $(OBJ_DIR) $(CC) -std=c99 $(REAL_CFLAGS) -I$(INCLUDE_DIR) -MMD -MP -c $< -o $@ $(TEST_DIR)/%: $(OBJ_DIR)/%.o $(STLIBNAME) - $(CC) -o $@ $< $(STLIBNAME) $(SSL_STLIB) $(LDFLAGS) $(SSL_LDLAGS) $(TEST_LDFLAGS) + $(CC) -o $@ $< $(STLIBNAME) $(SSL_STLIB) $(LDFLAGS) $(TEST_LDFLAGS) $(OBJ_DIR): mkdir -p $(OBJ_DIR) @@ -203,7 +202,6 @@ pkgconfig: $(PKGCONFNAME) $(SSL_PKGCONF) -include $(OBJS:.o=.d) -TEST_LIBS = $(STLIBNAME) $(SSL_STLIB) TEST_LDFLAGS = $(SSL_LDFLAGS) ifeq ($(USE_SSL),1) TEST_LDFLAGS += -pthread