Makefile 1014 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. 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. LD_ARGS = -T $(srctree)/$(obj)/boot.ld
  14. boot-y := bootstrap.o
  15. OBJS := $(addprefix $(obj)/,$(boot-y))
  16. LIBS := arch/xtensa/boot/lib/lib.a arch/xtensa/lib/lib.a
  17. LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
  18. zImage: vmlinux $(OBJS) $(LIBS)
  19. $(OBJCOPY) --strip-all -R .comment -R .note.gnu.build-id -O binary \
  20. vmlinux vmlinux.tmp
  21. gzip -vf9 vmlinux.tmp
  22. $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
  23. --add-section image=vmlinux.tmp.gz \
  24. --set-section-flags image=contents,alloc,load,load,data \
  25. $(OBJS) $@.tmp
  26. $(LD) $(LD_ARGS) -o $@.elf $@.tmp $(LIBS) -L/xtensa-elf/lib $(LIBGCC)
  27. $(OBJCOPY) -S -O binary $@.elf arch/$(ARCH)/boot/$@.redboot
  28. rm -f $@.tmp $@.elf vmlinux.tmp.gz