Makefile 826 B

123456789101112131415161718192021222324252627282930313233
  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. export OBJCOPY_ARGS
  12. export CPPFLAGS_boot.lds += -P -C
  13. boot-y := bootstrap.o
  14. OBJS := $(addprefix $(obj)/,$(boot-y))
  15. $(obj)/Image.o: vmlinux.bin $(OBJS)
  16. $(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
  17. --add-section image=vmlinux.bin \
  18. --set-section-flags image=contents,alloc,load,load,data \
  19. $(OBJS) $@
  20. $(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds
  21. $(Q)$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
  22. -T $(obj)/boot.lds \
  23. --build-id=none \
  24. -o $@ $(obj)/Image.o
  25. $(Q)$(kecho) ' Kernel: $@ is ready'
  26. zImage: $(obj)/../Image.elf