aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/compressed/Makefile
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-06 01:53:11 -0400
committerH. Peter Anvin <hpa@zytor.com>2009-05-08 20:16:22 -0400
commit5f11e02019ef44f041e6e38a1363fa2fd4b8785d (patch)
treef5342da5ac98e9bbc85ba1c44beebc987a98142d /arch/x86/boot/compressed/Makefile
parent845adf7266a7ba6970bf982ffd96abc60d2018ab (diff)
x86, boot: simplify arch/x86/boot/compressed/Makefile
Simplify the arch/x86/boot/compressed/Makefile, by using the new capability of specifying multiple inputs to a compressor, and the CONFIG_X86_NEED_RELOCS Kconfig symbol. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Acked-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'arch/x86/boot/compressed/Makefile')
-rw-r--r--arch/x86/boot/compressed/Makefile39
1 files changed, 6 insertions, 33 deletions
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 0f4b5e2abd3f..b35c3bb70907 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -29,7 +29,7 @@ $(obj)/vmlinux.bin: vmlinux FORCE
29 29
30 30
31targets += vmlinux.bin.all vmlinux.relocs relocs 31targets += vmlinux.bin.all vmlinux.relocs relocs
32hostprogs-$(CONFIG_X86_32) += relocs 32hostprogs-$(CONFIG_X86_NEED_RELOCS) += relocs
33 33
34quiet_cmd_relocs = RELOCS $@ 34quiet_cmd_relocs = RELOCS $@
35 cmd_relocs = $(obj)/relocs $< > $@;$(obj)/relocs --abs-relocs $< 35 cmd_relocs = $(obj)/relocs $< > $@;$(obj)/relocs --abs-relocs $<
@@ -37,46 +37,19 @@ $(obj)/vmlinux.relocs: vmlinux $(obj)/relocs FORCE
37 $(call if_changed,relocs) 37 $(call if_changed,relocs)
38 38
39vmlinux.bin.all-y := $(obj)/vmlinux.bin 39vmlinux.bin.all-y := $(obj)/vmlinux.bin
40vmlinux.bin.all-$(CONFIG_RELOCATABLE) += $(obj)/vmlinux.relocs 40vmlinux.bin.all-$(CONFIG_X86_NEED_RELOCS) += $(obj)/vmlinux.relocs
41quiet_cmd_relocbin = BUILD $@
42 cmd_relocbin = cat $(filter-out FORCE,$^) > $@
43$(obj)/vmlinux.bin.all: $(vmlinux.bin.all-y) FORCE
44 $(call if_changed,relocbin)
45 41
46ifeq ($(CONFIG_X86_32),y) 42$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
47
48ifdef CONFIG_RELOCATABLE
49$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE
50 $(call if_changed,gzip)
51$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin.all FORCE
52 $(call if_changed,bzip2)
53$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin.all FORCE
54 $(call if_changed,lzma)
55else
56$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
57 $(call if_changed,gzip)
58$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
59 $(call if_changed,bzip2)
60$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
61 $(call if_changed,lzma)
62endif
63LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
64
65else
66
67$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
68 $(call if_changed,gzip) 43 $(call if_changed,gzip)
69$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE 44$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
70 $(call if_changed,bzip2) 45 $(call if_changed,bzip2)
71$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE 46$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
72 $(call if_changed,lzma) 47 $(call if_changed,lzma)
73 48
74LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T
75endif
76
77suffix_$(CONFIG_KERNEL_GZIP) = gz 49suffix_$(CONFIG_KERNEL_GZIP) = gz
78suffix_$(CONFIG_KERNEL_BZIP2) = bz2 50suffix_$(CONFIG_KERNEL_BZIP2) = bz2
79suffix_$(CONFIG_KERNEL_LZMA) = lzma 51suffix_$(CONFIG_KERNEL_LZMA) = lzma
80 52
53LDFLAGS_piggy.o := -r --format binary --oformat $(CONFIG_OUTPUT_FORMAT) -T
81$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix_y) FORCE 54$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix_y) FORCE
82 $(call if_changed,ld) 55 $(call if_changed,ld)