2 # linux/arch/s390/boot/compressed/Makefile
4 # create a compressed vmlinux image from the original vmlinux
7 targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2
8 targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4
9 targets += misc.o piggy.o sizes.h head.o
11 KBUILD_CFLAGS := -m64 -D__KERNEL__ $(LINUX_INCLUDE) -O2
12 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
13 KBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks -msoft-float
14 KBUILD_CFLAGS += $(call cc-option,-mpacked-stack)
15 KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
19 OBJECTS := $(addprefix $(objtree)/arch/s390/kernel/, head.o sclp.o ebcdic.o)
20 OBJECTS += $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o
22 LDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T
23 $(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS)
27 sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\)$$/\#define SZ\2 0x\1/p'
29 quiet_cmd_sizes = GEN $@
30 cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@
32 $(obj)/sizes.h: vmlinux
33 $(call if_changed,sizes)
35 AFLAGS_head.o += -I$(obj)
36 $(obj)/head.o: $(obj)/sizes.h
38 CFLAGS_misc.o += -I$(obj)
39 $(obj)/misc.o: $(obj)/sizes.h
41 OBJCOPYFLAGS_vmlinux.bin := -R .comment -S
42 $(obj)/vmlinux.bin: vmlinux
43 $(call if_changed,objcopy)
45 vmlinux.bin.all-y := $(obj)/vmlinux.bin
47 suffix-$(CONFIG_KERNEL_GZIP) := gz
48 suffix-$(CONFIG_KERNEL_BZIP2) := bz2
49 suffix-$(CONFIG_KERNEL_LZ4) := lz4
50 suffix-$(CONFIG_KERNEL_LZMA) := lzma
51 suffix-$(CONFIG_KERNEL_LZO) := lzo
52 suffix-$(CONFIG_KERNEL_XZ) := xz
54 $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y)
55 $(call if_changed,gzip)
56 $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y)
57 $(call if_changed,bzip2)
58 $(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y)
59 $(call if_changed,lz4)
60 $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y)
61 $(call if_changed,lzma)
62 $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y)
63 $(call if_changed,lzo)
64 $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y)
65 $(call if_changed,xzkern)
67 LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T
68 $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y)