Makefile 962 B

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