diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2008-01-30 07:32:30 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:30 -0500 |
commit | db569afa4e69ceaf89b3723a8f9cd2846ed09c76 (patch) | |
tree | f426a113fc60438858df429b05545d900450259b /arch/x86 | |
parent | 6b0c3d44d33e9429dbc568dc7fd3aee3774c5707 (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')
-rw-r--r-- | arch/x86/boot/compressed/Makefile | 62 | ||||
-rw-r--r-- | arch/x86/boot/compressed/Makefile_32 | 50 | ||||
-rw-r--r-- | arch/x86/boot/compressed/Makefile_64 | 30 |
3 files changed, 60 insertions, 82 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 | |||
7 | targets := vmlinux vmlinux.bin vmlinux.bin.gz head_$(BITS).o misc_$(BITS).o piggy.o | ||
8 | |||
9 | KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2 | ||
10 | KBUILD_CFLAGS += -fno-strict-aliasing -fPIC | ||
11 | cflags-$(CONFIG_X86_64) := -mcmodel=small | ||
12 | KBUILD_CFLAGS += $(cflags-y) | ||
13 | KBUILD_CFLAGS += $(call cc-option,-ffreestanding) | ||
14 | KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector) | ||
15 | |||
16 | KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ | ||
17 | |||
18 | LDFLAGS := -m elf_$(UTS_MACHINE) | ||
19 | LDFLAGS_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 | |||
1 | ifeq ($(CONFIG_X86_32),y) | 29 | ifeq ($(CONFIG_X86_32),y) |
2 | include ${srctree}/arch/x86/boot/compressed/Makefile_32 | 30 | targets += vmlinux.bin.all vmlinux.relocs |
31 | hostprogs-y := relocs | ||
32 | |||
33 | quiet_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 | |||
38 | vmlinux.bin.all-y := $(obj)/vmlinux.bin | ||
39 | vmlinux.bin.all-$(CONFIG_RELOCATABLE) += $(obj)/vmlinux.relocs | ||
40 | quiet_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 | |||
45 | ifdef CONFIG_RELOCATABLE | ||
46 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE | ||
47 | $(call if_changed,gzip) | ||
3 | else | 48 | else |
4 | include ${srctree}/arch/x86/boot/compressed/Makefile_64 | 49 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE |
50 | $(call if_changed,gzip) | ||
5 | endif | 51 | endif |
52 | LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T | ||
53 | |||
54 | else | ||
55 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | ||
56 | $(call if_changed,gzip) | ||
57 | |||
58 | LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T | ||
59 | endif | ||
60 | |||
61 | |||
62 | $(obj)/piggy.o: $(obj)/vmlinux_$(BITS).scr $(obj)/vmlinux.bin.gz FORCE | ||
63 | $(call if_changed,ld) | ||
diff --git a/arch/x86/boot/compressed/Makefile_32 b/arch/x86/boot/compressed/Makefile_32 deleted file mode 100644 index e43ff7c56e6e..000000000000 --- a/arch/x86/boot/compressed/Makefile_32 +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | # | ||
2 | # linux/arch/x86/boot/compressed/Makefile | ||
3 | # | ||
4 | # create a compressed vmlinux image from the original vmlinux | ||
5 | # | ||
6 | |||
7 | targets := vmlinux vmlinux.bin vmlinux.bin.gz head_32.o misc_32.o piggy.o \ | ||
8 | vmlinux.bin.all vmlinux.relocs | ||
9 | EXTRA_AFLAGS := -traditional | ||
10 | |||
11 | LDFLAGS_vmlinux := -T | ||
12 | hostprogs-y := relocs | ||
13 | |||
14 | KBUILD_CFLAGS := -m32 -D__KERNEL__ $(LINUX_INCLUDE) -O2 \ | ||
15 | -fno-strict-aliasing -fPIC \ | ||
16 | $(call cc-option,-ffreestanding) \ | ||
17 | $(call cc-option,-fno-stack-protector) | ||
18 | LDFLAGS := -m elf_i386 | ||
19 | |||
20 | $(obj)/vmlinux: $(src)/vmlinux_32.lds $(obj)/head_32.o $(obj)/misc_32.o $(obj)/piggy.o FORCE | ||
21 | $(call if_changed,ld) | ||
22 | @: | ||
23 | |||
24 | $(obj)/vmlinux.bin: vmlinux FORCE | ||
25 | $(call if_changed,objcopy) | ||
26 | |||
27 | quiet_cmd_relocs = RELOCS $@ | ||
28 | cmd_relocs = $(obj)/relocs $< > $@;$(obj)/relocs --abs-relocs $< | ||
29 | $(obj)/vmlinux.relocs: vmlinux $(obj)/relocs FORCE | ||
30 | $(call if_changed,relocs) | ||
31 | |||
32 | vmlinux.bin.all-y := $(obj)/vmlinux.bin | ||
33 | vmlinux.bin.all-$(CONFIG_RELOCATABLE) += $(obj)/vmlinux.relocs | ||
34 | quiet_cmd_relocbin = BUILD $@ | ||
35 | cmd_relocbin = cat $(filter-out FORCE,$^) > $@ | ||
36 | $(obj)/vmlinux.bin.all: $(vmlinux.bin.all-y) FORCE | ||
37 | $(call if_changed,relocbin) | ||
38 | |||
39 | ifdef CONFIG_RELOCATABLE | ||
40 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE | ||
41 | $(call if_changed,gzip) | ||
42 | else | ||
43 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | ||
44 | $(call if_changed,gzip) | ||
45 | endif | ||
46 | |||
47 | LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T | ||
48 | |||
49 | $(obj)/piggy.o: $(src)/vmlinux_32.scr $(obj)/vmlinux.bin.gz FORCE | ||
50 | $(call if_changed,ld) | ||
diff --git a/arch/x86/boot/compressed/Makefile_64 b/arch/x86/boot/compressed/Makefile_64 deleted file mode 100644 index 7801e8dd90b2..000000000000 --- a/arch/x86/boot/compressed/Makefile_64 +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | # | ||
2 | # linux/arch/x86/boot/compressed/Makefile | ||
3 | # | ||
4 | # create a compressed vmlinux image from the original vmlinux | ||
5 | # | ||
6 | |||
7 | targets := vmlinux vmlinux.bin vmlinux.bin.gz head_64.o misc_64.o piggy.o | ||
8 | |||
9 | KBUILD_CFLAGS := -m64 -D__KERNEL__ $(LINUXINCLUDE) -O2 \ | ||
10 | -fno-strict-aliasing -fPIC -mcmodel=small \ | ||
11 | $(call cc-option, -ffreestanding) \ | ||
12 | $(call cc-option, -fno-stack-protector) | ||
13 | KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ | ||
14 | LDFLAGS := -m elf_x86_64 | ||
15 | |||
16 | LDFLAGS_vmlinux := -T | ||
17 | $(obj)/vmlinux: $(src)/vmlinux_64.lds $(obj)/head_64.o $(obj)/misc_64.o $(obj)/piggy.o FORCE | ||
18 | $(call if_changed,ld) | ||
19 | @: | ||
20 | |||
21 | $(obj)/vmlinux.bin: vmlinux FORCE | ||
22 | $(call if_changed,objcopy) | ||
23 | |||
24 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | ||
25 | $(call if_changed,gzip) | ||
26 | |||
27 | LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T | ||
28 | |||
29 | $(obj)/piggy.o: $(obj)/vmlinux_64.scr $(obj)/vmlinux.bin.gz FORCE | ||
30 | $(call if_changed,ld) | ||