[GRASS-dev] trouble with man page generation

Glynn,

I have the feeling the latest change in the man/Makefile [1] has introduced a bug. When I run make in that directory nothing happens. When I use the previous version of the Makefile, man pages get created.

Moritz

[1] http://freegis.org/cgi-bin/viewcvs.cgi/grass6/man/Makefile.diff?r1=1.5&r2=1.6

Moritz Lennert wrote:

I have the feeling the latest change in the man/Makefile [1] has
introduced a bug. When I run make in that directory nothing happens.
When I use the previous version of the Makefile, man pages get created.

Which version of make are you using?

Also, do the manual pages already exist? They won't be re-created if
they're newer than the HTML files (the previous version would always
re-create them).

--
Glynn Clements <glynn@gclements.plus.com>

On Mon, October 8, 2007 17:37, Glynn Clements wrote:

Moritz Lennert wrote:

I have the feeling the latest change in the man/Makefile [1] has
introduced a bug. When I run make in that directory nothing happens.
When I use the previous version of the Makefile, man pages get created.

Which version of make are you using?

GNU Make 3.81

Also, do the manual pages already exist? They won't be re-created if
they're newer than the HTML files (the previous version would always
re-create them).

Running make distclean, then configure & make, I get no errors during
compilation, but there is no man directory in dist.i486-pc-linux-gnu/.
When I revert to the previous version of the Makefile, I get
dist.i486-pc-linux-gnu/man/man1 populated with the man pages.

I'm no expert in Makefiles at all, but in the current version we have

[...]
MANPAGES := $(patsubst $(HTMLDIR)/%.html,$(MANDIR)/%.$(SECT),$(wildcard
$(HTMLDIR)/*.html))

include $(MODULE_TOPDIR)/include/Make/Dir.make

default: $(MANPAGES)

$(MANDIR):
  $(MKDIR) $(MANDIR)

$(MANDIR)/%.$(SECT): $(HTMLDIR)/%.html | $(MANDIR)

The default is $(MANPAGES), is this a valid target ?

Moritz

Moritz Lennert wrote:

>> I have the feeling the latest change in the man/Makefile [1] has
>> introduced a bug. When I run make in that directory nothing happens.
>> When I use the previous version of the Makefile, man pages get created.
>
> Which version of make are you using?

GNU Make 3.81

Same here.

> Also, do the manual pages already exist? They won't be re-created if
> they're newer than the HTML files (the previous version would always
> re-create them).

Running make distclean, then configure & make, I get no errors during
compilation, but there is no man directory in dist.i486-pc-linux-gnu/.
When I revert to the previous version of the Makefile, I get
dist.i486-pc-linux-gnu/man/man1 populated with the man pages.

Duh; it's because I moved the "include" line (unnecessarily). The
MANDIR and HTMLDIR variables depend upon GISBASE, but it isn't set
until Dir.make gets included. I have GISBASE set in my normal shell
environment, and make was picking it up from there.

Fixed in CVS as:

--- man/Makefile 30 Sep 2007 12:10:30 -0000 1.6
+++ man/Makefile 8 Oct 2007 22:43:05 -0000
@@ -1,5 +1,7 @@
MODULE_TOPDIR = ..

+include $(MODULE_TOPDIR)/include/Make/Dir.make
+
# some definitions
SECT = 1
MANDIR = $(GISBASE)/man/man$(SECT)
@@ -7,8 +9,6 @@
HTML2MAN = GRASS_PERL=${PERL} VERSION_NUMBER=${GRASS_VERSION_NUMBER} sh $(GRASS_HOME)/tools/g.html2man/g.html2man

MANPAGES := $(patsubst $(HTMLDIR)/%.html,$(MANDIR)/%.$(SECT),$(wildcard $(HTMLDIR)/*.html))
-
-include $(MODULE_TOPDIR)/include/Make/Dir.make

default: $(MANPAGES)

I'm wondering if this has caused me to miss other build problems.

--
Glynn Clements <glynn@gclements.plus.com>