]> git.sesse.net Git - stockfish/commit
Improve Makefile for Windows native builds
authorppigazzini <pasquale.pigazzini@gmail.com>
Mon, 17 Jan 2022 13:03:16 +0000 (14:03 +0100)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Wed, 19 Jan 2022 21:26:20 +0000 (22:26 +0100)
commit67062637f48e7d63e750dee63ba9e881ee6d9382
tree31aab12a7e7e51c788afc5541542e502f64a10e2
parent48bf1a386f031947d059a0dc26616366b0f2d5d3
Improve Makefile for Windows native builds

A Windows Native Build (WNB) can be done:
 - on Windows, using a recent mingw-w64 g++/clang compiler
   distributed by msys2, cygwin and others
 - on Linux, using mingw-w64 g++ to cross compile

Improvements:
 - check for a WNB in a proper way and set a variable to simplify the code
 - set the proper EXE for a WNB
 - use the proper name for the mingw-w64 clang compiler
 - use the static linking for a WNB
 - use wine to make a PGO cross compile on Linux (also with Intel SDE)
 - enable the LTO build for mingw-w64 g++ compiler
 - set `lto=auto` to use the make's job server, if available, or otherwise
   to fall back to autodetection of the number of CPU threads
 - clean up all the temporary LTO files saved in the local directory

Tested on:
 - msys2 MINGW64 (g++), UCRT64 (g++), MINGW32 (g++), CLANG64 (clang)
   environments
 - cygwin mingw-w64 g++
 - Ubuntu 18.04 & 21.10 mingw-w64 PGO cross compile (also with Intel SDE)

closes #3891

No functional change
src/Makefile