summaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorQuinn Stephens <quinn@osmora.org>2025-02-14 16:55:45 -0500
committerIan Moffett <ian@osmora.org>2025-02-14 19:43:38 -0500
commitd8fd1be4f13f8f744b3a6eae1e4e633b405a8419 (patch)
treefcd90f4678ef54b8a6bd6f2d171fef1816b00bd1 /Makefile.in
parent38021bbed3b2feecb9b103875adf90c877ab2126 (diff)
build: Add Clang/LLVM toolchain support
Added support for building with Clang/LLVM and made it the default since building a cross-compiling toolchain with GCC is generally less efficient. In `configure.ac`, `TOOLCHAIN` must be set to `clang` or `gcc`. Signed-off-by: Quinn Stephens <quinn@osmora.org> Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in25
1 files changed, 18 insertions, 7 deletions
diff --git a/Makefile.in b/Makefile.in
index 01fe328..7783676 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -15,14 +15,25 @@ override KERNEL_DEFINES = $ -DHYRA_VERSION="\"$(HYRA_VERSION)\""\
-DHYRA_ARCH="\"@ARCH@\"" $(shell cat sys/arch/$(ARCH)/conf/GENERIC | tools/kconf/kconf)
######################
-# Binutils stuff
+# Toolchain
######################
-ifeq ($(ARCH), amd64)
- override CC = $(shell pwd)/cross/bin/x86_64-hyra-gcc
- override LD = $(shell pwd)/cross/bin/x86_64-hyra-ld
-else
- override CC = $(shell pwd)/cross/bin/$(ARCH)-hyra-gcc
- override LD = $(shell pwd)/cross/bin/$(ARCH)-hyra-ld
+override TOOLCHAIN = @TOOLCHAIN@
+ifeq ($(TOOLCHAIN), clang)
+ ifeq ($(ARCH), amd64)
+ override CC = clang -target x86_64-none-elf
+ override LD = ld.lld
+ else
+ override CC = clang -target $(ARCH)-none-elf
+ override LD = ld.lld
+ endif
+else ifeq ($(TOOLCHAIN), gcc)
+ ifeq ($(ARCH), amd64)
+ override CC = $(shell pwd)/cross/bin/x86_64-hyra-gcc
+ override LD = $(shell pwd)/cross/bin/x86_64-hyra-ld
+ else
+ override CC = $(shell pwd)/cross/bin/$(ARCH)-hyra-gcc
+ override LD = $(shell pwd)/cross/bin/$(ARCH)-hyra-ld
+ endif
endif
##########################