Makefile 890 B

12345678910111213141516171819202122232425262728293031
  1. #
  2. # This file is subject to the terms and conditions of the GNU General Public
  3. # License. See the file "COPYING" in the main directory of this archive
  4. # for more details.
  5. #
  6. OBJCOPY_ARGS := -O $(if $(CONFIG_CPU_BIG_ENDIAN),elf32-xtensa-be,elf32-xtensa-le)
  7. boot-y := bootstrap.o
  8. targets += $(boot-y)
  9. OBJS := $(addprefix $(obj)/,$(boot-y))
  10. LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a
  11. $(obj)/zImage.o: $(obj)/../vmlinux.bin.gz $(OBJS)
  12. $(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
  13. --add-section image=$< \
  14. --set-section-flags image=contents,alloc,load,load,data \
  15. $(OBJS) $@
  16. $(obj)/zImage.elf: $(obj)/zImage.o $(LIBS)
  17. $(Q)$(LD) $(KBUILD_LDFLAGS) \
  18. -T $(srctree)/$(obj)/boot.ld \
  19. --build-id=none \
  20. -o $@ $^
  21. $(obj)/../zImage.redboot: $(obj)/zImage.elf
  22. $(Q)$(OBJCOPY) -S -O binary $< $@
  23. $(Q)$(kecho) ' Kernel: $@ is ready'
  24. all zImage: $(obj)/../zImage.redboot