Makefile 961 B

1234567891011121314151617181920212223242526272829303132
  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. LD_ARGS = -T $(srctree)/$(obj)/boot.ld
  8. boot-y := bootstrap.o
  9. targets += $(boot-y)
  10. OBJS := $(addprefix $(obj)/,$(boot-y))
  11. LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a
  12. LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
  13. $(obj)/zImage.o: $(obj)/../vmlinux.bin.gz $(OBJS)
  14. $(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
  15. --add-section image=$< \
  16. --set-section-flags image=contents,alloc,load,load,data \
  17. $(OBJS) $@
  18. $(obj)/zImage.elf: $(obj)/zImage.o $(LIBS)
  19. $(Q)$(LD) $(LD_ARGS) -o $@ $^ -L/xtensa-elf/lib $(LIBGCC)
  20. $(obj)/../zImage.redboot: $(obj)/zImage.elf
  21. $(Q)$(OBJCOPY) -S -O binary $< $@
  22. $(Q)$(kecho) ' Kernel: $@ is ready'
  23. all zImage: $(obj)/../zImage.redboot