From: whitequark Date: Sun, 26 Jul 2015 00:28:37 +0000 (+0300) Subject: common.mak: use clang/clang++ to compile C/C++ sources. X-Git-Tag: 24jan2021_ls180~2192 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=69c2a705bf973560bfa3bfa86dfcce1249af3d37;p=litex.git 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. --- 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='')")