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