Makefile 835 B

123456789101112131415161718192021222324252627282930
  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. CPPFLAGS_boot.lds += -P -C
  8. KBUILD_AFLAGS += -mtext-section-literals
  9. boot-y := bootstrap.o
  10. targets += $(boot-y) boot.lds
  11. OBJS := $(addprefix $(obj)/,$(boot-y))
  12. $(obj)/Image.o: $(obj)/../vmlinux.bin $(OBJS)
  13. $(Q)$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
  14. --add-section image=$< \
  15. --set-section-flags image=contents,alloc,load,load,data \
  16. $(OBJS) $@
  17. $(obj)/../Image.elf: $(obj)/Image.o $(obj)/boot.lds
  18. $(Q)$(LD) $(KBUILD_LDFLAGS) \
  19. -T $(obj)/boot.lds \
  20. --build-id=none \
  21. -o $@ $(obj)/Image.o
  22. $(Q)$(kecho) ' Kernel: $@ is ready'
  23. all Image: $(obj)/../Image.elf