From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: linux-kbuild@vger.kernel.org
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
Michal Marek <michal.lkml@markovi.net>,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/5] kbuild: move samples/ to KBUILD_VMLINUX_OBJS
Date: Sat, 27 Apr 2019 12:33:36 +0900 [thread overview]
Message-ID: <1556336020-15634-1-git-send-email-yamada.masahiro@socionext.com> (raw)
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>
---
Makefile | 18 ++++++++----------
samples/Makefile | 2 +-
2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/Makefile b/Makefile
index 15e17b4..251ded5 100644
--- a/Makefile
+++ b/Makefile
@@ -598,20 +598,21 @@ endif
export KBUILD_MODULES KBUILD_BUILTIN
+ifeq ($(dot-config),1)
+include include/config/auto.conf
+endif
+
ifeq ($(KBUILD_EXTMOD),)
# Objects we will link into vmlinux / subdirs we need to visit
init-y := init/
drivers-y := drivers/ sound/
+drivers-$(CONFIG_SAMPLES) += samples/
net-y := net/
libs-y := lib/
core-y := usr/
virt-y := virt/
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
# command line.
# This allow a user to issue only 'make' to build a kernel including modules
@@ -1005,7 +1006,7 @@ export KBUILD_VMLINUX_LIBS := $(libs-y1)
export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds
export LDFLAGS_vmlinux
# 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)
@@ -1042,11 +1043,8 @@ vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE
targets := vmlinux
-# Build samples along the rest of the kernel. This needs headers_install.
-ifdef CONFIG_SAMPLES
-vmlinux-dirs += samples
+# Some samples need headers_install.
samples: headers_install
-endif
# The actual objects are generated when descending,
# make sure no implicit rule kicks in
@@ -1362,7 +1360,7 @@ MRPROPER_FILES += .config .config.old .version \
#
clean: rm-dirs := $(CLEAN_DIRS)
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
$(clean-dirs):
diff --git a/samples/Makefile b/samples/Makefile
index b1142a9..50f8586 100644
--- a/samples/Makefile
+++ b/samples/Makefile
@@ -1,6 +1,6 @@
# 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/ \
configfs/ connector/ v4l/ trace_printk/ \
vfio-mdev/ statx/ qmi/ binderfs/
--
2.7.4
next reply other threads:[~2019-04-27 3:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-27 3:33 Masahiro Yamada [this message]
2019-04-27 3:33 ` [PATCH 2/5] kbuild: move Documentation to vmlinux-alldirs Masahiro Yamada
2019-04-27 3:33 ` [PATCH 3/5] samples: guard sub-directories with CONFIG options Masahiro Yamada
2019-04-27 3:33 ` [PATCH 4/5] samples: seccomp: turn CONFIG_SAMPLE_SECCOMP into a bool option Masahiro Yamada
2019-04-27 3:33 ` [PATCH 5/5] samples: kobject: allow CONFIG_SAMPLE_KOBJECT to become y Masahiro Yamada
2019-05-01 12:35 ` [PATCH 1/5] kbuild: move samples/ to KBUILD_VMLINUX_OBJS Masahiro Yamada
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1556336020-15634-1-git-send-email-yamada.masahiro@socionext.com \
--to=yamada.masahiro@socionext.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).