Makefile 891 B

12345678910111213141516171819202122232425262728293031323334353637
  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. GZIP = gzip
  7. GZIP_FLAGS = -v9fc
  8. ifeq ($(BIG_ENDIAN),1)
  9. OBJCOPY_ARGS := -O elf32-xtensa-be
  10. else
  11. OBJCOPY_ARGS := -O elf32-xtensa-le
  12. endif
  13. export OBJCOPY_ARGS
  14. export CPPFLAGS_boot.lds += -P -C
  15. boot-y := bootstrap.o
  16. OBJS := $(addprefix $(obj)/,$(boot-y))
  17. vmlinux.tmp: vmlinux
  18. $(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \
  19. $^ $@
  20. Image: vmlinux.tmp $(OBJS) arch/$(ARCH)/boot/boot-elf/boot.lds
  21. $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
  22. --add-section image=vmlinux.tmp \
  23. --set-section-flags image=contents,alloc,load,load,data \
  24. $(OBJS) $@.tmp
  25. $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
  26. -T arch/$(ARCH)/boot/boot-elf/boot.lds \
  27. -o arch/$(ARCH)/boot/$@.elf $@.tmp
  28. zImage: Image