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