Makefile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. bootdir-$(CONFIG_XTENSA_PLATFORM_XTFPGA) += boot-redboot boot-elf boot-uboot
  20. BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB)).dtb.o
  21. ifneq ($(CONFIG_BUILTIN_DTB),"")
  22. obj-$(CONFIG_OF) += $(BUILTIN_DTB)
  23. endif
  24. # Rule to build device tree blobs
  25. $(obj)/%.dtb: $(src)/dts/%.dts FORCE
  26. $(call if_changed_dep,dtc)
  27. clean-files := *.dtb.S
  28. zImage Image: $(bootdir-y)
  29. $(bootdir-y): $(addprefix $(obj)/,$(subdir-y)) \
  30. $(addprefix $(obj)/,$(host-progs))
  31. $(Q)$(MAKE) $(build)=$(obj)/$@ $(MAKECMDGOALS)
  32. OBJCOPYFLAGS = --strip-all -R .comment -R .note.gnu.build-id -O binary
  33. vmlinux.bin: vmlinux FORCE
  34. $(call if_changed,objcopy)
  35. vmlinux.bin.gz: vmlinux.bin FORCE
  36. $(call if_changed,gzip)
  37. boot-elf: vmlinux.bin
  38. boot-redboot: vmlinux.bin.gz
  39. boot-uboot: vmlinux.bin.gz