Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Jan 2002 21:07:35 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        Alexey Zelkin <phantom@ark.cris.net>, <cvs-all@FreeBSD.org>, <cvs-committers@FreeBSD.org>, Sheldon Hearn <sheldonh@starjuice.net>
Subject:   Re: cvs commit: src/usr.bin/colldef Makefile
Message-ID:  <20020109205650.I7942-100000@gamplex.bde.org>
In-Reply-To: <XFMail.020108094201.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 8 Jan 2002, John Baldwin wrote:

> On 08-Jan-02 Alexey Zelkin wrote:
> > On Tue, Jan 08, 2002 at 03:14:06PM +0200, Sheldon Hearn wrote:
> >>
> >>
> >> On Tue, 08 Jan 2002 03:08:20 PST, John Baldwin wrote:
> >>
> >> >   Modified files:
> >> >     usr.bin/colldef      Makefile
> >> >   Log:
> >> >   Replace -I${.OBJDIR} with -I. and split the CFLAGS line up into two
> >> >   lines.
> >>
> >> Why '.' and not '${.CURDIR}'?  I'm sure I'm not the only one who'd
> >> benefit from an explanation.

One reason is that '.' isn't ${.CURDIR} except in the degenerate case where
${.OBJDIR} is ${.CURDIR}.  '.' is ${.OBJDIR}.

> > Because -I${.CURDIR} is already in CFLAGS (see previous revision)
> > and since colldef is using automatically generated .h file it requires
> > -I${.OBJDIR} or -I. to find pregenerated y.tab.h.
> >
> > Looks like this commit is a style fix.

Right.

> Basically.  -I. is -I${.OBJDIR} since make runs commands with ${.OBJDIR} as the
> current directory (AFAICT) rather than ${.CURDIR} in the case that there is an
> object directory.  (If there isn't one, ${.OBJDIR} == ${.CURDIR}).  Given that,
> -I. is a lot shorter and easier on the eyes then -I${.OBJDIR}, although I
> personally find it a bit more cryptic since it relies on you grokking the make
> behavior of changing the current directroy to make object directories work.

I find that it helps grokking the necessary -I's :-).  It's very easy to
confuse '.' with ${.CURDIR} if you don't think about it.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020109205650.I7942-100000>