make: allow updating LLVM sources

This commit is contained in:
Jake Bailey
2026-09-11 12:15:08 -07:00
committed by Ron Evans
parent c57dc32967
commit 0bc2f1cf30
+7 -4
View File
@@ -78,13 +78,16 @@ endif
# Pinned in llvm-version.txt. Branch tinygo_22.x of tinygo-org/llvm-project. # Pinned in llvm-version.txt. Branch tinygo_22.x of tinygo-org/llvm-project.
LLVM_REVISION = $(shell cat llvm-version.txt) LLVM_REVISION = $(shell cat llvm-version.txt)
$(LLVM_PROJECTDIR)/llvm: llvm-source: ## Get or update LLVM sources
git init $(LLVM_PROJECTDIR) @if [ ! -e "$(LLVM_PROJECTDIR)/.git" ]; then \
git init $(LLVM_PROJECTDIR); \
fi
cd $(LLVM_PROJECTDIR) && \ cd $(LLVM_PROJECTDIR) && \
git remote add origin https://github.com/tinygo-org/llvm-project && \ if ! git remote get-url origin >/dev/null 2>&1; then \
git remote add origin https://github.com/tinygo-org/llvm-project; \
fi && \
git fetch --depth=1 origin $(LLVM_REVISION) && \ git fetch --depth=1 origin $(LLVM_REVISION) && \
git checkout FETCH_HEAD git checkout FETCH_HEAD
llvm-source: $(LLVM_PROJECTDIR)/llvm ## Get LLVM sources
# Configure LLVM. # Configure LLVM.
TINYGO_SOURCE_DIR=$(shell pwd) TINYGO_SOURCE_DIR=$(shell pwd)