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
16 KBUILD_CFLAGS
+= $(cflags-y
) -fno-delete-null-pointer-checks
-msoft-float
17 KBUILD_CFLAGS
+= $(call cc-option
,-mpacked-stack
)
18 KBUILD_CFLAGS
+= $(call cc-option
,-ffreestanding
)
23 OBJECTS
:= $(addprefix $(objtree
)/arch
/s390
/kernel
/, head.o ebcdic.o als.o
)
24 OBJECTS
+= $(objtree
)/drivers
/s390
/char
/sclp_early_core.o
25 OBJECTS
+= $(obj
)/head.o
$(obj
)/misc.o
$(obj
)/piggy.o
27 LDFLAGS_vmlinux
:= --oformat
$(LD_BFD
) -e startup
-T
28 $(obj
)/vmlinux
: $(obj
)/vmlinux.lds
$(OBJECTS
)
31 sed-sizes
:= -e
's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\)$$/\#define SZ\2 0x\1/p'
33 quiet_cmd_sizes
= GEN
$@
34 cmd_sizes
= $(NM
) $< | sed
-n
$(sed-sizes
) > $@
36 $(obj
)/sizes.h
: vmlinux
37 $(call if_changed
,sizes
)
39 AFLAGS_head.o
+= -I
$(objtree
)/$(obj
)
40 $(obj
)/head.o
: $(obj
)/sizes.h
42 CFLAGS_misc.o
+= -I
$(objtree
)/$(obj
)
43 $(obj
)/misc.o
: $(obj
)/sizes.h
45 OBJCOPYFLAGS_vmlinux.bin
:= -R .comment
-S
46 $(obj
)/vmlinux.bin
: vmlinux
47 $(call if_changed
,objcopy
)
49 vmlinux.bin.all-y
:= $(obj
)/vmlinux.bin
51 suffix-
$(CONFIG_KERNEL_GZIP
) := gz
52 suffix-
$(CONFIG_KERNEL_BZIP2
) := bz2
53 suffix-
$(CONFIG_KERNEL_LZ4
) := lz4
54 suffix-
$(CONFIG_KERNEL_LZMA
) := lzma
55 suffix-
$(CONFIG_KERNEL_LZO
) := lzo
56 suffix-
$(CONFIG_KERNEL_XZ
) := xz
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
)
71 LDFLAGS_piggy.o
:= -r
--format binary
--oformat
$(LD_BFD
) -T
72 $(obj
)/piggy.o
: $(obj
)/vmlinux.scr
$(obj
)/vmlinux.bin.
$(suffix-y
)