1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 09:13:08 +00:00

COMP=msys2を指定できるようにした

This commit is contained in:
nodchip 2020-06-24 00:47:34 +09:00
parent 43e78187d7
commit 999f5ec446

View file

@ -229,7 +229,6 @@ ifeq ($(COMP),mingw)
CXXFLAGS += -Wextra -Wshadow CXXFLAGS += -Wextra -Wshadow
LDFLAGS += -static LDFLAGS += -static
endif endif
LDFLAGS += -static -Wl,-s
ifeq ($(COMP),icc) ifeq ($(COMP),icc)
comp=icc comp=icc
@ -259,6 +258,28 @@ ifeq ($(COMP),clang)
endif endif
endif endif
ifeq ($(COMP),msys2)
comp=gcc
CXX=g++
CXXFLAGS += -pedantic -Wextra -Wshadow
ifeq ($(ARCH),armv7)
ifeq ($(OS),Android)
CXXFLAGS += -m$(bits)
LDFLAGS += -m$(bits)
endif
else
CXXFLAGS += -m$(bits)
LDFLAGS += -m$(bits)
endif
ifneq ($(KERNEL),Darwin)
LDFLAGS += -Wl,--no-as-needed
endif
LDFLAGS += -static -Wl,-s
endif
ifeq ($(comp),icc) ifeq ($(comp),icc)
profile_make = icc-profile-make profile_make = icc-profile-make
profile_use = icc-profile-use profile_use = icc-profile-use
@ -357,7 +378,7 @@ endif
ifeq ($(avx2),yes) ifeq ($(avx2),yes)
CXXFLAGS += -DUSE_AVX2 CXXFLAGS += -DUSE_AVX2
ifeq ($(comp),$(filter $(comp),gcc clang mingw)) ifeq ($(comp),$(filter $(comp),gcc clang mingw msys2))
CXXFLAGS += -mavx2 CXXFLAGS += -mavx2
endif endif
endif endif
@ -365,7 +386,7 @@ endif
### 3.7 pext ### 3.7 pext
ifeq ($(pext),yes) ifeq ($(pext),yes)
CXXFLAGS += -DUSE_PEXT CXXFLAGS += -DUSE_PEXT
ifeq ($(comp),$(filter $(comp),gcc clang mingw)) ifeq ($(comp),$(filter $(comp),gcc clang mingw msys2))
CXXFLAGS += -mbmi2 CXXFLAGS += -mbmi2
endif endif
endif endif
@ -375,7 +396,7 @@ endif
### needs access to the optimization flags. ### needs access to the optimization flags.
ifeq ($(optimize),yes) ifeq ($(optimize),yes)
ifeq ($(debug), no) ifeq ($(debug), no)
ifeq ($(comp),$(filter $(comp),gcc clang)) ifeq ($(comp),$(filter $(comp),gcc clang msys2))
CXXFLAGS += -flto CXXFLAGS += -flto
LDFLAGS += $(CXXFLAGS) LDFLAGS += $(CXXFLAGS)
endif endif
@ -435,6 +456,7 @@ help:
@echo "mingw > Gnu compiler with MinGW under Windows" @echo "mingw > Gnu compiler with MinGW under Windows"
@echo "clang > LLVM Clang compiler" @echo "clang > LLVM Clang compiler"
@echo "icc > Intel compiler" @echo "icc > Intel compiler"
@echo "msys2 > MSYS2"
@echo "" @echo ""
@echo "Simple examples. If you don't know what to do, you likely want to run: " @echo "Simple examples. If you don't know what to do, you likely want to run: "
@echo "" @echo ""