File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -341,6 +341,46 @@ rootfs_clean:
341
341
$(SUDO ) rm -f $(CPIO_FILE )
342
342
$(SUDO ) rm -f $(ROOTFS )
343
343
344
+ # #
345
+ # # U-Boot
346
+ # #
347
+
348
+ # Note: We're reusing the TARGET variable from the Linux build section
349
+
350
+ UBOOT_SRC := $(ROOT_DIR ) /u-boot
351
+ UBOOT_OUT := $(OUT_DIR ) /uboot/$(ARCH )
352
+ UBOOT_CONFIG := $(UBOOT_OUT ) /.config
353
+ UBOOT_BIN := $(UBOOT_OUT ) /u-boot.bin
354
+
355
+ ifeq ($(ARCH ) ,x86_64)
356
+ UBOOT_DEFCONFIG =qemu-x86_64_defconfig
357
+ else ifeq ($(ARCH),i386)
358
+ UBOOT_DEFCONFIG =qemu-x86_defconfig
359
+ else ifeq ($(ARCH),arm64)
360
+ UBOOT_DEFCONFIG =qemu_arm64_defconfig
361
+ endif
362
+
363
+ UBOOT_MAKE := \
364
+ PATH=$(CLANG_DIR ) /bin:$(PATH ) \
365
+ $(MAKE ) \
366
+ -C $(UBOOT_SRC ) \
367
+ HOSTCC=clang \
368
+ O=$(UBOOT_OUT ) \
369
+ -j ` nproc `
370
+
371
+ .PHONY : uboot_defconfig
372
+ uboot_defconfig $(UBOOT_CONFIG ) : | $(CLANG_DIR )
373
+ + $(UBOOT_MAKE ) $(UBOOT_DEFCONFIG )
374
+
375
+ .PHONY : uboot
376
+ uboot $(UBOOT_BIN ) : $(UBOOT_CONFIG ) | $(CLANG_DIR )
377
+ + $(UBOOT_MAKE ) CROSS_COMPILE=$(TARGET ) - CC=clang
378
+ cd $(UBOOT_SRC ) && ./scripts/gen_compile_commands.py -d $(UBOOT_OUT )
379
+
380
+ .PHONY : uboot_clean
381
+ uboot_clean :
382
+ + $(UBOOT_MAKE ) mrproper
383
+
344
384
# #
345
385
# # Run QEMU
346
386
# #
You can’t perform that action at this time.
0 commit comments