Makefile 874 B

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