Makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #
  2. # arch/xtensa/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. #
  9. # KBUILD_CFLAGS used when building rest of boot (takes effect recursively)
  10. KBUILD_CFLAGS += -fno-builtin -Iarch/$(ARCH)/boot/include
  11. HOSTFLAGS += -Iarch/$(ARCH)/boot/include
  12. BIG_ENDIAN := $(shell echo -e __XTENSA_EB__ | $(CC) -E - | grep -v "\#")
  13. export ccflags-y
  14. export BIG_ENDIAN
  15. subdir-y := lib
  16. # Subdirs for the boot loader(s)
  17. bootdir-$(CONFIG_XTENSA_PLATFORM_ISS) += boot-elf
  18. bootdir-$(CONFIG_XTENSA_PLATFORM_XT2000) += boot-redboot boot-elf boot-uboot
  19. BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB)).dtb.o
  20. ifneq ($(CONFIG_BUILTIN_DTB),"")
  21. obj-y += $(BUILTIN_DTB)
  22. endif
  23. # Rule to build device tree blobs
  24. $(obj)/%.dtb: $(src)/dts/%.dts FORCE
  25. $(call if_changed_dep,dtc)
  26. clean-files := *.dtb.S
  27. zImage Image: $(bootdir-y)
  28. $(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \
  29. $(addprefix $(obj)/,$(host-progs))
  30. $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)
  31. OBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary
  32. vmlinux.bin: vmlinux FORCE
  33. $(call if_changed,objcopy)
  34. vmlinux.bin.gz: vmlinux.bin FORCE
  35. $(call if_changed,gzip)
  36. boot-elf: vmlinux.bin
  37. boot-redboot: vmlinux.bin.gz
  38. boot-uboot: vmlinux.bin.gz