Skip to content

Commit

Permalink
Update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
SmileYzn committed Jul 4, 2023
1 parent 33c92fe commit 5b3bc2d
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions MatchBot/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Include CSSDK and MetaMod SDK
# Include CS SDK
CSSDK = include/cssdk

# Include Metamod SDK
METAMOD = include/metamod

# Release file output name
Expand All @@ -12,22 +14,19 @@ BIN_DIR = Release
COMPILER = g++
OBJECTS = *.cpp

# Linker
LINK = -lcurl -lssl -lcrypto -ldl -lm -lz
# Linker Libs
LINKER = -lcurl -lssl -lcrypto -ldl -lm -lz

# 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"
LINK += -static-libstdc++
LINKER += -static-libstdc++
endif

# Optional flags
OPT_FLAGS = -std=gnu++11 -pipe -g0 -O3 -s -flto -funroll-loops -fno-stack-protector

# C flags
CFLAGS = $(OPT_FLAGS) -g -DNDEBUG -Dlinux -D__linux__ -D_GLIBCXX_USE_CXX11_ABI=0 -DCURL_STATICLIB -DHTTP_ONLY -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 -DCURL_STATICLIB -DHTTP_ONLY -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 @@ -44,11 +43,11 @@ $(BIN_DIR)/%.o: %.c
all:
mkdir -p $(BIN_DIR)

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

$(NAME): $(OBJ_LINUX)

$(COMPILER) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINK) -o$(BIN_DIR)/$(NAME)_mm.so
$(COMPILER) $(INCLUDE) $(CFLAGS) $(OBJ_LINUX) $(LINKER) -o$(BIN_DIR)/$(NAME)_mm.so

check:
cppcheck $(INCLUDE) --quiet --max-configs=100 --std=gnu++11 -DNDEBUG -Dlinux -D__linux__ -U_FORTIFY_SOURCE .
Expand Down

0 comments on commit 5b3bc2d

Please sign in to comment.