Browse Source
Makefile: autodetect llvm-ar and llvm-nm commands
pull/906/head
Jaden Weiss
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
19 additions and
3 deletions
-
Makefile
|
@ -9,8 +9,24 @@ LLD_SRC ?= llvm-project/lld |
|
|
|
|
|
|
|
|
# Default tool selection.
|
|
|
# Default tool selection.
|
|
|
CLANG ?= clang-9 |
|
|
CLANG ?= clang-9 |
|
|
LLVM_AR ?= llvm-ar-9 |
|
|
|
|
|
LLVM_NM ?= llvm-nm-9 |
|
|
# Try to autodetect llvm-ar and llvm-nm
|
|
|
|
|
|
ifneq (, $(shell command -v llvm-ar-9 2> /dev/null)) |
|
|
|
|
|
LLVM_AR ?= llvm-ar-9 |
|
|
|
|
|
else ifneq (, $(shell command -v llvm-ar 2> /dev/null)) |
|
|
|
|
|
LLVM_AR ?= llvm-ar |
|
|
|
|
|
endif |
|
|
|
|
|
ifneq (, $(shell command -v llvm-nm-9 2> /dev/null)) |
|
|
|
|
|
LLVM_NM ?= llvm-nm-9 |
|
|
|
|
|
else ifneq (, $(shell command -v llvm-nm 2> /dev/null)) |
|
|
|
|
|
LLVM_NM ?= llvm-nm |
|
|
|
|
|
endif |
|
|
|
|
|
ifndef LLVM_AR |
|
|
|
|
|
$(warning llvm-ar not found) |
|
|
|
|
|
endif |
|
|
|
|
|
ifndef LLVM_NM |
|
|
|
|
|
$(warning llvm-nm not found) |
|
|
|
|
|
endif |
|
|
|
|
|
|
|
|
# Go binary and GOROOT to select
|
|
|
# Go binary and GOROOT to select
|
|
|
GO ?= go |
|
|
GO ?= go |
|
@ -23,7 +39,7 @@ MD5SUM = md5sum |
|
|
TINYGO ?= tinygo |
|
|
TINYGO ?= tinygo |
|
|
|
|
|
|
|
|
# Use CCACHE for LLVM if possible
|
|
|
# Use CCACHE for LLVM if possible
|
|
|
ifneq (, $(shell which ccache)) |
|
|
ifneq (, $(shell command -v ccache 2> /dev/null)) |
|
|
LLVM_OPTION += '-DLLVM_CCACHE_BUILD=ON' |
|
|
LLVM_OPTION += '-DLLVM_CCACHE_BUILD=ON' |
|
|
endif |
|
|
endif |
|
|
|
|
|
|
|
|