diff --git a/Makefile b/Makefile index 761ccbb..63f4ca7 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,7 @@ BASH= endif CLANG_VERSION=$(shell $(BASH) ./llvm_version.sh $(LLVM_PROJ_DIR)) +CLANG_MAJOR_VERSION=$(shell $(BASH) ./llvm_version_major.sh $(LLVM_PROJ_DIR)) VERSION:=$(shell $(BASH) ./version.sh) DEBUG_PREFIX_MAP=-fdebug-prefix-map=$(ROOT_DIR)=wasisdk://v$(VERSION) @@ -134,7 +135,7 @@ build/compiler-rt.BUILT: build/llvm.BUILT build/wasi-libc.BUILT -DCMAKE_C_FLAGS="$(DEBUG_PREFIX_MAP)" \ -DLLVM_CONFIG_PATH=$(ROOT_DIR)/build/llvm/bin/llvm-config \ -DCOMPILER_RT_OS_DIR=wasi \ - -DCMAKE_INSTALL_PREFIX=$(PREFIX)/lib/clang/$(CLANG_VERSION)/ \ + -DCMAKE_INSTALL_PREFIX=$(PREFIX)/lib/clang/$(CLANG_MAJOR_VERSION)/ \ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ $(LLVM_PROJ_DIR)/compiler-rt/lib/builtins DESTDIR=$(DESTDIR) ninja $(NINJA_FLAGS) -C build/compiler-rt install diff --git a/llvm_version_major.sh b/llvm_version_major.sh new file mode 100755 index 0000000..2e5d973 --- /dev/null +++ b/llvm_version_major.sh @@ -0,0 +1,4 @@ +#/bin/bash +LLVM_PROJ_DIR=${1:-./src/llvm-project} +MAJOR=`grep "set(LLVM_VERSION_MAJOR" $LLVM_PROJ_DIR/llvm/CMakeLists.txt | awk '{print substr($2, 1, length($2) - 1)}'` +echo $MAJOR