Change draft gmake control
I had to change the draft flag for SGML from 'gmake draft html' to
'gmake DRAFT=Y html'. Internally the code used to recurse with DRAFT=Y,
but I found there is no way to exit the makefile after the recursion
returned, so I had to use this new syntax. Though more cumbersome, it
is more logical because DRAFT is really a modifier, not a rule itself.
For example, 'gmake html draft' would never have worked. Patch attached
and applied.
--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
Attachments:
/rtmp/difftext/x-diffDownload+6-20
Bruce Momjian wrote:
I had to change the draft flag for SGML from 'gmake draft html' to
'gmake DRAFT=Y html'. Internally the code used to recurse with
DRAFT=Y, but I found there is no way to exit the makefile after the
recursion returned,
exit 0 ?
so I had to use this new syntax. Though more
cumbersome, it is more logical because DRAFT is really a modifier,
not a rule itself. For example, 'gmake html draft' would never have
worked.
What would have been the meaning of that command?
Anyway, certainly you could write this to preserve the target:
draft:
$(MAKE) html DRAFT=Y
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
Peter Eisentraut wrote:
Bruce Momjian wrote:
I had to change the draft flag for SGML from 'gmake draft html' to
'gmake DRAFT=Y html'. Internally the code used to recurse with
DRAFT=Y, but I found there is no way to exit the makefile after the
recursion returned,exit 0 ?
I tried that, but it did nothing. Of course exit 1 works, but throws an
error, and exec exit 0 doesn't work either, throws an error.
so I had to use this new syntax. Though more
cumbersome, it is more logical because DRAFT is really a modifier,
not a rule itself. For example, 'gmake html draft' would never have
worked.What would have been the meaning of that command?
Nothing, but the point is that draft is a modifier and it isn't clear
from that syntax that draft is a modifier and not a target.
Anyway, certainly you could write this to preserve the target:
draft:
$(MAKE) html DRAFT=Y
The problem is that the 'gmake' recursion is done, but then returns and
runs the hhml again, so 'gmake draft html' calls "$(MAKE) html DRAFT=Y"
and on return from that, the html is called again and rebuilds, so it
isn't really draft.
--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
Bruce Momjian wrote:
Nothing, but the point is that draft is a modifier and it isn't clear
from that syntax that draft is a modifier and not a target.
Anyway, certainly you could write this to preserve the target:
draft:
$(MAKE) html DRAFT=YThe problem is that the 'gmake' recursion is done, but then returns
and runs the hhml again, so 'gmake draft html' calls "$(MAKE) html
DRAFT=Y" and on return from that, the html is called again and
rebuilds, so it isn't really draft.
Well, "gmake draft html" doesn't make any sense anyway, but "gmake
draft" by itself does and the new way of writing it is significantly
more cumbersome, so I request that this be fixed.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
Bruce Momjian <bruce@momjian.us> writes:
Peter Eisentraut wrote:
Anyway, certainly you could write this to preserve the target:
draft:
$(MAKE) html DRAFT=Y
The problem is that the 'gmake' recursion is done, but then returns and
runs the hhml again, so 'gmake draft html' calls "$(MAKE) html DRAFT=Y"
and on return from that, the html is called again and rebuilds, so it
isn't really draft.
No, the point is that "gmake draft" ought to work. I'm not sure where
you came up with the idea that "gmake draft html" was a sane command,
but it certainly wasn't what was proposed initially.
regards, tom lane
Peter Eisentraut wrote:
Bruce Momjian wrote:
Nothing, but the point is that draft is a modifier and it isn't clear
from that syntax that draft is a modifier and not a target.
Anyway, certainly you could write this to preserve the target:
draft:
$(MAKE) html DRAFT=YThe problem is that the 'gmake' recursion is done, but then returns
and runs the hhml again, so 'gmake draft html' calls "$(MAKE) html
DRAFT=Y" and on return from that, the html is called again and
rebuilds, so it isn't really draft.Well, "gmake draft html" doesn't make any sense anyway, but "gmake
draft" by itself does and the new way of writing it is significantly
more cumbersome, so I request that this be fixed.
Well, if 'draft' was only for html, I could see suggesting just 'gmake
draft', but 'draft' can be used for Postscript and PDF too.
--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +
Bruce Momjian wrote:
Well, if 'draft' was only for html, I could see suggesting just 'gmake
draft', but 'draft' can be used for Postscript and PDF too.
The maybe have targets draft-html, draft-postscript and draft-pdf ?
cheers
andrew
Bruce Momjian <bruce@momjian.us> writes:
Well, if 'draft' was only for html, I could see suggesting just 'gmake
draft', but 'draft' can be used for Postscript and PDF too.
But those aren't cases where saving some typing is useful (in fact,
I'd bet money that no one will ever use them). Draft runs with html
output are highly useful, and like Peter I think "make draft" ought
to work for that.
regards, tom lane
Tom Lane wrote:
Bruce Momjian <bruce@momjian.us> writes:
Well, if 'draft' was only for html, I could see suggesting just 'gmake
draft', but 'draft' can be used for Postscript and PDF too.But those aren't cases where saving some typing is useful (in fact,
I'd bet money that no one will ever use them). Draft runs with html
output are highly useful, and like Peter I think "make draft" ought
to work for that.
OK, if that's what people want. Patch attached and applied, docs
updated.
--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com
+ If your life is a hard drive, Christ can be your backup. +