Commit 4b4b98c2 authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Use $(core-y) and friends directly

The capitalized aliases $(CORE_FILES) etc are basically superfluous now,
move the remaining users to $(core-y) and the like.
parent d732f127
......@@ -151,7 +151,7 @@ export VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION KERNELRELEASE ARCH \
CONFIG_SHELL TOPDIR HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC \
CPP AR NM STRIP OBJCOPY OBJDUMP MAKE MAKEFILES GENKSYMS PERL
export CPPFLAGS EXPORT_FLAGS NOSTDINC_FLAGS OBJCOPYFLAGS
export CPPFLAGS EXPORT_FLAGS NOSTDINC_FLAGS OBJCOPYFLAGS LDFLAGS
export CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
export AFLAGS AFLAGS_KERNEL AFLAGS_MODULE
......@@ -249,29 +249,25 @@ endif
init-y := init/
drivers-y := drivers/ sound/
networks-y := net/
net-y := net/
libs-y := lib/
core-y :=
SUBDIRS :=
include arch/$(ARCH)/Makefile
core-y += kernel/ mm/ fs/ ipc/ security/
SUBDIRS += $(patsubst %/,%,$(filter %/, $(init-y) $(init-m)))
INIT += $(patsubst %/, %/built-in.o, $(init-y))
SUBDIRS += $(patsubst %/,%,$(filter %/, $(init-y) $(init-m) \
$(core-y) $(core-m) $(drivers-y) $(drivers-m) \
$(net-y) $(net-m) $(libs-y) $(libs-m)))
init-y := $(patsubst %/, %/built-in.o, $(init-y))
core-y := $(patsubst %/, %/built-in.o, $(core-y))
drivers-y := $(patsubst %/, %/built-in.o, $(drivers-y))
net-y := $(patsubst %/, %/built-in.o, $(net-y))
libs-y := $(patsubst %/, %/lib.a, $(libs-y))
SUBDIRS += $(patsubst %/,%,$(filter %/, $(core-y) $(core-m)))
CORE_FILES += $(patsubst %/, %/built-in.o, $(core-y))
SUBDIRS += $(patsubst %/,%,$(filter %/, $(drivers-y) $(drivers-m)))
DRIVERS += $(patsubst %/, %/built-in.o, $(drivers-y))
SUBDIRS += $(patsubst %/,%,$(filter %/, $(networks-y) $(networks-m)))
NETWORKS += $(patsubst %/, %/built-in.o, $(networks-y))
SUBDIRS += $(patsubst %/,%,$(filter %/, $(libs-y) $(libs-m)))
LIBS += $(patsubst %/, %/lib.a, $(libs-y))
export NETWORKS DRIVERS LIBS HEAD LDFLAGS MAKEBOOT
$(warning $(SUBDIRS))
# Build vmlinux
# ---------------------------------------------------------------------------
......@@ -283,16 +279,16 @@ export NETWORKS DRIVERS LIBS HEAD LDFLAGS MAKEBOOT
# we cannot yet know if we will need to relink vmlinux.
# So we descend into init/ inside the rule for vmlinux again.
vmlinux-objs := $(HEAD) $(INIT) $(CORE_FILES) $(LIBS) $(DRIVERS) $(NETWORKS)
vmlinux-objs := $(HEAD) $(init-y) $(core-y) $(libs-y) $(drivers-y) $(net-y)
quiet_cmd_link_vmlinux = LD $@
define cmd_link_vmlinux
$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) $(HEAD) $(INIT) \
$(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) $(HEAD) $(init-y) \
--start-group \
$(CORE_FILES) \
$(LIBS) \
$(DRIVERS) \
$(NETWORKS) \
$(core-y) \
$(libs-y) \
$(drivers-y) \
$(net-y) \
--end-group \
$(filter $(kallsyms.o),$^) \
-o $@
......
......@@ -95,6 +95,8 @@ core-y += arch/alpha/kernel/ arch/alpha/mm/
core-$(CONFIG_MATHEMU) += arch/alpha/math-emu/
libs-y += arch/alpha/lib/
export libs-y
MAKEBOOT = $(MAKE) -C arch/alpha/boot
rawboot:
......
......@@ -20,7 +20,7 @@ BPOBJECTS = head.o bootp.o
TARGETS = vmlinux.gz tools/objstrip # also needed by aboot & milo
VMLINUX = $(TOPDIR)/vmlinux
OBJSTRIP = tools/objstrip
LIBS := $(patsubst lib/%,$(TOPDIR)/lib/%,$(LIBS))
LIBS := $(addprefix $(TOPDIR)/,$(libs-y))
all: $(TARGETS)
@echo Ready to install kernel in $(shell pwd)/vmlinux.gz
......
......@@ -41,8 +41,7 @@ core-y += arch/sparc/kernel/ arch/sparc/mm/ arch/sparc/math-emu/
libs-y += arch/sparc/prom/ arch/sparc/lib/
# Export what is needed by arch/sparc/boot/Makefile
export CORE_FILES
export INIT
export init-y core-y drivers-y net-y libs-y HEAD
image: vmlinux
$(MAKE) -C arch/sparc/boot image
......
......@@ -22,9 +22,8 @@ btfixupprep: btfixupprep.c
clean:
rm -f btfixupprep piggyback tftpboot.img btfix.o btfix.s image
BTOBJS := $(HEAD) $(INIT)
BTLIBS := $(CORE_FILES) $(LIBS) \
$(DRIVERS) $(NETWORKS)
BTOBJS := $(HEAD) $(init-y)
BTLIBS := $(core-y) $(LIBS) $(drivers-y) $(net-y)
# Actual linking
image: btfix.o
......
......@@ -27,7 +27,7 @@ int isdn_ppp_xmit(struct sk_buff *, struct net_device *);
#else
static inline int
isdn_ppp_xmit(struct sk_buff *, struct net_device *);
isdn_ppp_xmit(struct sk_buff *, struct net_device *)
{
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment