Commit | Line | Data |
---|---|---|
1844c9bc MS |
1 | # |
2 | # linux/arch/s390/boot/compressed/Makefile | |
3 | # | |
4 | # create a compressed vmlinux image from the original vmlinux | |
5 | # | |
6 | ||
907fa061 HC |
7 | KCOV_INSTRUMENT := n |
8 | ||
8e2872ce HC |
9 | targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 |
10 | targets += vmlinux.bin.xz vmlinux.bin.lzma vmlinux.bin.lzo vmlinux.bin.lz4 | |
4bfc86ce | 11 | targets += misc.o piggy.o sizes.h head.o |
1844c9bc | 12 | |
5a79859a | 13 | KBUILD_CFLAGS := -m64 -D__KERNEL__ $(LINUX_INCLUDE) -O2 |
1a0f2487 | 14 | KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING |
adc0b7fb | 15 | KBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks -msoft-float |
1844c9bc MS |
16 | KBUILD_CFLAGS += $(call cc-option,-mpacked-stack) |
17 | KBUILD_CFLAGS += $(call cc-option,-ffreestanding) | |
18 | ||
19 | GCOV_PROFILE := n | |
20 | ||
be2412c2 | 21 | OBJECTS := $(addprefix $(objtree)/arch/s390/kernel/, head.o sclp.o ebcdic.o als.o) |
4bfc86ce | 22 | OBJECTS += $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o |
1844c9bc MS |
23 | |
24 | LDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T | |
25 | $(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) | |
26 | $(call if_changed,ld) | |
1844c9bc MS |
27 | |
28 | sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\)$$/\#define SZ\2 0x\1/p' | |
29 | ||
30 | quiet_cmd_sizes = GEN $@ | |
31 | cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@ | |
32 | ||
33 | $(obj)/sizes.h: vmlinux | |
34 | $(call if_changed,sizes) | |
35 | ||
58ab5e0c | 36 | AFLAGS_head.o += -I$(objtree)/$(obj) |
4bfc86ce | 37 | $(obj)/head.o: $(obj)/sizes.h |
1844c9bc | 38 | |
58ab5e0c | 39 | CFLAGS_misc.o += -I$(objtree)/$(obj) |
1844c9bc MS |
40 | $(obj)/misc.o: $(obj)/sizes.h |
41 | ||
42 | OBJCOPYFLAGS_vmlinux.bin := -R .comment -S | |
43 | $(obj)/vmlinux.bin: vmlinux | |
44 | $(call if_changed,objcopy) | |
45 | ||
46 | vmlinux.bin.all-y := $(obj)/vmlinux.bin | |
47 | ||
48 | suffix-$(CONFIG_KERNEL_GZIP) := gz | |
49 | suffix-$(CONFIG_KERNEL_BZIP2) := bz2 | |
8e2872ce | 50 | suffix-$(CONFIG_KERNEL_LZ4) := lz4 |
1844c9bc | 51 | suffix-$(CONFIG_KERNEL_LZMA) := lzma |
cdf56649 | 52 | suffix-$(CONFIG_KERNEL_LZO) := lzo |
d7b081ac | 53 | suffix-$(CONFIG_KERNEL_XZ) := xz |
1844c9bc MS |
54 | |
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) | |
8e2872ce HC |
59 | $(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) |
60 | $(call if_changed,lz4) | |
1844c9bc MS |
61 | $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) |
62 | $(call if_changed,lzma) | |
cdf56649 HC |
63 | $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) |
64 | $(call if_changed,lzo) | |
d7b081ac HC |
65 | $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) |
66 | $(call if_changed,xzkern) | |
1844c9bc MS |
67 | |
68 | LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T | |
69 | $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) | |
70 | $(call if_changed,ld) |