Commit 6f31fe5a authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Simplify rule for just building one subdir

It's possible to say "make <subdir>", to descend into that subdir
and recursively build things there. This patch provides this
facility generally without the arch Makefiles needing to duplicate
it for arch/$(ARCH)/somedir.
parent 2c98ce0a
......@@ -215,15 +215,12 @@ vmlinux: $(CONFIGURATION) $(vmlinux-objs) dummy
# The actual objects are generated when descending,
# make sure no implicit rule kicks in
$(sort $(vmlinux-objs)): linuxsubdirs ;
$(sort $(vmlinux-objs)): $(SUBDIRS) ;
# Handle descending into subdirectories listed in $(SUBDIRS)
.PHONY: linuxsubdirs
linuxsubdirs: $(patsubst %, _dir_%, $(SUBDIRS))
$(patsubst %, _dir_%, $(SUBDIRS)) : dummy include/linux/version.h include/config/MARKER
@$(MAKE) -C $(patsubst _dir_%, %, $@)
$(SUBDIRS): dummy include/linux/version.h include/config/MARKER
@$(MAKE) -C $@
# Configuration
# ---------------------------------------------------------------------------
......@@ -489,13 +486,6 @@ tags: dummy
find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \
find $(SUBDIRS) init -name '*.[ch]' | xargs ctags $$CTAGSF -a
# Targets which will only descend into one subdir, not trying
# to link vmlinux afterwards
# FIXME: anybody still using this?
fs lib mm ipc kernel drivers net sound: dummy
$(MAKE) $(subst $@, _dir_$@, $@)
# Make a backup
# FIXME anybody still using this?
......
......@@ -212,9 +212,6 @@ vmlinux: arch/arm/vmlinux.lds
arch/arm/vmlinux.lds: $(LDSCRIPT) dummy
@sed 's/TEXTADDR/$(TEXTADDR)/;s/DATAADDR/$(DATAADDR)/' $(LDSCRIPT) >$@
arch/arm/kernel arch/arm/mm arch/arm/lib: dummy
$(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" $(subst $@, _dir_$@, $@)
bzImage zImage zinstall Image bootpImage install: vmlinux
@$(MAKEBOOT) $@
......
......@@ -61,12 +61,6 @@ DRIVERS += arch/cris/drivers/drivers.o
LIBGCC = $(shell $(CC) $(CFLAGS) -print-file-name=libgcc.a)
LIBS := $(TOPDIR)/arch/cris/lib/lib.a $(LIBS) $(TOPDIR)/arch/cris/lib/lib.a $(LIBGCC)
arch/cris/kernel: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/cris/kernel
arch/cris/mm: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/cris/mm
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
vmlinux.bin: vmlinux
......
......@@ -103,12 +103,6 @@ SUBDIRS += arch/i386/pci
DRIVERS += arch/i386/pci/pci.o
endif
arch/i386/kernel: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/i386/kernel
arch/i386/mm: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/i386/mm
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
vmlinux: arch/i386/vmlinux.lds
......
......@@ -55,17 +55,8 @@ endif
ifdef CONFIG_KWDB
SUBDIRS := $(SUBDIRS) arch/parisc/kdb
DRIVERS := $(DRIVERS) arch/parisc/kdb/kdb.o
arch/parisc/kdb: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/parisc/kdb
endif
arch/parisc/kernel: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/parisc/kernel
arch/parisc/mm: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/parisc/mm
palo: vmlinux
export TOPDIR=`pwd`; export CONFIG_STI_CONSOLE=$(CONFIG_STI_CONSOLE); \
unset STRIP LDFLAGS CPP CPPFLAGS AFLAGS CFLAGS CC LD; cd ../palo && make lifimage
......
......@@ -44,15 +44,6 @@ all: image listing
listing: vmlinux
@$(MAKEBOOT) listing
arch/s390/kernel: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/s390/kernel
arch/s390/mm: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/s390/mm
drivers/s390: dummy
$(MAKE) linuxsubdirs SUBDIRS=drivers/s390
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
image: vmlinux
......
......@@ -41,15 +41,6 @@ all: image listing
listing: vmlinux
@$(MAKEBOOT) listing
arch/s390x/kernel: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/s390x/kernel
arch/s390x/mm: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/s390x/mm
drivers/s390: dummy
$(MAKE) linuxsubdirs SUBDIRS=drivers/s390
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
image: vmlinux
......
......@@ -70,15 +70,6 @@ endif
CORE_FILES += $(core-y)
arch/x86_64/tools: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/x86_64/tools
arch/x86_64/kernel: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/x86_64/kernel
arch/x86_64/mm: dummy
$(MAKE) linuxsubdirs SUBDIRS=arch/x86_64/mm
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
vmlinux: arch/x86_64/vmlinux.lds
......
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