From 202034fd60eca48195c1683477c190f79a1c693f Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 5 May 2022 14:06:22 +0900 Subject: [PATCH] Override Make's default for CC and AR. --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 98aa995..44acdee 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,13 @@ # These variables are specifically meant to be overridable via the make # command-line. -CC ?= clang +# ?= doesn't work for CC and AR because make has a default value for them. +ifeq ($(origin CC), default) +CC := clang +endif NM ?= $(patsubst %clang,%llvm-nm,$(filter-out ccache sccache,$(CC))) -AR ?= $(patsubst %clang,%llvm-ar,$(filter-out ccache sccache,$(CC))) +ifeq ($(origin AR), default) +AR = $(patsubst %clang,%llvm-ar,$(filter-out ccache sccache,$(CC))) +endif EXTRA_CFLAGS ?= -O2 -DNDEBUG # The directory where we build the sysroot. SYSROOT ?= $(CURDIR)/sysroot -- 2.39.5