File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ ROOT_DIR := $(CURDIR)
2
2
OUT_DIR := $(ROOT_DIR ) /out
3
3
SCRIPT_DIR := $(ROOT_DIR ) /scripts
4
4
CONFIG_DIR := $(ROOT_DIR ) /config
5
+ CLANG_DIR ?= $(ROOT_DIR ) /toolchain/clang
6
+
7
+ CLANG_URL := https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.6/clang+llvm-15.0.6-x86_64-linux-gnu-ubuntu-18.04.tar.xz
5
8
6
9
SHARED_DIR := $(ROOT_DIR ) /shared
7
10
@@ -138,6 +141,7 @@ else ifeq ($(ARCH),arm64)
138
141
endif
139
142
140
143
LINUX_MAKE := \
144
+ PATH=$(CLANG_DIR ) /bin:$(PATH ) \
141
145
$(MAKE ) \
142
146
-C $(LINUX_SRC ) \
143
147
ARCH=$(ARCH ) \
@@ -146,6 +150,12 @@ LINUX_MAKE := \
146
150
V=$(VERBOSE ) \
147
151
O=$(LINUX_OUT )
148
152
153
+ $(CLANG_DIR ) :
154
+ $(warning $(YELLOW ) Clang directory $(CLANG_DIR ) does not exist, downloading prebuilt binaries $(NC ) )
155
+ wget --no-verbose --show-progress $(CLANG_URL ) -O clang.tar.xz
156
+ mkdir -p $(CLANG_DIR )
157
+ tar -xf clang.tar.xz -C $(CLANG_DIR ) --strip-components=1
158
+
149
159
.PHONY : linux_defconfig
150
160
linux_defconfig $(LINUX_CONFIG ) : $(LINUX_CONFIG_FRAGMENT )
151
161
+ $(LINUX_MAKE ) $(LINUX_DEFCONFIG )
@@ -158,7 +168,7 @@ linux_defconfig $(LINUX_CONFIG): $(LINUX_CONFIG_FRAGMENT)
158
168
$(SCRIPT_DIR ) /check_merged_config.sh $(LINUX_CONFIG ) $(LINUX_CONFIG_FRAGMENT )
159
169
160
170
.PHONY : linux
161
- linux $(KERNEL_IMAGE ) : $(LINUX_CONFIG )
171
+ linux $(KERNEL_IMAGE ) : $(LINUX_CONFIG ) | $( CLANG_DIR )
162
172
+ $(LINUX_MAKE )
163
173
$(LINUX_SRC ) /scripts/clang-tools/gen_compile_commands.py -d $(LINUX_OUT )
164
174
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ if [ $ACK -eq 0 ]; then
39
39
echo " Downloading kernel version $VERSION "
40
40
41
41
if [ $first_char -ge $MIN_VERSION ] && [ $first_char -le $MAX_VERSION ]; then
42
- wget $LINUX_URL /v${first_char} .x/linux-$VERSION .tar.xz
42
+ wget --no-verbose --show-progress $LINUX_URL /v${first_char} .x/linux-$VERSION .tar.xz
43
43
tar -xf linux-$VERSION .tar.xz
44
44
else
45
45
echo " $first_char is not a valid kernel major version number"
You can’t perform that action at this time.
0 commit comments