Makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # SPDX-License-Identifier: GPL-2.0
  2. targets := vmlinux.bin vmlinux.bin.gz uImage
  3. # uImage build relies on mkimage being availble on your host for ARC target
  4. # You will need to build u-boot for ARC, rename mkimage to arc-elf32-mkimage
  5. # and make sure it's reacable from your PATH
  6. OBJCOPYFLAGS= -O binary -R .note -R .note.gnu.build-id -R .comment -S
  7. LINUX_START_TEXT = $$(readelf -h vmlinux | \
  8. grep "Entry point address" | grep -o 0x.*)
  9. UIMAGE_LOADADDR = $(CONFIG_LINUX_LINK_BASE)
  10. UIMAGE_ENTRYADDR = $(LINUX_START_TEXT)
  11. suffix-y := bin
  12. suffix-$(CONFIG_KERNEL_GZIP) := gz
  13. suffix-$(CONFIG_KERNEL_LZMA) := lzma
  14. targets += uImage
  15. targets += uImage.bin
  16. targets += uImage.gz
  17. targets += uImage.lzma
  18. extra-y += vmlinux.bin
  19. extra-y += vmlinux.bin.gz
  20. extra-y += vmlinux.bin.lzma
  21. $(obj)/vmlinux.bin: vmlinux FORCE
  22. $(call if_changed,objcopy)
  23. $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
  24. $(call if_changed,gzip)
  25. $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
  26. $(call if_changed,lzma)
  27. $(obj)/uImage.bin: $(obj)/vmlinux.bin FORCE
  28. $(call if_changed,uimage,none)
  29. $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE
  30. $(call if_changed,uimage,gzip)
  31. $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma FORCE
  32. $(call if_changed,uimage,lzma)
  33. $(obj)/uImage: $(obj)/uImage.$(suffix-y)
  34. @ln -sf $(notdir $<) $@
  35. @echo ' Image $@ is ready'