Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 1 | # |
| 2 | # linux/arch/s390/boot/compressed/Makefile |
| 3 | # |
| 4 | # create a compressed vmlinux image from the original vmlinux |
| 5 | # |
| 6 | |
Heiko Carstens | 8e2872c | 2013-07-18 15:18:24 +0200 | [diff] [blame] | 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 |
Heiko Carstens | 4bfc86c | 2015-02-13 13:04:39 +0100 | [diff] [blame] | 9 | targets += misc.o piggy.o sizes.h head.o |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 10 | |
Heiko Carstens | 5a79859 | 2015-02-12 13:08:27 +0100 | [diff] [blame] | 11 | KBUILD_CFLAGS := -m64 -D__KERNEL__ $(LINUX_INCLUDE) -O2 |
Heiko Carstens | 1a0f248 | 2012-09-14 13:22:48 +0200 | [diff] [blame] | 12 | KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING |
Christian Borntraeger | adc0b7f | 2015-09-28 22:47:42 +0200 | [diff] [blame] | 13 | KBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks -msoft-float |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 14 | KBUILD_CFLAGS += $(call cc-option,-mpacked-stack) |
| 15 | KBUILD_CFLAGS += $(call cc-option,-ffreestanding) |
| 16 | |
| 17 | GCOV_PROFILE := n |
| 18 | |
| 19 | OBJECTS := $(addprefix $(objtree)/arch/s390/kernel/, head.o sclp.o ebcdic.o) |
Heiko Carstens | 4bfc86c | 2015-02-13 13:04:39 +0100 | [diff] [blame] | 20 | OBJECTS += $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 21 | |
| 22 | LDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T |
| 23 | $(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) |
| 24 | $(call if_changed,ld) |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 25 | |
| 26 | sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\)$$/\#define SZ\2 0x\1/p' |
| 27 | |
| 28 | quiet_cmd_sizes = GEN $@ |
| 29 | cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@ |
| 30 | |
| 31 | $(obj)/sizes.h: vmlinux |
| 32 | $(call if_changed,sizes) |
| 33 | |
Heiko Carstens | 4bfc86c | 2015-02-13 13:04:39 +0100 | [diff] [blame] | 34 | AFLAGS_head.o += -I$(obj) |
| 35 | $(obj)/head.o: $(obj)/sizes.h |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 36 | |
| 37 | CFLAGS_misc.o += -I$(obj) |
| 38 | $(obj)/misc.o: $(obj)/sizes.h |
| 39 | |
| 40 | OBJCOPYFLAGS_vmlinux.bin := -R .comment -S |
| 41 | $(obj)/vmlinux.bin: vmlinux |
| 42 | $(call if_changed,objcopy) |
| 43 | |
| 44 | vmlinux.bin.all-y := $(obj)/vmlinux.bin |
| 45 | |
| 46 | suffix-$(CONFIG_KERNEL_GZIP) := gz |
| 47 | suffix-$(CONFIG_KERNEL_BZIP2) := bz2 |
Heiko Carstens | 8e2872c | 2013-07-18 15:18:24 +0200 | [diff] [blame] | 48 | suffix-$(CONFIG_KERNEL_LZ4) := lz4 |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 49 | suffix-$(CONFIG_KERNEL_LZMA) := lzma |
Heiko Carstens | cdf5664 | 2010-05-26 23:27:12 +0200 | [diff] [blame] | 50 | suffix-$(CONFIG_KERNEL_LZO) := lzo |
Heiko Carstens | d7b081a | 2011-03-15 17:08:32 +0100 | [diff] [blame] | 51 | suffix-$(CONFIG_KERNEL_XZ) := xz |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 52 | |
| 53 | $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) |
| 54 | $(call if_changed,gzip) |
| 55 | $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) |
| 56 | $(call if_changed,bzip2) |
Heiko Carstens | 8e2872c | 2013-07-18 15:18:24 +0200 | [diff] [blame] | 57 | $(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) |
| 58 | $(call if_changed,lz4) |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 59 | $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) |
| 60 | $(call if_changed,lzma) |
Heiko Carstens | cdf5664 | 2010-05-26 23:27:12 +0200 | [diff] [blame] | 61 | $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) |
| 62 | $(call if_changed,lzo) |
Heiko Carstens | d7b081a | 2011-03-15 17:08:32 +0100 | [diff] [blame] | 63 | $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) |
| 64 | $(call if_changed,xzkern) |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 65 | |
| 66 | LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T |
| 67 | $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) |
| 68 | $(call if_changed,ld) |