From 69c2a705bf973560bfa3bfa86dfcce1249af3d37 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 26 Jul 2015 03:28:37 +0300 Subject: [PATCH] common.mak: use clang/clang++ to compile C/C++ sources. Note that -integrated-as is not active by default on OR1K, so we're still shelling out to binutils to assemble. It is not yet possible to build everything using -integrated-as. --- software/common.mak | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/software/common.mak b/software/common.mak index 11c29683..bed8305d 100644 --- a/software/common.mak +++ b/software/common.mak @@ -1,19 +1,20 @@ include $(MSCDIR)/software/include/generated/cpu.mak -TARGET_PREFIX=$(CPU)-elf- +TRIPLE=$(CPU)-elf +TARGET_PREFIX=$(TRIPLE)- RM ?= rm -f -CC_normal := $(TARGET_PREFIX)gcc -CX_normal := $(TARGET_PREFIX)g++ -AR_normal := $(TARGET_PREFIX)ar -LD_normal := $(TARGET_PREFIX)ld +CC_normal := clang -target $(TRIPLE) +CX_normal := clang++ -target $(TRIPLE) +AR_normal := $(TARGET_PREFIX)ar +LD_normal := $(TARGET_PREFIX)ld OBJCOPY_normal := $(TARGET_PREFIX)objcopy -CC_quiet = @echo " CC " $@ && $(TARGET_PREFIX)gcc -CX_quiet = @echo " CX " $@ && $(TARGET_PREFIX)g++ -AR_quiet = @echo " AR " $@ && $(TARGET_PREFIX)ar -LD_quiet = @echo " LD " $@ && $(TARGET_PREFIX)ld -OBJCOPY_quiet = @echo " OBJCOPY " $@ && $(TARGET_PREFIX)objcopy +CC_quiet = @echo " CC " $@ && $(CC_normal) +CX_quiet = @echo " CX " $@ && $(CX_normal) +AR_quiet = @echo " AR " $@ && $(AR_normal) +LD_quiet = @echo " LD " $@ && $(LD_normal) +OBJCOPY_quiet = @echo " OBJCOPY " $@ && $(OBJCOPY_normal) MSC_GIT_ID := $(shell cd $(MSCDIR) && python3 -c "from misoclib.cpu.identifier import get_id; print(hex(get_id()), end='')") -- 2.30.2