18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci#
38c2ecf20Sopenharmony_ci# linux/arch/s390/boot/compressed/Makefile
48c2ecf20Sopenharmony_ci#
58c2ecf20Sopenharmony_ci# create a compressed vmlinux image from the original vmlinux
68c2ecf20Sopenharmony_ci#
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ciKCOV_INSTRUMENT := n
98c2ecf20Sopenharmony_ciGCOV_PROFILE := n
108c2ecf20Sopenharmony_ciUBSAN_SANITIZE := n
118c2ecf20Sopenharmony_ciKASAN_SANITIZE := n
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ciobj-y	:= $(if $(CONFIG_KERNEL_UNCOMPRESSED),,decompressor.o) piggy.o info.o
148c2ecf20Sopenharmony_citargets	:= vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
158c2ecf20Sopenharmony_citargets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
168c2ecf20Sopenharmony_citargets += info.bin $(obj-y)
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ciKBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR)
198c2ecf20Sopenharmony_ciKBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR)
208c2ecf20Sopenharmony_ciOBJCOPYFLAGS :=
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ciOBJECTS := $(addprefix $(obj)/,$(obj-y))
238c2ecf20Sopenharmony_ci
248c2ecf20Sopenharmony_ciLDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T
258c2ecf20Sopenharmony_ci$(obj)/vmlinux: $(obj)/vmlinux.lds $(objtree)/arch/s390/boot/startup.a $(OBJECTS) FORCE
268c2ecf20Sopenharmony_ci	$(call if_changed,ld)
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ciOBJCOPYFLAGS_info.bin := -O binary --only-section=.vmlinux.info --set-section-flags .vmlinux.info=load
298c2ecf20Sopenharmony_ci$(obj)/info.bin: vmlinux FORCE
308c2ecf20Sopenharmony_ci	$(call if_changed,objcopy)
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ciOBJCOPYFLAGS_info.o := -I binary -O elf64-s390 -B s390:64-bit --rename-section .data=.vmlinux.info
338c2ecf20Sopenharmony_ci$(obj)/info.o: $(obj)/info.bin FORCE
348c2ecf20Sopenharmony_ci	$(call if_changed,objcopy)
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ciOBJCOPYFLAGS_vmlinux.bin := -O binary --remove-section=.comment --remove-section=.vmlinux.info -S
378c2ecf20Sopenharmony_ci$(obj)/vmlinux.bin: vmlinux FORCE
388c2ecf20Sopenharmony_ci	$(call if_changed,objcopy)
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_civmlinux.bin.all-y := $(obj)/vmlinux.bin
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_cisuffix-$(CONFIG_KERNEL_GZIP)  := .gz
438c2ecf20Sopenharmony_cisuffix-$(CONFIG_KERNEL_BZIP2) := .bz2
448c2ecf20Sopenharmony_cisuffix-$(CONFIG_KERNEL_LZ4)  := .lz4
458c2ecf20Sopenharmony_cisuffix-$(CONFIG_KERNEL_LZMA)  := .lzma
468c2ecf20Sopenharmony_cisuffix-$(CONFIG_KERNEL_LZO)  := .lzo
478c2ecf20Sopenharmony_cisuffix-$(CONFIG_KERNEL_XZ)  := .xz
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
508c2ecf20Sopenharmony_ci	$(call if_changed,gzip)
518c2ecf20Sopenharmony_ci$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
528c2ecf20Sopenharmony_ci	$(call if_changed,bzip2)
538c2ecf20Sopenharmony_ci$(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE
548c2ecf20Sopenharmony_ci	$(call if_changed,lz4)
558c2ecf20Sopenharmony_ci$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
568c2ecf20Sopenharmony_ci	$(call if_changed,lzma)
578c2ecf20Sopenharmony_ci$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE
588c2ecf20Sopenharmony_ci	$(call if_changed,lzo)
598c2ecf20Sopenharmony_ci$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE
608c2ecf20Sopenharmony_ci	$(call if_changed,xzkern)
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ciOBJCOPYFLAGS_piggy.o := -I binary -O elf64-s390 -B s390:64-bit --rename-section .data=.vmlinux.bin.compressed
638c2ecf20Sopenharmony_ci$(obj)/piggy.o: $(obj)/vmlinux.bin$(suffix-y) FORCE
648c2ecf20Sopenharmony_ci	$(call if_changed,objcopy)
65