Skip to content

Commit

Permalink
Update makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
SmileYzn committed Jan 6, 2024
1 parent 11b114c commit a154181
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions CSDM/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Include CS SDK
# Include CSSDK
CSSDK = include/cssdk

# Include Metamod SDK
Expand All @@ -15,10 +15,18 @@ COMPILER = g++
OBJECTS = *.cpp

# Linker Libs
LINKER = -static-libgcc -static-libstdc++
LINKER =

# Compiler version check to static linking
RES_COMPILER_VERSION := $(shell expr "`$(COMPILER) -dumpversion`" ">=" "5")

# Link static lib if compiler is newer than minimum version
ifeq "$(RES_COMPILER_VERSION)" "1"
LINKER += -static-libstdc++
endif

# C flags
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
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

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

$(MAKE) $(NAME)
$(MAKE) $(NAME) && strip -x $(BIN_DIR)/$(NAME)_mm.so

$(NAME): $(OBJ_LINUX)

Expand All @@ -48,4 +56,4 @@ default: all

clean:
rm -rf Release/*.o
rm -rf Release/*.so
rm -rf Release/*.so

0 comments on commit a154181

Please sign in to comment.