2 # linux/arch/s390/boot/compressed/Makefile
4 # create a compressed vmlinux image from the original vmlinux
7 BITS
:= $(if
$(CONFIG_64BIT
),64,31)
9 targets
:= vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \
10 vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo misc.o piggy.o \
13 KBUILD_CFLAGS
:= -m
$(BITS
) -D__KERNEL__
$(LINUX_INCLUDE
) -O2
14 KBUILD_CFLAGS
+= -DDISABLE_BRANCH_PROFILING
15 KBUILD_CFLAGS
+= $(cflags-y
)
16 KBUILD_CFLAGS
+= $(call cc-option
,-mpacked-stack
)
17 KBUILD_CFLAGS
+= $(call cc-option
,-ffreestanding
)
21 OBJECTS
:= $(addprefix $(objtree
)/arch
/s390
/kernel
/, head.o sclp.o ebcdic.o
)
22 OBJECTS
+= $(obj
)/head
$(BITS
).o
$(obj
)/misc.o
$(obj
)/piggy.o
24 LDFLAGS_vmlinux
:= --oformat
$(LD_BFD
) -e startup
-T
25 $(obj
)/vmlinux
: $(obj
)/vmlinux.lds
$(OBJECTS
)
29 sed-sizes
:= -e
's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\)$$/\#define SZ\2 0x\1/p'
31 quiet_cmd_sizes
= GEN
$@
32 cmd_sizes
= $(NM
) $< | sed
-n
$(sed-sizes
) > $@
34 $(obj
)/sizes.h
: vmlinux
35 $(call if_changed
,sizes
)
37 AFLAGS_head
$(BITS
).o
+= -I
$(obj
)
38 $(obj
)/head
$(BITS
).o
: $(obj
)/sizes.h
40 CFLAGS_misc.o
+= -I
$(obj
)
41 $(obj
)/misc.o
: $(obj
)/sizes.h
43 OBJCOPYFLAGS_vmlinux.bin
:= -R .comment
-S
44 $(obj
)/vmlinux.bin
: vmlinux
45 $(call if_changed
,objcopy
)
47 vmlinux.bin.all-y
:= $(obj
)/vmlinux.bin
49 suffix-
$(CONFIG_KERNEL_GZIP
) := gz
50 suffix-
$(CONFIG_KERNEL_BZIP2
) := bz2
51 suffix-
$(CONFIG_KERNEL_LZMA
) := lzma
52 suffix-
$(CONFIG_KERNEL_LZO
) := lzo
53 suffix-
$(CONFIG_KERNEL_XZ
) := xz
55 $(obj
)/vmlinux.bin.gz
: $(vmlinux.bin.all-y
)
56 $(call if_changed
,gzip
)
57 $(obj
)/vmlinux.bin.bz2
: $(vmlinux.bin.all-y
)
58 $(call if_changed
,bzip2
)
59 $(obj
)/vmlinux.bin.lzma
: $(vmlinux.bin.all-y
)
60 $(call if_changed
,lzma
)
61 $(obj
)/vmlinux.bin.lzo
: $(vmlinux.bin.all-y
)
62 $(call if_changed
,lzo
)
63 $(obj
)/vmlinux.bin.xz
: $(vmlinux.bin.all-y
)
64 $(call if_changed
,xzkern
)
66 LDFLAGS_piggy.o
:= -r
--format binary
--oformat
$(LD_BFD
) -T
67 $(obj
)/piggy.o
: $(obj
)/vmlinux.scr
$(obj
)/vmlinux.bin.
$(suffix-y
)