# Stockfish, a UCI chess playing engine derived from Glaurung 2.1
-# Copyright (C) 2004-2021 The Stockfish developers (see AUTHORS file)
+# Copyright (C) 2004-2022 The Stockfish developers (see AUTHORS file)
#
# Stockfish is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
ifeq ($(COMP),mingw)
comp=mingw
- ifeq ($(KERNEL),Linux)
- ifeq ($(bits),64)
- ifeq ($(shell which x86_64-w64-mingw32-c++-posix),)
- CXX=x86_64-w64-mingw32-c++
- else
- CXX=x86_64-w64-mingw32-c++-posix
- endif
+ ifeq ($(bits),64)
+ ifeq ($(shell which x86_64-w64-mingw32-c++-posix 2> /dev/null),)
+ CXX=x86_64-w64-mingw32-c++
else
- ifeq ($(shell which i686-w64-mingw32-c++-posix),)
- CXX=i686-w64-mingw32-c++
- else
- CXX=i686-w64-mingw32-c++-posix
- endif
+ CXX=x86_64-w64-mingw32-c++-posix
endif
else
- CXX=g++
+ ifeq ($(shell which i686-w64-mingw32-c++-posix 2> /dev/null),)
+ CXX=i686-w64-mingw32-c++
+ else
+ CXX=i686-w64-mingw32-c++-posix
+ endif
endif
CXXFLAGS += -pedantic -Wextra -Wshadow
ifneq ($(KERNEL),Darwin)
ifneq ($(KERNEL),OpenBSD)
ifneq ($(KERNEL),FreeBSD)
+ ifneq ($(findstring MINGW,$(KERNEL)),MINGW)
ifneq ($(RTLIB),compiler-rt)
LDFLAGS += -latomic
endif
endif
endif
endif
+ endif
ifeq ($(arch),$(filter $(arch),armv7 armv8))
ifeq ($(OS),Android)
CXXFLAGS += -m$(bits)
LDFLAGS += -m$(bits)
endif
+
+ ifeq ($(findstring MINGW,$(KERNEL)),MINGW)
+ LDFLAGS += -static
+ endif
+
endif
ifeq ($(KERNEL),Darwin)