mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Improve NDK section in Makefile
This PR sets the "comp" variable simply to "clang", which seems to be more consistent and allows a small simplification. The PR also moves the section that sets "profile_make" and "profile_use" to after the NDK section, which ensures that these variables are now set correctly for NDK/clang. closes https://github.com/official-stockfish/Stockfish/pull/3121 No functional change
This commit is contained in:
parent
5f426d8667
commit
d86663af14
1 changed files with 13 additions and 19 deletions
32
src/Makefile
32
src/Makefile
|
@ -381,19 +381,6 @@ ifeq ($(COMP),clang)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(comp),icc)
|
|
||||||
profile_make = icc-profile-make
|
|
||||||
profile_use = icc-profile-use
|
|
||||||
else
|
|
||||||
ifeq ($(comp),clang)
|
|
||||||
profile_make = clang-profile-make
|
|
||||||
profile_use = clang-profile-use
|
|
||||||
else
|
|
||||||
profile_make = gcc-profile-make
|
|
||||||
profile_use = gcc-profile-use
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(KERNEL),Darwin)
|
ifeq ($(KERNEL),Darwin)
|
||||||
CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.14
|
CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.14
|
||||||
LDFLAGS += -arch $(arch) -mmacosx-version-min=10.14
|
LDFLAGS += -arch $(arch) -mmacosx-version-min=10.14
|
||||||
|
@ -405,20 +392,30 @@ endif
|
||||||
# Currently we don't know how to make PGO builds with the NDK yet.
|
# Currently we don't know how to make PGO builds with the NDK yet.
|
||||||
ifeq ($(COMP),ndk)
|
ifeq ($(COMP),ndk)
|
||||||
CXXFLAGS += -stdlib=libc++ -fPIE
|
CXXFLAGS += -stdlib=libc++ -fPIE
|
||||||
|
comp=clang
|
||||||
ifeq ($(arch),armv7)
|
ifeq ($(arch),armv7)
|
||||||
comp=armv7a-linux-androideabi16-clang
|
|
||||||
CXX=armv7a-linux-androideabi16-clang++
|
CXX=armv7a-linux-androideabi16-clang++
|
||||||
CXXFLAGS += -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon
|
CXXFLAGS += -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon
|
||||||
STRIP=arm-linux-androideabi-strip
|
STRIP=arm-linux-androideabi-strip
|
||||||
endif
|
endif
|
||||||
ifeq ($(arch),armv8)
|
ifeq ($(arch),armv8)
|
||||||
comp=aarch64-linux-android21-clang
|
|
||||||
CXX=aarch64-linux-android21-clang++
|
CXX=aarch64-linux-android21-clang++
|
||||||
STRIP=aarch64-linux-android-strip
|
STRIP=aarch64-linux-android-strip
|
||||||
endif
|
endif
|
||||||
LDFLAGS += -static-libstdc++ -pie -lm -latomic
|
LDFLAGS += -static-libstdc++ -pie -lm -latomic
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(comp),icc)
|
||||||
|
profile_make = icc-profile-make
|
||||||
|
profile_use = icc-profile-use
|
||||||
|
else ifeq ($(comp),clang)
|
||||||
|
profile_make = clang-profile-make
|
||||||
|
profile_use = clang-profile-use
|
||||||
|
else
|
||||||
|
profile_make = gcc-profile-make
|
||||||
|
profile_use = gcc-profile-use
|
||||||
|
endif
|
||||||
|
|
||||||
### Travis CI script uses COMPILER to overwrite CXX
|
### Travis CI script uses COMPILER to overwrite CXX
|
||||||
ifdef COMPILER
|
ifdef COMPILER
|
||||||
COMPCXX=$(COMPILER)
|
COMPCXX=$(COMPILER)
|
||||||
|
@ -590,10 +587,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),ndk)
|
ifeq ($(comp),clang)
|
||||||
CXXFLAGS += -flto=thin
|
|
||||||
LDFLAGS += $(CXXFLAGS)
|
|
||||||
else ifeq ($(comp),clang)
|
|
||||||
CXXFLAGS += -flto=thin
|
CXXFLAGS += -flto=thin
|
||||||
ifneq ($(findstring MINGW,$(KERNEL)),)
|
ifneq ($(findstring MINGW,$(KERNEL)),)
|
||||||
CXXFLAGS += -fuse-ld=lld
|
CXXFLAGS += -fuse-ld=lld
|
||||||
|
|
Loading…
Add table
Reference in a new issue