Change draft gmake control

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Change draft gmake control
Дата
Msg-id 200701262230.l0QMUrp07574@momjian.us
обсуждение исходный текст
Ответы Re: Change draft gmake control  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-docs
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. +
Index: Makefile
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/Makefile,v
retrieving revision 1.91
diff -c -r1.91 Makefile
*** Makefile    11 Jan 2007 00:02:39 -0000    1.91
--- Makefile    26 Jan 2007 22:19:58 -0000
***************
*** 64,70 ****
  ## Man pages
  ##

! .PHONY: man draft

  DEFAULTSECTION := $(sqlmansect_dummy)

--- 64,70 ----
  ## Man pages
  ##

! .PHONY: html man draft clean

  DEFAULTSECTION := $(sqlmansect_dummy)

***************
*** 86,93 ****

  all: html

- .PHONY: html
-
  # This is run for all output formats because we need bookindex.sgml
  html: postgres.sgml $(ALLSGML) stylesheet.dsl
      @rm -f *.html
--- 86,91 ----
***************
*** 95,101 ****
  ifeq ($(vpath_build), yes)
      @cp $(srcdir)/stylesheet.css .
  endif
! ifndef DRAFT
  # If not draft, re-run the this rule until HTML.index does not change
      @cmp -s HTML.index.start HTML.index || $(MAKE) $@
  endif
--- 93,99 ----
  ifeq ($(vpath_build), yes)
      @cp $(srcdir)/stylesheet.css .
  endif
! ifneq ($(DRAFT), Y)
  # If not draft, re-run the this rule until HTML.index does not change
      @cmp -s HTML.index.start HTML.index || $(MAKE) $@
  endif
***************
*** 103,120 ****

  COLLATEINDEX := LC_ALL=C $(PERL) $(COLLATEINDEX) -f -g

- # The draft rule calls gmake again and sets the DRAFT variable.
- # This seems to be the only way to set gmake variables in a rule.
- draft:
- ifndef DRAFT
- ifneq ($(MAKECMDGOALS), draft)
-     @$(MAKE) DRAFT="Y" $(MAKECMDGOALS)
- else
- # simulate $(MAKE) with no arguments
-     @$(MAKE) DRAFT="Y" all
- endif
- endif
-
  # bookindex.sgml is required so there is a proper index for all output formats
  bookindex.sgml: HTML.index
  # create a dummy bookindex.html
--- 101,106 ----
Index: docguide.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/docguide.sgml,v
retrieving revision 1.65
diff -c -r1.65 docguide.sgml
*** docguide.sgml    11 Jan 2007 00:02:39 -0000    1.65
--- docguide.sgml    26 Jan 2007 22:19:59 -0000
***************
*** 546,552 ****
      stages.  If you do not care about the index, and just want to
      proof-read the output, use <literal>draft</>:
  <screen>
! <prompt>doc/src/sgml$ </prompt><userinput>gmake draft html</userinput>
  </screen>
     </para>

--- 546,552 ----
      stages.  If you do not care about the index, and just want to
      proof-read the output, use <literal>draft</>:
  <screen>
! <prompt>doc/src/sgml$ </prompt><userinput>gmake DRAFT=Y html</userinput>
  </screen>
     </para>


В списке pgsql-docs по дате отправления:

Предыдущее
От: "Thomas F. O'Connell"
Дата:
Сообщение: Re: 14.4 If You Are Upgrading - Suggested Improvements
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: 14.4 If You Are Upgrading - Suggested Improvements