Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. sdkdir := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
  2. sdkdir := $(sdkdir:/=)
  3. MAKEFILE_DIR=$(sdkdir)/scripts
  4. # For SDK build ENV, it should be the first.
  5. include $(MAKEFILE_DIR)/sdk_env.mk
  6. .PHONY: all nvdla-demo
  7. nvdla-demo: $(fit) $(vfat_image)
  8. @echo "To completely erase, reformat, and program a disk sdX, run:"
  9. @echo " make DISK=/dev/sdX format-nvdla-disk"
  10. @echo " ... you will need gdisk and e2fsprogs installed"
  11. @echo " Please note this will not currently format the SDcard ext4 partition"
  12. @echo " This can be done manually if needed"
  13. @echo
  14. all: $(fit) $(flash_image)
  15. @echo
  16. @echo "This image has been generated for an ISA of $(ISA) and an ABI of $(ABI)"
  17. @echo "Find the image in work/image.fit, which should be copied to an MSDOS boot partition 1"
  18. @echo
  19. @echo "To completely erase, reformat, and program a disk sdX, run:"
  20. @echo " make DISK=/dev/sdX format-boot-loader"
  21. @echo " ... you will need gdisk and e2fsprogs installed"
  22. @echo " Please note this will not currently format the SDcard ext4 partition"
  23. @echo " This can be done manually if needed"
  24. @echo
  25. $(fit): sbi $(vmlinux_bin) $(uboot) $(its_file) $(initramfs)
  26. $(uboot_wrkdir)/tools/mkimage -f $(its_file) -A riscv -O linux -T flat_dt $@
  27. @if [ -f fsz.sh ]; then ./fsz.sh $(sbi_bin); fi
  28. .PHONY: buildroot_initramfs_sysroot vmlinux bbl fit
  29. buildroot_initramfs_sysroot: $(buildroot_initramfs_sysroot)
  30. vmlinux: $(vmlinux)
  31. fit: $(fit)
  32. .PHONY: clean
  33. clean:
  34. rm -rf work/u-boot
  35. rm -rf work/opensbi
  36. rm work/vmlinux.bin
  37. rm work/hifive-unleashed-vfat.part
  38. rm work/image.fit
  39. rm work/initramfs.cpio.gz
  40. rm work/linux/vmlinux
  41. ifeq ($(buildroot_rootfs_ext),$(wildcard $(buildroot_rootfs_ext)))
  42. rm work/buildroot_rootfs/images/rootfs.ext4
  43. endif
  44. ifeq ($(buildroot_initramfs_tar),$(wildcard $(buildroot_initramfs_tar)))
  45. rm work/buildroot_initramfs/images/rootfs.tar
  46. endif
  47. .PHONY: distclean
  48. distclean:
  49. rm -rf -- $(wrkdir) $(toolchain_dest)
  50. include $(MAKEFILE_DIR)/distro_buildroot.mk
  51. include $(MAKEFILE_DIR)/distro_buildroot_image.mk
  52. include $(MAKEFILE_DIR)/firmware_opensbi.mk
  53. include $(MAKEFILE_DIR)/firmware_u-boot.mk
  54. include $(MAKEFILE_DIR)/kernel_linux.mk
  55. include $(MAKEFILE_DIR)/virtual_test.mk
  56. -include $(MAKEFILE_DIR)/debug.mk
  57. ######### New SDK #########
  58. include $(MAKEFILE_DIR)/staging/Makefile
  59. ######### New SDK #########
  60. ifeq ($(CONFIG_BUILD_BUILDROOT_CROSS_COMPILE),y)
  61. ## We need it for buildroot cross compiler
  62. -include $(initramfs).d
  63. endif