Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #
  2. # arch/nios2/boot/Makefile
  3. #
  4. # This file is subject to the terms and conditions of the GNU General Public
  5. # License. See the file "COPYING" in the main directory of this archive
  6. # for more details.
  7. #
  8. UIMAGE_LOADADDR = $(shell $(NM) vmlinux | awk '$$NF == "_stext" {print $$1}')
  9. UIMAGE_ENTRYADDR = $(shell $(NM) vmlinux | awk '$$NF == "_start" {print $$1}')
  10. UIMAGE_COMPRESSION = gzip
  11. OBJCOPYFLAGS_vmlinux.bin := -O binary
  12. targets += vmlinux.bin vmlinux.gz vmImage
  13. $(obj)/vmlinux.bin: vmlinux FORCE
  14. $(call if_changed,objcopy)
  15. $(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
  16. $(call if_changed,gzip)
  17. $(obj)/vmImage: $(obj)/vmlinux.gz
  18. $(call if_changed,uimage)
  19. @$(kecho) 'Kernel: $@ is ready'
  20. $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
  21. $(call if_changed,objcopy)
  22. @$(kecho) 'Kernel: $@ is ready'
  23. $(obj)/compressed/vmlinux: $(obj)/vmlinux.gz FORCE
  24. $(Q)$(MAKE) $(build)=$(obj)/compressed $@
  25. # Rule to build device tree blobs
  26. DTB_SRC := $(patsubst "%",%,$(CONFIG_NIOS2_DTB_SOURCE))
  27. # Make sure the generated dtb gets removed during clean
  28. extra-$(CONFIG_NIOS2_DTB_SOURCE_BOOL) += system.dtb
  29. $(obj)/system.dtb: $(DTB_SRC) FORCE
  30. $(call cmd,dtc)
  31. # Ensure system.dtb exists
  32. $(obj)/linked_dtb.o: $(obj)/system.dtb
  33. obj-$(CONFIG_NIOS2_DTB_SOURCE_BOOL) += linked_dtb.o
  34. targets += $(dtb-y)
  35. # Rule to build device tree blobs with make command
  36. $(obj)/%.dtb: $(src)/dts/%.dts FORCE
  37. $(call if_changed_dep,dtc)
  38. $(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))
  39. install:
  40. sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"