Makefile_64 886 B

123456789101112131415161718192021222324252627282930
  1. #
  2. # linux/arch/x86/boot/compressed/Makefile
  3. #
  4. # create a compressed vmlinux image from the original vmlinux
  5. #
  6. targets := vmlinux vmlinux.bin vmlinux.bin.gz head_64.o misc_64.o piggy.o
  7. KBUILD_CFLAGS := -m64 -D__KERNEL__ $(LINUXINCLUDE) -O2 \
  8. -fno-strict-aliasing -fPIC -mcmodel=small \
  9. $(call cc-option, -ffreestanding) \
  10. $(call cc-option, -fno-stack-protector)
  11. KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
  12. LDFLAGS := -m elf_x86_64
  13. LDFLAGS_vmlinux := -T
  14. $(obj)/vmlinux: $(src)/vmlinux_64.lds $(obj)/head_64.o $(obj)/misc_64.o $(obj)/piggy.o FORCE
  15. $(call if_changed,ld)
  16. @:
  17. $(obj)/vmlinux.bin: vmlinux FORCE
  18. $(call if_changed,objcopy)
  19. $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
  20. $(call if_changed,gzip)
  21. LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T
  22. $(obj)/piggy.o: $(obj)/vmlinux_64.scr $(obj)/vmlinux.bin.gz FORCE
  23. $(call if_changed,ld)