Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. boot-y := bootstrap.o
  15. OBJS := $(addprefix $(obj)/,$(boot-y))
  16. Image: vmlinux $(OBJS)
  17. $(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \
  18. vmlinux vmlinux.tmp
  19. $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
  20. --add-section image=vmlinux.tmp \
  21. --set-section-flags image=contents,alloc,load,load,data \
  22. $(OBJS) $@.tmp
  23. $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
  24. -T $(srctree)/arch/$(ARCH)/boot/boot-elf/boot.ld \
  25. -o arch/$(ARCH)/boot/$@.elf $@.tmp
  26. rm -f $@.tmp vmlinux.tmp
  27. Image.initrd: vmlinux $(OBJS)
  28. $(OBJCOPY) --strip-all -R .comment -R .xt.insn -O binary \
  29. --add-section .initrd=arch/$(ARCH)/boot/ramdisk \
  30. --set-section-flags .initrd=contents,alloc,load,load,data \
  31. vmlinux vmlinux.tmp
  32. $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
  33. --add-section image=vmlinux.tmp \
  34. --set-section-flags image=contents,alloc,load,load,data \
  35. $(OBJS) $@.tmp
  36. $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
  37. -T $(srctree)/arch/$(ARCH)/boot/boot-elf/boot.ld \
  38. -o arch/$(ARCH)/boot/$@.elf $@.tmp
  39. rm -f $@.tmp vmlinux.tmp
  40. zImage: Image
  41. zImage.initrd: Image.initrd