Skip to content

Commit a154181

Browse files
committed
Update makefile
1 parent 11b114c commit a154181

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

CSDM/Makefile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Include CS SDK
1+
# Include CSSDK
22
CSSDK = include/cssdk
33

44
# Include Metamod SDK
@@ -15,10 +15,18 @@ COMPILER = g++
1515
OBJECTS = *.cpp
1616

1717
# Linker Libs
18-
LINKER = -static-libgcc -static-libstdc++
18+
LINKER =
19+
20+
# Compiler version check to static linking
21+
RES_COMPILER_VERSION := $(shell expr "`$(COMPILER) -dumpversion`" ">=" "5")
22+
23+
# Link static lib if compiler is newer than minimum version
24+
ifeq "$(RES_COMPILER_VERSION)" "1"
25+
LINKER += -static-libstdc++
26+
endif
1927

2028
# C flags
21-
CFLAGS = -std=gnu++11 -g0 -O3 -s -flto -funroll-loops -fno-stack-protector -g -DNDEBUG -Dlinux -D__linux__ -D_GLIBCXX_USE_CXX11_ABI=0 -m32 -msse3 -msse4.1 -shared
29+
CFLAGS = -std=gnu++11 -pipe -g0 -O3 -s -flto -funroll-loops -fno-stack-protector -g -DNDEBUG -Dlinux -D__linux__ -D_GLIBCXX_USE_CXX11_ABI=0 -m32 -msse3 -msse4.1 -shared
2230

2331
# Include directory
2432
INCLUDE = -I. -I$(CSSDK)/common -I$(CSSDK)/dlls -I$(CSSDK)/engine -I$(CSSDK)/game_shared -I$(CSSDK)/pm_shared -I$(CSSDK)/public -I$(METAMOD)
@@ -35,7 +43,7 @@ $(BIN_DIR)/%.o: %.c
3543
all:
3644
mkdir -p $(BIN_DIR)
3745

38-
$(MAKE) $(NAME)
46+
$(MAKE) $(NAME) && strip -x $(BIN_DIR)/$(NAME)_mm.so
3947

4048
$(NAME): $(OBJ_LINUX)
4149

@@ -48,4 +56,4 @@ default: all
4856

4957
clean:
5058
rm -rf Release/*.o
51-
rm -rf Release/*.so
59+
rm -rf Release/*.so

0 commit comments

Comments
 (0)