From a26cafcbdab274f1a5f4c42e5a706f19a9f0d6b5 Mon Sep 17 00:00:00 2001 From: Frank Halasz Date: Wed, 18 Mar 2026 00:01:24 -0700 Subject: [PATCH] Change USE_GCC=T/USE_CLANG=T to USE_COMPILER=clang/gcc for linux-y makefiles --- bin/linux-compiler.mk | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/bin/linux-compiler.mk b/bin/linux-compiler.mk index e147e8a..5bc17e5 100644 --- a/bin/linux-compiler.mk +++ b/bin/linux-compiler.mk @@ -9,28 +9,25 @@ EXISTS_CLANG := $(shell command -v clang) ifeq ($(or $(EXISTS_GCC),$(EXISTS_CLANG)),) $(error "Cannot find compiler: neither gcc nor clang. Exiting.") endif -ifneq ($(and $(USE_CLANG),$(USE_GCC)),) - $(error "Cannot use both USE_CLANG=T and USE_GCC=T. Exiting.") -endif COMPILER := -ifdef USE_CLANG +ifeq ($(USE_COMPILER),clang) ifeq ($(EXISTS_CLANG),) - $(error "USE_CLANG=T given, but cannot find the clang compiler. Exiting") + $(error "USE_COMPILER=clang, but cannot find the clang compiler. Exiting") endif COMPILER := clang -endif -ifdef USE_GCC +else ifeq ($(USE_COMPILER),gcc) ifeq ($(EXISTS_GCC),) - $(error "USE_GCC=T given, but cannot find the gcc compiler. Exiting") + $(error "USE_COMPILER=gcc given, but cannot find the gcc compiler. Exiting") endif COMPILER := gcc +else ifneq ($(EXISTS_CLANG),) + COMPILER := clang +else + COMPILER := gcc endif + ifeq ($(COMPILER),) - ifneq ($(EXISTS_CLANG),) - COMPILER := clang - else - COMPILER := gcc - endif + $(error "Oops. Trying to select gcc or clang but should never get here") endif ifeq ($(COMPILER),gcc)