Makefile and nested variables question
Bryan Drewery
bdrewery at FreeBSD.org
Sat Feb 10 00:00:04 UTC 2018
On 2/9/2018 9:02 AM, Johannes Lundberg wrote:
> Hi
>
> Is there some way to use nested variables in the dependency line like so:
>
> ${OBJS}: ${${.TARGET:S/$/_DEPS/}}
>
> In my case I get nothing..
>
I think I need more details. That line won't work. ${.TARGET} is only
defined *in a running target*, not while declaring dependencies.
If these OBJS are C files then this syntax may be enough to only declare
the dependencies when really needed.
OBJS_DEPEND_GUESS.foo.o += bar.h bar.c
Rather than what I think you tried:
foo.o_DEPS += bar.h bar.c
If you want them declared always (ignoring .depend files) then just:
foo.o: bar.h bar.c
--
Regards,
Bryan Drewery
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20180209/a744d168/attachment.sig>
More information about the freebsd-current
mailing list