Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jun 2010 20:47:21 +0200
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <des@des.no>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        arch@FreeBSD.org
Subject:   Re: Change to config(8) for OFED
Message-ID:  <86zkz05bra.fsf@ds4.des.no>
In-Reply-To: <20100612.111805.94843338670897167.imp@bsdimp.com> (M. Warner Losh's message of "Sat, 12 Jun 2010 11:18:05 -0600 (MDT)")
References:  <alpine.BSF.2.00.1006111611380.1435@desktop> <20100612.101458.10150326125744273.imp@bsdimp.com> <20100612.111805.94843338670897167.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
"M. Warner Losh" <imp@bsdimp.com> writes:
> but NORMAL_C is
>
> NORMAL_C=3D ${CC} -c ${CFLAGS} ${WERROR} ${PROF} ${.IMPSRC}
>
> and .IMPSRC is null.  That seems like a bug to me, but I'm not sure if
> the bug is that .IMPSRC is computed wrong, or if it really should be
> ${.ALLSRC}

.IMPSRC is the *implicit* source and is only valid in *implicit* rules.
Consider the following:

.SUFFIXES: .foo .bar
.foo.bar: foo2bar.sh
        /bin/sh foo2bar.sh ${.IMPSRC} ${.TARGET}

When building hello.bar from hello.foo, .IMPSRC is "hello.foo" but .ALLSRC
is "hello.foo foo2bar.sh".

GNU make has a way of defining more complex implicit rules (pattern
rules).  If we had something similar, we could do:

foo_%.o: %.c
        ${NORMAL_C}

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86zkz05bra.fsf>