Makefile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #
  2. # arch/microblaze/boot/Makefile
  3. #
  4. MKIMAGE := $(srctree)/scripts/mkuboot.sh
  5. obj-y += linked_dtb.o
  6. targets := linux.bin linux.bin.gz simpleImage.%
  7. OBJCOPYFLAGS := -O binary
  8. # Where the DTS files live
  9. dtstree := $(srctree)/$(src)/dts
  10. # Ensure system.dtb exists
  11. $(obj)/linked_dtb.o: $(obj)/system.dtb
  12. # Generate system.dtb from $(DTB).dtb
  13. ifneq ($(DTB),system)
  14. $(obj)/system.dtb: $(obj)/$(DTB).dtb
  15. $(call if_changed,cp)
  16. endif
  17. $(obj)/linux.bin: vmlinux FORCE
  18. [ -n $(CONFIG_INITRAMFS_SOURCE) ] && [ ! -e $(CONFIG_INITRAMFS_SOURCE) ] && \
  19. touch $(CONFIG_INITRAMFS_SOURCE) || echo "No CPIO image"
  20. $(call if_changed,objcopy)
  21. $(call if_changed,uimage)
  22. @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
  23. $(obj)/linux.bin.gz: $(obj)/linux.bin FORCE
  24. $(call if_changed,gzip)
  25. @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
  26. quiet_cmd_cp = CP $< $@$2
  27. cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)
  28. quiet_cmd_strip = STRIP $@
  29. cmd_strip = $(STRIP) -K _start -K _end -K __log_buf -K _fdt_start vmlinux -o $@
  30. quiet_cmd_uimage = UIMAGE $@.ub
  31. cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A microblaze -O linux -T kernel \
  32. -C none -n 'Linux-$(KERNELRELEASE)' \
  33. -a $(CONFIG_KERNEL_BASE_ADDR) -e $(CONFIG_KERNEL_BASE_ADDR) \
  34. -d $@ $@.ub
  35. $(obj)/simpleImage.%: vmlinux FORCE
  36. $(call if_changed,cp,.unstrip)
  37. $(call if_changed,objcopy)
  38. $(call if_changed,uimage)
  39. $(call if_changed,strip)
  40. @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
  41. # Rule to build device tree blobs
  42. DTC = $(objtree)/scripts/dtc/dtc
  43. # Rule to build device tree blobs
  44. quiet_cmd_dtc = DTC $@
  45. cmd_dtc = $(DTC) -O dtb -o $(obj)/$*.dtb -b 0 -p 1024 $(dtstree)/$*.dts
  46. $(obj)/%.dtb: $(dtstree)/%.dts FORCE
  47. $(call if_changed,dtc)
  48. clean-kernel += linux.bin linux.bin.gz simpleImage.*
  49. clean-files += *.dtb simpleImage.*.unstrip