Merge branch 'kvm-updates/2.6.39' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[pandora-kernel.git] / arch / s390 / boot / compressed / Makefile
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.xz vmlinux.bin.lzma vmlinux.bin.lzo misc.o piggy.o \
11            sizes.h head$(BITS).o
12
13 KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
14 KBUILD_CFLAGS += $(cflags-y)
15 KBUILD_CFLAGS += $(call cc-option,-mpacked-stack)
16 KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
17
18 GCOV_PROFILE := n
19
20 OBJECTS := $(addprefix $(objtree)/arch/s390/kernel/, head.o sclp.o ebcdic.o)
21 OBJECTS += $(obj)/head$(BITS).o $(obj)/misc.o $(obj)/piggy.o
22
23 LDFLAGS_vmlinux := --oformat $(LD_BFD) -e startup -T
24 $(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS)
25         $(call if_changed,ld)
26         @:
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
36 AFLAGS_head$(BITS).o += -I$(obj)
37 $(obj)/head$(BITS).o: $(obj)/sizes.h
38
39 CFLAGS_misc.o += -I$(obj)
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
50 suffix-$(CONFIG_KERNEL_LZMA)  := lzma
51 suffix-$(CONFIG_KERNEL_LZO)  := lzo
52 suffix-$(CONFIG_KERNEL_XZ)  := xz
53
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.lzma: $(vmlinux.bin.all-y)
59         $(call if_changed,lzma)
60 $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y)
61         $(call if_changed,lzo)
62 $(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y)
63         $(call if_changed,xzkern)
64
65 LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T
66 $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y)
67         $(call if_changed,ld)