public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Henning Makholm <henning@makholm.net>
To: Riley Williams <rhw@InfraDead.Org>
Cc: "Adam J. Richter" <adam@yggdrasil.com>,
	bug-make@gnu.org, Linux Ham Radio <linux-hams@vger.kernel.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	sailer@ife.ee.ethz.ch
Subject: Re: make-3.79.1 bug breaks linux-2.5.24/drivers/net/hamradio/soundmodem
Date: 24 Jun 2002 14:00:09 +0200	[thread overview]
Message-ID: <yahsn3clwdy.fsf@pc-043.diku.dk> (raw)
In-Reply-To: Riley Williams's message of "Sat, 22 Jun 2002 21:23:27 +0100 (BST)"

Scripsit Riley Williams <rhw@InfraDead.Org>

> >> $(obj)/sm_tbl_%: $(obj)/gentbl
> >>         PATH=$(obj):$$PATH $<

> > That looks like an excessively complicated workaround. Why not just

> > $(obj)/sm_tbl_%: $(obj)/gentbl
> > 	$(obj)/gentbl

> The difference will only show up if $(obj) expands to a string with
> spaces in it, generated by a definition such as...

> 	obj = `pwd`

In which case the command

	PATH=$(obj):$$PATH $<

is likely do fail miserably too.

Also, the dependency list $(obj)/gentbl will be parsed as multiple
files when $(obj) contains spaces. Which is clearly the right
behavior, as it is hard to find a serious project that does not use
Makefile variables to hold the names of multiple dependencies
somewhere.

> ...due to a difference in how SOME versions of Make handle that. My
> experience has been that all versions of Make expand "dependency" tokens
> as a single token, and copy them down as a single token when $< or the
> like are used, but expand the $(obj) in the command line as multiple
> tokens in that case.

If one is afraid of that, one can use

	"$(obj)/gentbl"

which will prevent the shell from thinking that the space separates
"words" on the command line. (Whether one can trick make into
interpreting the space as part of the filename in the dependency list
is another matter).

> > I'm not sure this is really a bug either.

> It's a genuine bug that needs fixing.

I still disagree.

> Providing "internally" relates only to internal transliterations done on
> the files listed on the dependency line for the purpose of determining
> whether a particular file is up to date, and does not also relate to the
> use of those files in the rules that follow, there's no problem there.

I don't think that "$<" is documented anywhere to have any exact
relationship to the string of characters used in the depencency
list. The GNU make manual says that $< is "the name of the first
depencency", not "the string used to identify the first dependency in
the rule".

> The ONLY reasonable canonical name for ANY file is that which includes
> the full path to that file starting from the root directory and working
> down through real directories without encountering any symbolic links.
> Absolutely anything else is open to misinterpretation.

Assuming anything for $< (and similar variables) but that they unfold
to SOME name that references the file in question, is open to
misinterpretation and leads to unportable makefiles.

-- 
Henning Makholm                             "... and that Greek, Thucydides"

  parent reply	other threads:[~2002-06-24 12:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-22  6:57 make-3.79.1 bug breaks linux-2.5.24/drivers/net/hamradio/soundmodem Adam J. Richter
2002-06-22 13:51 ` Henning Makholm
2002-06-22 20:23   ` Riley Williams
2002-06-22 21:24     ` Kai Germaschewski
2002-06-24 12:00     ` Henning Makholm [this message]
2002-06-24 15:33 ` [PATCH] " Thomas Sailer
  -- strict thread matches above, loose matches on Subject: below --
2002-06-22 21:56 Adam J. Richter
2002-06-24 12:13 ` Henning Makholm

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=yahsn3clwdy.fsf@pc-043.diku.dk \
    --to=henning@makholm.net \
    --cc=adam@yggdrasil.com \
    --cc=bug-make@gnu.org \
    --cc=linux-hams@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rhw@InfraDead.Org \
    --cc=sailer@ife.ee.ethz.ch \
    /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