Makefile 1.3 KB

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