mirror of
https://github.com/enjoy-digital/litex.git
synced 2025-01-04 09:52:26 -05:00
Merge pull request #1093 from cr1901/ccache
Add option in Makefile for (s)ccache support.
This commit is contained in:
commit
3ba5d6f187
2 changed files with 12 additions and 6 deletions
|
@ -6,13 +6,14 @@ endif
|
||||||
|
|
||||||
RM ?= rm -f
|
RM ?= rm -f
|
||||||
PYTHON ?= python3
|
PYTHON ?= python3
|
||||||
|
CCACHE ?=
|
||||||
|
|
||||||
ifeq ($(CLANG),1)
|
ifeq ($(CLANG),1)
|
||||||
CC_normal := clang -target $(TRIPLE) -integrated-as
|
CC_normal := $(CCACHE) clang -target $(TRIPLE) -integrated-as
|
||||||
CX_normal := clang++ -target $(TRIPLE) -integrated-as
|
CX_normal := $(CCACHE) clang++ -target $(TRIPLE) -integrated-as
|
||||||
else
|
else
|
||||||
CC_normal := $(TARGET_PREFIX)gcc -std=gnu99
|
CC_normal := $(CCACHE) $(TARGET_PREFIX)gcc -std=gnu99
|
||||||
CX_normal := $(TARGET_PREFIX)g++
|
CX_normal := $(CCACHE) $(TARGET_PREFIX)g++
|
||||||
endif
|
endif
|
||||||
AR_normal := $(TARGET_PREFIX)gcc-ar
|
AR_normal := $(TARGET_PREFIX)gcc-ar
|
||||||
LD_normal := $(TARGET_PREFIX)ld
|
LD_normal := $(TARGET_PREFIX)ld
|
||||||
|
|
|
@ -9,9 +9,15 @@ ifeq ($(CPU), microwatt)
|
||||||
CFLAGS += -DLONG_LONG_MIN=LLONG_MIN -DLONG_LONG_MAX=LLONG_MAX -DLONG_LONG_MIN=LLONG_MIN -DULONG_LONG_MAX=ULLONG_MAX
|
CFLAGS += -DLONG_LONG_MIN=LLONG_MIN -DLONG_LONG_MAX=LLONG_MAX -DLONG_LONG_MIN=LLONG_MIN -DULONG_LONG_MAX=ULLONG_MAX
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(CCACHE), )
|
||||||
|
MESON_CROSS_CC = '$(TRIPLE)-gcc'
|
||||||
|
else
|
||||||
|
MESON_CROSS_CC = ['$(CCACHE)', '$(TRIPLE)-gcc']
|
||||||
|
endif
|
||||||
|
|
||||||
define CROSSFILE
|
define CROSSFILE
|
||||||
[binaries]
|
[binaries]
|
||||||
c = '$(TRIPLE)-gcc'
|
c = $(MESON_CROSS_CC)
|
||||||
ar = '$(TRIPLE)-gcc-ar'
|
ar = '$(TRIPLE)-gcc-ar'
|
||||||
as = '$(TRIPLE)-as'
|
as = '$(TRIPLE)-as'
|
||||||
nm = '$(TRIPLE)-gcc-nm'
|
nm = '$(TRIPLE)-gcc-nm'
|
||||||
|
@ -60,4 +66,3 @@ libc.a: $(LIBC_DIRECTORY)/missing.c _libc.a
|
||||||
$(compile)
|
$(compile)
|
||||||
$(AR) csr _libc.a $@
|
$(AR) csr _libc.a $@
|
||||||
cp _libc.a libc.a
|
cp _libc.a libc.a
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue