Skip to content
Snippets Groups Projects
Commit db5ea21a authored by Sam Ravnborg's avatar Sam Ravnborg Committed by David S. Miller
Browse files

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: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b5db854a
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,6 @@ CPPFLAGS_vmlinux.lds += -m32 ...@@ -27,7 +27,6 @@ CPPFLAGS_vmlinux.lds += -m32
LDFLAGS_vmlinux = -r LDFLAGS_vmlinux = -r
head-y := arch/sparc/kernel/head.o arch/sparc/kernel/init_task.o head-y := arch/sparc/kernel/head.o arch/sparc/kernel/init_task.o
HEAD_Y := $(head-y)
core-y += arch/sparc/kernel/ arch/sparc/mm/ arch/sparc/math-emu/ core-y += arch/sparc/kernel/ arch/sparc/mm/ arch/sparc/math-emu/
libs-y += arch/sparc/prom/ arch/sparc/lib/ libs-y += arch/sparc/prom/ arch/sparc/lib/
...@@ -35,23 +34,16 @@ libs-y += arch/sparc/prom/ arch/sparc/lib/ ...@@ -35,23 +34,16 @@ libs-y += arch/sparc/prom/ arch/sparc/lib/
drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/ drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/
# Export what is needed by arch/sparc/boot/Makefile # Export what is needed by arch/sparc/boot/Makefile
# Renaming is done to avoid confusing pattern matching rules in 2.5.45 (multy-) export VMLINUX_INIT VMLINUX_MAIN
INIT_Y := $(patsubst %/, %/built-in.o, $(init-y)) VMLINUX_INIT := $(head-y) $(init-y)
CORE_Y := $(core-y) VMLINUX_MAIN := $(core-y) kernel/ mm/ fs/ ipc/ security/ crypto/ block/
CORE_Y += kernel/ mm/ fs/ ipc/ security/ crypto/ block/ VMLINUX_MAIN += $(patsubst %/, %/lib.a, $(libs-y)) $(libs-y)
CORE_Y := $(patsubst %/, %/built-in.o, $(CORE_Y)) VMLINUX_MAIN += $(drivers-y) $(net-y)
DRIVERS_Y := $(patsubst %/, %/built-in.o, $(drivers-y))
NET_Y := $(patsubst %/, %/built-in.o, $(net-y))
LIBS_Y1 := $(patsubst %/, %/lib.a, $(libs-y))
LIBS_Y2 := $(patsubst %/, %/built-in.o, $(libs-y))
LIBS_Y := $(LIBS_Y1) $(LIBS_Y2)
ifdef CONFIG_KALLSYMS ifdef CONFIG_KALLSYMS
kallsyms.o := .tmp_kallsyms2.o export kallsyms.o := .tmp_kallsyms2.o
endif endif
export INIT_Y CORE_Y DRIVERS_Y NET_Y LIBS_Y HEAD_Y kallsyms.o
# Default target # Default target
all: zImage all: zImage
......
...@@ -37,8 +37,8 @@ define rule_image ...@@ -37,8 +37,8 @@ define rule_image
echo 'cmd_$@ := $(cmd_image)' > $(@D)/.$(@F).cmd echo 'cmd_$@ := $(cmd_image)' > $(@D)/.$(@F).cmd
endef endef
BTOBJS := $(HEAD_Y) $(INIT_Y) BTOBJS := $(patsubst %/, %/built-in.o, $(VMLINUX_INIT))
BTLIBS := $(CORE_Y) $(LIBS_Y) $(DRIVERS_Y) $(NET_Y) BTLIBS := $(patsubst %/, %/built-in.o, $(VMLINUX_MAIN))
LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) \ LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) \
--start-group $(BTLIBS) --end-group \ --start-group $(BTLIBS) --end-group \
$(kallsyms.o) $(obj)/btfix.o $(kallsyms.o) $(obj)/btfix.o
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment