diff options
author | Quentin Monnet <quentin@isovalent.com> | 2022-01-26 23:48:03 +0000 |
---|---|---|
committer | Quentin Monnet <qmonnet+github@qoba.lt> | 2022-01-27 10:12:38 +0000 |
commit | aa339ca21cc1d869180255dd5035d8039a30fd05 (patch) | |
tree | 13e45192a3171a63be7cca2a7fc8c8ad05796c8b | |
parent | b672773f35c6f8efd4cf840d829e2d15f622863c (diff) | |
download | bpftool-aa339ca21cc1d869180255dd5035d8039a30fd05.tar.gz |
mirror: Fix usage of $(LLVM_VERSION) in Makefile.include
The variable is declared too late, and cannot be used to set the version
to use for CC and LD if $(LLVM) is set. Let's move it higher in the
file, and use it where relevant.
Fixes: 68a9819b0610 ("mirror: Implement definitions from tools/scripts/Makefile.include")
Signed-off-by: Quentin Monnet <quentin@isovalent.com>
-rw-r--r-- | src/Makefile.include | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Makefile.include b/src/Makefile.include index 1121d78..ec3df48 100644 --- a/src/Makefile.include +++ b/src/Makefile.include @@ -5,9 +5,13 @@ $(if $(shell [ -d "$(OUTPUT)" -a -x "$(OUTPUT)" ] && echo 1),, \ $(error output directory "$(OUTPUT)" does not exist)) endif +LLVM_VERSION ?= +CLANG ?= clang$(LLVM_VERSION) +LLVM_STRIP ?= llvm-strip$(LLVM_VERSION) + ifneq ($(LLVM),) - $(if $(findstring default,$(origin CC)),$(eval CC := clang)) - $(if $(findstring default,$(origin LD)),$(eval LD := ld.lld)) + $(if $(findstring default,$(origin CC)),$(eval CC := clang$(LLVM_VERSION))) + $(if $(findstring default,$(origin LD)),$(eval LD := ld.lld$(LLVM_VERSION))) HOSTCC ?= clang HOSTLD ?= ld.lld else @@ -17,10 +21,6 @@ else HOSTLD ?= ld endif -LLVM_VERSION ?= -CLANG ?= clang$(LLVM_VERSION) -LLVM_STRIP ?= llvm-strip$(LLVM_VERSION) - EXTRA_WARNINGS := \ -Wbad-function-cast \ -Wdeclaration-after-statement \ |