LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Roland McGrath <roland@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] samples: build fix
Date: Thu, 14 Feb 2008 22:06:30 +0100	[thread overview]
Message-ID: <20080214210630.GG21894@uranus.ravnborg.org> (raw)
In-Reply-To: <20080214200404.GA11166@Krystal>

On Thu, Feb 14, 2008 at 03:04:04PM -0500, Mathieu Desnoyers wrote:
> * Sam Ravnborg (sam@ravnborg.org) wrote:
> > On Thu, Feb 14, 2008 at 08:27:52AM -0500, Mathieu Desnoyers wrote:
> > > * Roland McGrath (roland@redhat.com) wrote:
> > > > 
> > > > The samples/ subdirectory contains only modules.
> > > > But the only make run done there is in commands for vmlinux.
> > > > I can't see why this was ever done in this nonstandard fashion.
> > > > As things stand, the modules don't get built by 'make modules'.
> > > > 
> > > > I didn't make the addition of the directory use core-$(CONFIG_SAMPLES)
> > > > because there is no other conditional like that in the top-level Makefile
> > > > and samples/Makefile already uses obj-$(CONFIG_SAMPLES) as if it expects
> > > > always to be included.
> > > > 
> > > 
> > > Sam, is this ok with the samples intent ? I think as long as we do not
> > > include them with the kernel image and have a "make samples" to build
> > > them, it's ok. Having them built upon make modules seems like a good
> > > idea to me.
> > 
> > The samples code are supposed to be what the name says 'samples'.
> > This is not code that are supposed to be part of the built-in kernel.
> > This is not modules that are supposed to be installes when 
> > installing modules.
> > 
> > Adding it to core-y as Roland does in the patch below is plain
> > wrong as it enabled both points above.
> > The fact that the present code in samples/ does not do this is
> > in this respect irellevant.
> > 
> > Do we have problems when to build the sampls - then lets
> > address this issue but not by trying to upgrade the samples
> > to first class citizen in the kernel - they are not that
> > and should not be handled like that.
> > 
> 
> Then is there some other way to have the samples built upon "make
> modules" that would not install them with other modules ?
The simple solution is like attached.
I do not care if they are build as part of vmlinux or modules build.
So if it is generally preferred we could move it like this.

Comments?

	Sam

diff --git a/Makefile b/Makefile
index c162370..c72afa9 100644
--- a/Makefile
+++ b/Makefile
@@ -802,9 +802,6 @@ vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o $(kallsyms.o)
 ifdef CONFIG_HEADERS_CHECK
 	$(Q)$(MAKE) -f $(srctree)/Makefile headers_check
 endif
-ifdef CONFIG_SAMPLES
-	$(Q)$(MAKE) $(build)=samples
-endif
 	$(call vmlinux-modpost)
 	$(call if_changed_rule,vmlinux__)
 	$(Q)rm -f .old_version
@@ -1036,6 +1033,9 @@ all: modules
 PHONY += modules
 modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux)
 	$(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
+ifdef CONFIG_SAMPLES
+	$(Q)$(MAKE) $(build)=samples
+endif
 	@echo '  Building modules, stage 2.';
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
 

      reply	other threads:[~2008-02-14 21:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-14  3:45 Roland McGrath
2008-02-14 13:27 ` Mathieu Desnoyers
2008-02-14 19:26   ` Roland McGrath
2008-02-14 19:46   ` Sam Ravnborg
2008-02-14 20:02     ` Roland McGrath
2008-02-14 20:09       ` Randy Dunlap
2008-02-14 20:42       ` Sam Ravnborg
2008-02-14 20:04     ` Mathieu Desnoyers
2008-02-14 21:06       ` Sam Ravnborg [this message]

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=20080214210630.GG21894@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=roland@redhat.com \
    --cc=torvalds@linux-foundation.org \
    --subject='Re: [PATCH] samples: build fix' \
    /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

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).