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