[ On , September 6, 2000 at 14:19:23 (+0200), Akim Demaille wrote: ]
> Subject: Re: HTML format documentation
>
> >>>>> "Alexandre" == Alexandre Oliva <[EMAIL PROTECTED]> writes:
>
> Alexandre> Of course, sometimes it's convenient to change these
> Alexandre> options at build time, but the potential for trouble is
> Alexandre> such that I wouldn't recommend this practice.
>
> I would even prevent this practice, make it invalid.
Yes, exactly. "Me too!".
This issue has frustrated me from the very first time I tried to write a
makefile that was even close to conforming to the GNU Coding Standards,
long before autoconf came along.
It is just simply wrong when, using "make" as your dependency
maintenance and build tool, to ever intentionally create a scenario
where the values of environment variables, or even "make" variables that
are expected to be sepcified on the "make" command-line, can be used as
components of products and thus create dependencies of those targets on
those variables. Most (all?) versions of make cannot manage such
dependencies. There are ways that they can sometimes be recorded
externally in ways that "make" can then utilise to detect when targets
depending on their values need to be remade. However in many cases this
is very tedious to do, and of course it's almost impossible to do in a
generic way with portable makefiles.
Although this is straying very far from the topic at hand, I will note
that quite some number of years ago I came up with the idea of recording
the values of all make variables in an external file and checking for
changes on every run, updating the file whenever any variable changed in
value. However at the time I could not come up with a good way to
automatically register dependency on this file for those targets that
required it. All I could come up with was to keep this file in the
directory where make was invoked (one for every directory in the case
where "make" runs in a recursive manner) and to simply allow the
programmer to register dependency on this file for targets that he or
she expected were dependent on some make variable or another.
This whole idea of course had the further problem that a change in the
value of any variable would require rebuilding all targets that depended
on any variable. I've since considered various new makefile syntax that
would allow the programmer to explicitly register a list of variables as
dependencies for a targets, but of course introduction of new syntax in
"make" is also very non-portable....
In the end what this boils down to is that it is currently hard to
prevent this practice, but it should definitely be discourage in
documentation and usage guides.
--
Greg A. Woods
+1 416 218-0098 VE3TCP <[EMAIL PROTECTED]> <robohack!woods>
Planix, Inc. <[EMAIL PROTECTED]>; Secrets of the Weird <[EMAIL PROTECTED]>