Makefile 1.4 KB

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