]> git.proxmox.com Git - wasi-libc.git/commitdiff
Override Make's default for CC and AR.
authorMike Hommey <mh@glandium.org>
Thu, 5 May 2022 05:06:22 +0000 (14:06 +0900)
committerDan Gohman <dev@sunfishcode.online>
Thu, 5 May 2022 23:33:00 +0000 (16:33 -0700)
Makefile

index 98aa995bc124269057925838a534e14f8d2e33e5..44acdee993cf9c99a72b2773dac92a81f4337e7c 100644 (file)
--- 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