diff options
author | H. Peter Anvin <hpa@zytor.com> | 2009-05-06 01:53:11 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-05-08 20:16:22 -0400 |
commit | 5f11e02019ef44f041e6e38a1363fa2fd4b8785d (patch) | |
tree | f5342da5ac98e9bbc85ba1c44beebc987a98142d | |
parent | 845adf7266a7ba6970bf982ffd96abc60d2018ab (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>
-rw-r--r-- | arch/x86/boot/compressed/Makefile | 39 |
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 | ||
31 | targets += vmlinux.bin.all vmlinux.relocs relocs | 31 | targets += vmlinux.bin.all vmlinux.relocs relocs |
32 | hostprogs-$(CONFIG_X86_32) += relocs | 32 | hostprogs-$(CONFIG_X86_NEED_RELOCS) += relocs |
33 | 33 | ||
34 | quiet_cmd_relocs = RELOCS $@ | 34 | quiet_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 | ||
39 | vmlinux.bin.all-y := $(obj)/vmlinux.bin | 39 | vmlinux.bin.all-y := $(obj)/vmlinux.bin |
40 | vmlinux.bin.all-$(CONFIG_RELOCATABLE) += $(obj)/vmlinux.relocs | 40 | vmlinux.bin.all-$(CONFIG_X86_NEED_RELOCS) += $(obj)/vmlinux.relocs |
41 | quiet_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 | ||
46 | ifeq ($(CONFIG_X86_32),y) | 42 | $(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE |
47 | |||
48 | ifdef 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) | ||
55 | else | ||
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) | ||
62 | endif | ||
63 | LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T | ||
64 | |||
65 | else | ||
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 | ||
74 | LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T | ||
75 | endif | ||
76 | |||
77 | suffix_$(CONFIG_KERNEL_GZIP) = gz | 49 | suffix_$(CONFIG_KERNEL_GZIP) = gz |
78 | suffix_$(CONFIG_KERNEL_BZIP2) = bz2 | 50 | suffix_$(CONFIG_KERNEL_BZIP2) = bz2 |
79 | suffix_$(CONFIG_KERNEL_LZMA) = lzma | 51 | suffix_$(CONFIG_KERNEL_LZMA) = lzma |
80 | 52 | ||
53 | LDFLAGS_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) |