Makefile 2.1 KB

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