public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jim Baxter <jim_baxter@mentor.com>
To: <mmarek@suse.cz>, <linux-kbuild@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
	"Moseley, Drew" <drew_moseley@mentor.com>
Subject: Building CONFIG_SAMPLES separately.
Date: Wed, 10 Jul 2013 20:32:12 +0100	[thread overview]
Message-ID: <51DDB6BC.5060203@mentor.com> (raw)

Hi,

I was wondering if there is a reason the modules under the samples
directory only build if you use the command make uImage modules?

I have created a patch so that they compile if you enable CONFIG_SAMPLES
and then build the kernel separately, i.e.
make uImage
make modules

This two step approach is how the kernel is built if you use bitbake in
yocto, currently it does not output the kernel module object file for
the sample modules.

This is the patch I am considering:

diff --git a/Makefile b/Makefile
index 29339b4..1acd69f 100644
--- a/Makefile
+++ b/Makefile
@@ -772,9 +772,6 @@ vmlinux: scripts/link-vmlinux.sh $(vmlinux-deps) FORCE
 ifdef CONFIG_HEADERS_CHECK
        $(Q)$(MAKE) -f $(srctree)/Makefile headers_check
 endif
-ifdef CONFIG_SAMPLES
-       $(Q)$(MAKE) $(build)=samples
-endif
 ifdef CONFIG_BUILD_DOCSRC
        $(Q)$(MAKE) $(build)=Documentation
 endif
@@ -943,6 +940,9 @@ all: modules

 PHONY += modules
 modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
+ifdef CONFIG_SAMPLES
+       $(Q)$(MAKE) $(build)=samples
+endif
        $(Q)$(AWK) '!x[$$0]++'
$(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
        @$(kecho) '  Building modules, stage 2.';
        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost


Thank you for any help or advice,
Jim Baxter

                 reply	other threads:[~2013-07-10 19:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=51DDB6BC.5060203@mentor.com \
    --to=jim_baxter@mentor.com \
    --cc=drew_moseley@mentor.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    /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