Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #
  2. # linux/arch/s390/boot/compressed/Makefile
  3. #
  4. # create a compressed vmlinux image from the original vmlinux
  5. #
  6. targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
  7. targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
  8. targets += misc.o piggy.o sizes.h head.o
  9. KBUILD_CFLAGS := -m64 -D__KERNEL__ $(LINUX_INCLUDE) -O2
  10. KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
  11. KBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks -msoft-float
  12. KBUILD_CFLAGS += $(call cc-option,-mpacked-stack)
  13. KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
  14. GCOV_PROFILE := n
  15. OBJECTS := $(addprefix $(objtree)/arch/s390/kernel/, head.o sclp.o ebcdic.o)
  16. OBJECTS += $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o
  17. LDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T
  18. $(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS)
  19. $(call if_changed,ld)
  20. @:
  21. sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\)$$/\#define SZ\2 0x\1/p'
  22. quiet_cmd_sizes = GEN $@
  23. cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@
  24. $(obj)/sizes.h: vmlinux
  25. $(call if_changed,sizes)
  26. AFLAGS_head.o += -I$(obj)
  27. $(obj)/head.o: $(obj)/sizes.h
  28. CFLAGS_misc.o += -I$(obj)
  29. $(obj)/misc.o: $(obj)/sizes.h
  30. OBJCOPYFLAGS_vmlinux.bin := -R .comment -S
  31. $(obj)/vmlinux.bin: vmlinux
  32. $(call if_changed,objcopy)
  33. vmlinux.bin.all-y := $(obj)/vmlinux.bin
  34. suffix-$(CONFIG_KERNEL_GZIP) := gz
  35. suffix-$(CONFIG_KERNEL_BZIP2) := bz2
  36. suffix-$(CONFIG_KERNEL_LZ4) := lz4
  37. suffix-$(CONFIG_KERNEL_LZMA) := lzma
  38. suffix-$(CONFIG_KERNEL_LZO) := lzo
  39. suffix-$(CONFIG_KERNEL_XZ) := xz
  40. $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y)
  41. $(call if_changed,gzip)
  42. $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y)
  43. $(call if_changed,bzip2)
  44. $(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y)
  45. $(call if_changed,lz4)
  46. $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y)
  47. $(call if_changed,lzma)
  48. $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y)
  49. $(call if_changed,lzo)
  50. $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y)
  51. $(call if_changed,xzkern)
  52. LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T
  53. $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y)
  54. $(call if_changed,ld)