aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/compressed/Makefile
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2008-01-30 07:32:30 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:32:30 -0500
commitdb569afa4e69ceaf89b3723a8f9cd2846ed09c76 (patch)
treef426a113fc60438858df429b05545d900450259b /arch/x86/boot/compressed/Makefile
parent6b0c3d44d33e9429dbc568dc7fd3aee3774c5707 (diff)
x86: unify arch/x86/boot/compressed/Makefile(s)
Trivial unification of the two Makefiles. Tested doing a defconfig build for both 32 and 64 bit and no build changes occured. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/boot/compressed/Makefile')
-rw-r--r--arch/x86/boot/compressed/Makefile62
1 files changed, 60 insertions, 2 deletions
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 52c1db854520..d6ae347d11f1 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -1,5 +1,63 @@
1#
2# linux/arch/x86/boot/compressed/Makefile
3#
4# create a compressed vmlinux image from the original vmlinux
5#
6
7targets := vmlinux vmlinux.bin vmlinux.bin.gz head_$(BITS).o misc_$(BITS).o piggy.o
8
9KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2
10KBUILD_CFLAGS += -fno-strict-aliasing -fPIC
11cflags-$(CONFIG_X86_64) := -mcmodel=small
12KBUILD_CFLAGS += $(cflags-y)
13KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
14KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
15
16KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
17
18LDFLAGS := -m elf_$(UTS_MACHINE)
19LDFLAGS_vmlinux := -T
20
21$(obj)/vmlinux: $(src)/vmlinux_$(BITS).lds $(obj)/head_$(BITS).o $(obj)/misc_$(BITS).o $(obj)/piggy.o FORCE
22 $(call if_changed,ld)
23 @:
24
25$(obj)/vmlinux.bin: vmlinux FORCE
26 $(call if_changed,objcopy)
27
28
1ifeq ($(CONFIG_X86_32),y) 29ifeq ($(CONFIG_X86_32),y)
2include ${srctree}/arch/x86/boot/compressed/Makefile_32 30targets += vmlinux.bin.all vmlinux.relocs
31hostprogs-y := relocs
32
33quiet_cmd_relocs = RELOCS $@
34 cmd_relocs = $(obj)/relocs $< > $@;$(obj)/relocs --abs-relocs $<
35$(obj)/vmlinux.relocs: vmlinux $(obj)/relocs FORCE
36 $(call if_changed,relocs)
37
38vmlinux.bin.all-y := $(obj)/vmlinux.bin
39vmlinux.bin.all-$(CONFIG_RELOCATABLE) += $(obj)/vmlinux.relocs
40quiet_cmd_relocbin = BUILD $@
41 cmd_relocbin = cat $(filter-out FORCE,$^) > $@
42$(obj)/vmlinux.bin.all: $(vmlinux.bin.all-y) FORCE
43 $(call if_changed,relocbin)
44
45ifdef CONFIG_RELOCATABLE
46$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE
47 $(call if_changed,gzip)
3else 48else
4include ${srctree}/arch/x86/boot/compressed/Makefile_64 49$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
50 $(call if_changed,gzip)
5endif 51endif
52LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
53
54else
55$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
56 $(call if_changed,gzip)
57
58LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T
59endif
60
61
62$(obj)/piggy.o: $(obj)/vmlinux_$(BITS).scr $(obj)/vmlinux.bin.gz FORCE
63 $(call if_changed,ld)