Skip to content

Commit 552b3cc

Browse files
committed
Makefile: Allow specifying compiler executable
No functional change Resolves #570
1 parent 356147d commit 552b3cc

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/Makefile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,12 @@ endif
218218

219219
### Travis CI script uses COMPILER to overwrite CXX
220220
ifdef COMPILER
221-
CXX=$(COMPILER)
221+
COMPCXX=$(COMPILER)
222+
endif
223+
224+
### Allow overwriting CXX from command line
225+
ifdef COMPCXX
226+
CXX=$(COMPCXX)
222227
endif
223228

224229
### On mingw use Windows threads, otherwise POSIX
@@ -365,7 +370,7 @@ help:
365370
@echo ""
366371
@echo "To compile stockfish, type: "
367372
@echo ""
368-
@echo "make target ARCH=arch [COMP=comp]"
373+
@echo "make target ARCH=arch [COMP=compiler] [COMPCXX=cxx]"
369374
@echo ""
370375
@echo "Supported targets:"
371376
@echo ""
@@ -395,11 +400,17 @@ help:
395400
@echo "clang > LLVM Clang compiler"
396401
@echo "icc > Intel compiler"
397402
@echo ""
398-
@echo "Examples. If you don't know what to do, you likely want to run: "
403+
@echo "Simple examples. If you don't know what to do, you likely want to run: "
399404
@echo ""
400405
@echo "make build ARCH=x86-64 (This is for 64-bit systems)"
401406
@echo "make build ARCH=x86-32 (This is for 32-bit systems)"
402407
@echo ""
408+
@echo "Advanced examples, for experienced users: "
409+
@echo ""
410+
@echo "make build ARCH=x86-64 COMP=clang"
411+
@echo "make profile-build ARCH=x86-64-modern COMP=gcc COMPCXX=g++-4.8"
412+
@echo ""
413+
403414

404415
.PHONY: build profile-build
405416
build:

0 commit comments

Comments
 (0)