Skip to content

Commit

Permalink
Update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
SmileYzn authored Sep 11, 2024
1 parent d3e7ca8 commit 7f6ff78
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions MatchBot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,7 @@ COMPILER = x86_64-linux-gnu-g++
OBJECTS = *.cpp

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

# 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-libgcc -static-libstdc++
endif
LINKER = -Wl,-Bstatic

# C flags
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
Expand All @@ -42,15 +34,15 @@ $(BIN_DIR)/%.o: %.c

all:
mkdir -p $(BIN_DIR)

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

$(NAME): $(OBJ_LINUX)

$(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 .
cppcheck $(INCLUDE) --quiet --max-configs=100 --std=gnu++11 -DNDEBUG -Dlinux -D__linux__ -D_GLIBCXX_USE_CXX11_ABI=0 -U_FORTIFY_SOURCE .

default: all

Expand Down

0 comments on commit 7f6ff78

Please sign in to comment.