diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2010-02-26 16:37:53 -0500 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-02-26 16:37:33 -0500 |
commit | 1844c9bc0b2fed3023551c1affe033ab38e90b9a (patch) | |
tree | b9aca066ec58a0b211a4931032b74093fdb6ff49 /arch/s390/boot/compressed/Makefile | |
parent | 73bfa5f2f71efcdcaad8d18cbed96b9d7ed86948 (diff) |
[S390] add support for compressed kernels
Add the "bzImage" compile target and the necessary code to generate
compressed kernel images. The old style uncompressed "image" target
is preserved, a simple make will build them both.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/boot/compressed/Makefile')
-rw-r--r-- | arch/s390/boot/compressed/Makefile | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/arch/s390/boot/compressed/Makefile b/arch/s390/boot/compressed/Makefile new file mode 100644 index 000000000000..6e4a67ad07e1 --- /dev/null +++ b/arch/s390/boot/compressed/Makefile | |||
@@ -0,0 +1,60 @@ | |||
1 | # | ||
2 | # linux/arch/s390/boot/compressed/Makefile | ||
3 | # | ||
4 | # create a compressed vmlinux image from the original vmlinux | ||
5 | # | ||
6 | |||
7 | BITS := $(if $(CONFIG_64BIT),64,31) | ||
8 | |||
9 | targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 \ | ||
10 | vmlinux.bin.lzma misc.o piggy.o sizes.h head$(BITS).o | ||
11 | |||
12 | KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 | ||
13 | KBUILD_CFLAGS += $(cflags-y) | ||
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) | ||
20 | OBJECTS += $(obj)/head$(BITS).o $(obj)/misc.o $(obj)/piggy.o | ||
21 | |||
22 | LDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T | ||
23 | $(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) | ||
24 | $(call if_changed,ld) | ||
25 | @: | ||
26 | |||
27 | sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\)$$/\#define SZ\2 0x\1/p' | ||
28 | |||
29 | quiet_cmd_sizes = GEN $@ | ||
30 | cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@ | ||
31 | |||
32 | $(obj)/sizes.h: vmlinux | ||
33 | $(call if_changed,sizes) | ||
34 | |||
35 | AFLAGS_head$(BITS).o += -I$(obj) | ||
36 | $(obj)/head$(BITS).o: $(obj)/sizes.h | ||
37 | |||
38 | CFLAGS_misc.o += -I$(obj) | ||
39 | $(obj)/misc.o: $(obj)/sizes.h | ||
40 | |||
41 | OBJCOPYFLAGS_vmlinux.bin := -R .comment -S | ||
42 | $(obj)/vmlinux.bin: vmlinux | ||
43 | $(call if_changed,objcopy) | ||
44 | |||
45 | vmlinux.bin.all-y := $(obj)/vmlinux.bin | ||
46 | |||
47 | suffix-$(CONFIG_KERNEL_GZIP) := gz | ||
48 | suffix-$(CONFIG_KERNEL_BZIP2) := bz2 | ||
49 | suffix-$(CONFIG_KERNEL_LZMA) := lzma | ||
50 | |||
51 | $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) | ||
52 | $(call if_changed,gzip) | ||
53 | $(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) | ||
54 | $(call if_changed,bzip2) | ||
55 | $(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) | ||
56 | $(call if_changed,lzma) | ||
57 | |||
58 | LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T | ||
59 | $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) | ||
60 | $(call if_changed,ld) | ||