help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dinamic paths


From: Karl Hegbloom
Subject: Re: Dinamic paths
Date: Fri, 08 Jun 2007 09:41:55 -0600

On Thu, 2007-06-07 at 08:39 -0400, Paul Smith wrote:
> On Thu, 2007-06-07 at 00:56 -0600, Karl Hegbloom wrote:
> > On Tue, 2007-06-05 at 10:26 +0100, Manuel Preliteiro wrote:
> > > OCAMLC = ocamlc
> > > OCAMLIBS = $(OCAMLC) -where
> 
> > You can probably do it without resorting to use of the 'shell' function.
> > Grep the info documentation for 'eval', 'computed names' and for
> > 'secondary expansion'.
> 
> No; the point is that the user has to run the program 'ocamlc -where'
> and the output will be the pathname they want.  So, you have to use the
> shell function here.

Ah, sure.  You are right, of course -- I wasn't paying attention and did
not notice that it was running an external command to obtain the value;
I was thinking in terms of forming it from another variable or
something.

Since the output of 'ocamlc -where' is not likely to change over the
course of the build, perhaps it should read:

OCAMLIBS := $(shell $(OCAMLC) -where)
#        ^^  See 'info make' re flavors of variables.

... so that the 'shell' function is run only one time, when the
variable's value is set, rather than each time it is expanded.  There
are no idempotency issues with that particular command so running it
more than one time won't hurt anything, but since the output never
changes, you may as well run it only once and save a few CPU cycles.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]