diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2008-12-03 02:15:42 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-04 12:17:13 -0500 |
commit | db5ea21a14b7c69bf495a741ae37ba15fb9eabd1 (patch) | |
tree | be4a80a89b595f656c9b3d787a3e9e755cd9ec35 | |
parent | b5db854a91d93c46c6904506ef73ce0d0b074b44 (diff) |
sparc: refactor Makefile
The btfixup step needs knowledge of all the .o files,
but there is no need to pass them in independent variables.
Simplify it to use only two variables.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | arch/sparc/Makefile | 20 | ||||
-rw-r--r-- | arch/sparc/boot/Makefile | 4 |
2 files changed, 8 insertions, 16 deletions
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile index c5f3d6fe8a67..43db7e1d5335 100644 --- a/arch/sparc/Makefile +++ b/arch/sparc/Makefile | |||
@@ -27,7 +27,6 @@ CPPFLAGS_vmlinux.lds += -m32 | |||
27 | LDFLAGS_vmlinux = -r | 27 | LDFLAGS_vmlinux = -r |
28 | 28 | ||
29 | head-y := arch/sparc/kernel/head.o arch/sparc/kernel/init_task.o | 29 | head-y := arch/sparc/kernel/head.o arch/sparc/kernel/init_task.o |
30 | HEAD_Y := $(head-y) | ||
31 | 30 | ||
32 | core-y += arch/sparc/kernel/ arch/sparc/mm/ arch/sparc/math-emu/ | 31 | core-y += arch/sparc/kernel/ arch/sparc/mm/ arch/sparc/math-emu/ |
33 | libs-y += arch/sparc/prom/ arch/sparc/lib/ | 32 | libs-y += arch/sparc/prom/ arch/sparc/lib/ |
@@ -35,23 +34,16 @@ libs-y += arch/sparc/prom/ arch/sparc/lib/ | |||
35 | drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/ | 34 | drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/ |
36 | 35 | ||
37 | # Export what is needed by arch/sparc/boot/Makefile | 36 | # Export what is needed by arch/sparc/boot/Makefile |
38 | # Renaming is done to avoid confusing pattern matching rules in 2.5.45 (multy-) | 37 | export VMLINUX_INIT VMLINUX_MAIN |
39 | INIT_Y := $(patsubst %/, %/built-in.o, $(init-y)) | 38 | VMLINUX_INIT := $(head-y) $(init-y) |
40 | CORE_Y := $(core-y) | 39 | VMLINUX_MAIN := $(core-y) kernel/ mm/ fs/ ipc/ security/ crypto/ block/ |
41 | CORE_Y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ | 40 | VMLINUX_MAIN += $(patsubst %/, %/lib.a, $(libs-y)) $(libs-y) |
42 | CORE_Y := $(patsubst %/, %/built-in.o, $(CORE_Y)) | 41 | VMLINUX_MAIN += $(drivers-y) $(net-y) |
43 | DRIVERS_Y := $(patsubst %/, %/built-in.o, $(drivers-y)) | ||
44 | NET_Y := $(patsubst %/, %/built-in.o, $(net-y)) | ||
45 | LIBS_Y1 := $(patsubst %/, %/lib.a, $(libs-y)) | ||
46 | LIBS_Y2 := $(patsubst %/, %/built-in.o, $(libs-y)) | ||
47 | LIBS_Y := $(LIBS_Y1) $(LIBS_Y2) | ||
48 | 42 | ||
49 | ifdef CONFIG_KALLSYMS | 43 | ifdef CONFIG_KALLSYMS |
50 | kallsyms.o := .tmp_kallsyms2.o | 44 | export kallsyms.o := .tmp_kallsyms2.o |
51 | endif | 45 | endif |
52 | 46 | ||
53 | export INIT_Y CORE_Y DRIVERS_Y NET_Y LIBS_Y HEAD_Y kallsyms.o | ||
54 | |||
55 | # Default target | 47 | # Default target |
56 | all: zImage | 48 | all: zImage |
57 | 49 | ||
diff --git a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile index 3e77a9f52248..4fd562034a74 100644 --- a/arch/sparc/boot/Makefile +++ b/arch/sparc/boot/Makefile | |||
@@ -37,8 +37,8 @@ define rule_image | |||
37 | echo 'cmd_$@ := $(cmd_image)' > $(@D)/.$(@F).cmd | 37 | echo 'cmd_$@ := $(cmd_image)' > $(@D)/.$(@F).cmd |
38 | endef | 38 | endef |
39 | 39 | ||
40 | BTOBJS := $(HEAD_Y) $(INIT_Y) | 40 | BTOBJS := $(patsubst %/, %/built-in.o, $(VMLINUX_INIT)) |
41 | BTLIBS := $(CORE_Y) $(LIBS_Y) $(DRIVERS_Y) $(NET_Y) | 41 | BTLIBS := $(patsubst %/, %/built-in.o, $(VMLINUX_MAIN)) |
42 | LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) \ | 42 | LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) \ |
43 | --start-group $(BTLIBS) --end-group \ | 43 | --start-group $(BTLIBS) --end-group \ |
44 | $(kallsyms.o) $(obj)/btfix.o | 44 | $(kallsyms.o) $(obj)/btfix.o |