mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-01 10:43:43 +00:00
kbuild: move samples/ to KBUILD_VMLINUX_OBJS
Handle samples/ like the other top-level directories to simplify the Makefile. Include include/config/auto.conf earlier to evaluate drivers-$(CONFIG_SAMPLES). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
83da1bed86
commit
d93a18f27e
18
Makefile
18
Makefile
@ -598,20 +598,21 @@ endif
|
|||||||
|
|
||||||
export KBUILD_MODULES KBUILD_BUILTIN
|
export KBUILD_MODULES KBUILD_BUILTIN
|
||||||
|
|
||||||
|
ifeq ($(dot-config),1)
|
||||||
|
include include/config/auto.conf
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(KBUILD_EXTMOD),)
|
ifeq ($(KBUILD_EXTMOD),)
|
||||||
# Objects we will link into vmlinux / subdirs we need to visit
|
# Objects we will link into vmlinux / subdirs we need to visit
|
||||||
init-y := init/
|
init-y := init/
|
||||||
drivers-y := drivers/ sound/
|
drivers-y := drivers/ sound/
|
||||||
|
drivers-$(CONFIG_SAMPLES) += samples/
|
||||||
net-y := net/
|
net-y := net/
|
||||||
libs-y := lib/
|
libs-y := lib/
|
||||||
core-y := usr/
|
core-y := usr/
|
||||||
virt-y := virt/
|
virt-y := virt/
|
||||||
endif # KBUILD_EXTMOD
|
endif # KBUILD_EXTMOD
|
||||||
|
|
||||||
ifeq ($(dot-config),1)
|
|
||||||
include include/config/auto.conf
|
|
||||||
endif
|
|
||||||
|
|
||||||
# The all: target is the default when no target is given on the
|
# The all: target is the default when no target is given on the
|
||||||
# command line.
|
# command line.
|
||||||
# This allow a user to issue only 'make' to build a kernel including modules
|
# This allow a user to issue only 'make' to build a kernel including modules
|
||||||
@ -1006,7 +1007,7 @@ export KBUILD_VMLINUX_LIBS := $(libs-y1)
|
|||||||
export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds
|
export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds
|
||||||
export LDFLAGS_vmlinux
|
export LDFLAGS_vmlinux
|
||||||
# used by scripts/package/Makefile
|
# used by scripts/package/Makefile
|
||||||
export KBUILD_ALLDIRS := $(sort $(filter-out arch/%,$(vmlinux-alldirs)) arch Documentation include samples scripts tools)
|
export KBUILD_ALLDIRS := $(sort $(filter-out arch/%,$(vmlinux-alldirs)) arch Documentation include scripts tools)
|
||||||
|
|
||||||
vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)
|
vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)
|
||||||
|
|
||||||
@ -1043,11 +1044,8 @@ vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE
|
|||||||
|
|
||||||
targets := vmlinux
|
targets := vmlinux
|
||||||
|
|
||||||
# Build samples along the rest of the kernel. This needs headers_install.
|
# Some samples need headers_install.
|
||||||
ifdef CONFIG_SAMPLES
|
|
||||||
vmlinux-dirs += samples
|
|
||||||
samples: headers_install
|
samples: headers_install
|
||||||
endif
|
|
||||||
|
|
||||||
# The actual objects are generated when descending,
|
# The actual objects are generated when descending,
|
||||||
# make sure no implicit rule kicks in
|
# make sure no implicit rule kicks in
|
||||||
@ -1363,7 +1361,7 @@ MRPROPER_FILES += .config .config.old .version \
|
|||||||
#
|
#
|
||||||
clean: rm-dirs := $(CLEAN_DIRS)
|
clean: rm-dirs := $(CLEAN_DIRS)
|
||||||
clean: rm-files := $(CLEAN_FILES)
|
clean: rm-files := $(CLEAN_FILES)
|
||||||
clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation samples)
|
clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation)
|
||||||
|
|
||||||
PHONY += $(clean-dirs) clean archclean vmlinuxclean
|
PHONY += $(clean-dirs) clean archclean vmlinuxclean
|
||||||
$(clean-dirs):
|
$(clean-dirs):
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# Makefile for Linux samples code
|
# Makefile for Linux samples code
|
||||||
|
|
||||||
obj-$(CONFIG_SAMPLES) += kobject/ kprobes/ trace_events/ livepatch/ \
|
obj-y += kobject/ kprobes/ trace_events/ livepatch/ \
|
||||||
hw_breakpoint/ kfifo/ kdb/ hidraw/ rpmsg/ seccomp/ \
|
hw_breakpoint/ kfifo/ kdb/ hidraw/ rpmsg/ seccomp/ \
|
||||||
configfs/ connector/ v4l/ trace_printk/ \
|
configfs/ connector/ v4l/ trace_printk/ \
|
||||||
vfio-mdev/ statx/ qmi/ binderfs/
|
vfio-mdev/ statx/ qmi/ binderfs/
|
||||||
|
Loading…
Reference in New Issue
Block a user