mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Kai Germaschewski <kai-germaschewski@uiowa.edu>
Cc: Sam Ravnborg <sam@ravnborg.org>,
	kbuild-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: RfC: Don't cd into subdirs during kbuild
Date: Thu, 3 Oct 2002 22:44:44 +0200	[thread overview]
Message-ID: <20021003224444.A1411@mars.ravnborg.org> (raw)
In-Reply-To: <Pine.LNX.4.44.0210031505510.24570-100000@chaos.physics.uiowa.edu>; from kai-germaschewski@uiowa.edu on Thu, Oct 03, 2002 at 03:19:57PM -0500

On Thu, Oct 03, 2002 at 03:19:57PM -0500, Kai Germaschewski wrote:
> > Furthermore the construct:
> > obj-y := some.o dot.o .o module.o
> > Seems illogical to me. What does obj-y mean to me??
> > mandatory-objs := some.o dot.o .o module.o
> 
> No, I think once you've understood obj-$(CONFIG_FOO), the meaning
> of obj-y is perfectly clear. Giving multiple names to the samt thing is 
> not good, next thing would be people wondering what the difference
> between obj-y and mandatory-objs is.

I disagree here. To me it looks like obj-y is a misuse of the
obj-$(CONFIG_XXX) rule.
It looks much more intuitive to have a separate rule. But common practice
today differ so it should stay.
Another argument is that we should keep the way to express things down
only one way.

> Initially, it was for built-in targets in addition to the standard 
> O_TARGET, like arch/i386/kernel/head.o.
> I've been abusing it for scripts/, and I shouldn't be doing that.

You used EXTRA_TARGETS to make sure host-progs programs got compiled.
In general the way to use host-progs is not nice.

Typical usage:

host-progs := gentbl
include $(TOPDIR)/Rules.make
%tbl: %data: $(obj)/somefile.data $(obj)/gentbl
	gentbl $< $@

In other words you need to make an explicit prerequisite to the host-progs
to get it build, which is what you did with EXTRA_TARGETS.

I would advocate for another solution:
Let programs listed in host-progs be compiled always.
Then the makefile could assign host-progs conditionally instead.
find -name Makefile | xargs grep host-progs | wc -l
12

A doable task, that I'm ready to do.


We could also define 
force-host-progs :=
or something similar.


> 
> > > -cmd_link_multi = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $($(basename $@)-objs),$^)
> > > +cmd_link_multi = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.o=-objs)))),$^)
> > Keep a variable without obj appended would make this readable I think.
> 
> I agree that it is not particularly readable, but I'm limited to what make 
> offers. What do you suggest?

Untested:
$(notdir $(@:.o=-objs))

	Sam


  reply	other threads:[~2002-10-03 20:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-03  2:59 Kai Germaschewski
2002-10-03  3:32 ` Andreas Dilger
2002-10-03  5:18 ` [kbuild-devel] " Peter Samuelson
2002-10-03 14:54   ` Kai Germaschewski
2002-10-03  8:21 ` Xavier Bestel
2002-10-03 14:56   ` Kai Germaschewski
2002-10-03 15:31     ` Xavier Bestel
2002-10-03 20:41   ` Peter Samuelson
2002-10-03 14:05 ` John Levon
2002-10-03 14:27   ` Kai Germaschewski
2002-10-03 14:45     ` John Levon
2002-10-03 19:26 ` Sam Ravnborg
2002-10-03 19:33   ` [kbuild-devel] " Sam Ravnborg
2002-10-03 20:01 ` Sam Ravnborg
2002-10-03 20:19   ` Kai Germaschewski
2002-10-03 20:44     ` Sam Ravnborg [this message]
2002-10-03 20:20   ` Peter Samuelson
2002-10-03 20:30   ` Sam Ravnborg
2002-10-03 20:38     ` Kai Germaschewski
2002-10-03 20:50       ` Sam Ravnborg
2002-10-04 19:07       ` Sam Ravnborg
2002-10-04 20:17         ` Sam Ravnborg
2002-10-09  0:45       ` [kbuild-devel] " Brendan J Simon

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=20021003224444.A1411@mars.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=kai-germaschewski@uiowa.edu \
    --cc=kbuild-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®