]> git.sesse.net Git - stockfish/blobdiff - src/Makefile
Fix Makefile for compilation with clang on Windows
[stockfish] / src / Makefile
index 406f029f39747b88100b85459bd0f208a2ef44da..0e889888549853abfac6b233e3ca8ba63f4872ee 100644 (file)
@@ -404,12 +404,14 @@ ifeq ($(COMP),clang)
        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)
@@ -420,6 +422,11 @@ ifeq ($(COMP),clang)
                CXXFLAGS += -m$(bits)
                LDFLAGS += -m$(bits)
        endif
+
+       ifeq ($(findstring MINGW,$(KERNEL)),MINGW)
+               LDFLAGS += -static
+       endif
+
 endif
 
 ifeq ($(KERNEL),Darwin)