public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: kbuild: shorthand ym2y, ym2m etc
Date: Sun, 30 Jan 2005 23:41:34 +0100	[thread overview]
Message-ID: <200501302341.35086.arnd@arndb.de> (raw)
In-Reply-To: <20050130193733.GA8984@mars.ravnborg.org>

[-- Attachment #1: Type: text/plain, Size: 1356 bytes --]

On Sünndag 30 Januar 2005 20:37, Sam Ravnborg wrote:
> We have in several cases the need to transpose a i'm' to 'y' in the Kbuild
> files.
> One example is the following snippet from sound/Makefile:
> ifeq ($(CONFIG_SND),y)
>   obj-y += last.o
> endif
> 
> Alternative syntax could be:
> obj-$(call y2y,CONFIG_SND) += last.o

You can already write this as

last-$(CONFIG_SND) := last.o
obj-y += $(last-y)

I'm not sure if this is better than the current version, but I'd
prefer it to using the extra function.

> From drivers/vidoe/Makfile:
> ifeq ($(CONFIG_FB),y)
>   obj-$(CONFIG_PPC)                 += macmodes.o
> endif

macmodes-$(CONFIG_FB) := macmodes.o
obj-$(CONFIG_PPC) += $(macmodes-y)

> ym2y
> ym2m

tmp-$(CONFIG_FOO) := foo.o
tmp-$(CONFIG_BAR) := $(tmp-y)
obj-m += $(tmp-m)

> empty2y
> empty2m

tmp-$(CONFIG_FOO) := foo.o
obj-m += $(tmp-) $(tmp-n)

> y2y
> m2y
> y2m
> m2m
> yx2x
> mx2x
> 
> Would that be considered usefull?

I don't fully understand what all those examples should do, so they
are probably not that intuitive. I'm pretty sure that we can already
express them all with either ifeq() or two assignments, though.
Both are already used in the kernel (see ipc/Makefile for an
example of yx2x), so maybe the preferred style should be documented
in CodingStyle.

	Arnd <><

[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2005-01-30 22:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-30 19:37 kbuild: shorthand ym2y, ym2m etc Sam Ravnborg
2005-01-30 19:48 ` Muli Ben-Yehuda
2005-01-30 19:52 ` Christoph Hellwig
2005-01-30 22:39   ` Sam Ravnborg
2005-01-30 22:44     ` Russell King
2005-01-30 22:51       ` Sam Ravnborg
2005-01-30 22:41 ` Arnd Bergmann [this message]
2005-01-30 22:59   ` Sam Ravnborg
2005-01-31  1:57 ` Andreas Gruenbacher

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=200501302341.35086.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.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