commit 3317ca30d0f1a9fd607b55ce155db5c6232a6037
parent 8817bada986aa4c1f0bddf8eeca2d46ba931a52c
Author: Ryan Sepassi <rsepassi@gmail.com>
Date: Sat, 2 May 2026 10:28:15 -0700
mk: set tcc arch from arch
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
@@ -213,7 +213,10 @@ $(CC_BINS): build/%/cc/cc.scm: $(CC_SRCS) build/%/.image build/%/tools/M0
# lives outside the per-arch tree because it depends on TCC_TARGET, not
# the build arch.
-TCC_TARGET ?= X86_64
+TCC_TARGET_aarch64 := ARM64
+TCC_TARGET_amd64 := X86_64
+TCC_TARGET_riscv64 := RISCV64
+TCC_TARGET ?= $(TCC_TARGET_$(ARCH))
TCC_FLAT := build/tcc/$(TCC_TARGET)/tcc.flat.c
TCC_BOOT2_BINS := $(foreach a,$(ALL_ARCHES),build/$(a)/tcc-boot2/tcc-boot2)
@@ -454,7 +457,7 @@ else ifeq ($(SUITE),tcc-cc)
@if [ -n "$(ARCH_FILTER)" ] && [ "$(ARCH_FILTER)" != "$(TCC_CC_ARCH)" ]; then \
echo "tcc-cc currently supports ARCH=$(TCC_CC_ARCH) only" >&2; exit 2; \
fi
- @$(MAKE) --no-print-directory TCC_TARGET=ARM64 $(TEST_TCC_CC_DEPS)
+ @$(MAKE) --no-print-directory ARCH=$(TCC_CC_ARCH) $(TEST_TCC_CC_DEPS)
sh scripts/run-tests.sh --suite=tcc-cc --arch=$(TCC_CC_ARCH) $(NAMES)
else
@echo "unknown SUITE='$(SUITE)' (m1pp | p1 | scheme1 | cc-util | cc-lex | cc-pp | cc-cg | cc | cc-libc | cc-ext | tcc-cc)" >&2; exit 2