[Top][All Lists]

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

Re: Generating 'cat' pages on make install

From: Jason Curl
Subject: Re: Generating 'cat' pages on make install
Date: Sun, 04 Nov 2007 19:59:28 +0100
User-agent: Thunderbird (Windows/20070728)

Benoit SIGOURE wrote:
On Nov 4, 2007, at 2:40 PM, Jason Curl wrote:

So let's assume I've got a command on my build environment

groff -Tascii -mandoc myman.3 | col -b > mycat.3

I might even extend this to generate HTML instead of ASCII.

Later I'd be implementing a Perl script to convert what is in code comments to something else to then generate the man pages. These man pages document an API.
Well, may be I'll rephrase the question: Given a list of man pages in my, how can I write or extend automake (hopefully easily) to use that list that is already defined to run a command and copy it somewhere on make install, using the example I've provided?

I'd like to keep it in Automake if possible rather than having preconfigure, postconfigure scripts.

Hi Jason,
there are plenty of scripts to convert man pages to HTML (google://man2html) you don't need to write yours ;)
what I'd do in such a situation is:
Later I'd rather have all documentation embedded in my C code to reduce maintenance a little and a Perl script to extract what I want from C code was what I was referring to. I've started looking at how glibc does it. man2html is only the last step.

But I like your tip.
man3_MANS = myman.3 foo.3
man1_MANS = otherman.1
html_DATA = $(man3_MANS:.3=.html) $(man1_MANS:.1=.html)

    $(MAN2HTML) $^ -o $@
    $(MAN2HTML) $^ -o $@

You don't need to change Automake or whatever. It's pretty simple and self-contained.
That's what I like, neat, small and self contained. Makes programming an art. But I'm having a bit of a programmers block.

I've implemented the following:

-----8<---- ----
man_MANS =                                                      \
   libmofo.3                                                   \
   convertstring.3                                             \
   mofobuilddate.3 mofobuildhost.3 mofoversion.3 mofoendian.3  \

html_DATA = $(man_MANS:.3=.html)



all-local: $(html_DATA)

# When we 'make' we create the .html files
SUFFIXES = .html
   @MAN2HTML@ $^ > $@
-----8<---- ----

I haven't figured out how to define the variable $(MAN2HTML) instead using automake substitution with @address@hidden Did I miss something?

How can I prevent the rule from running if the user doesn't have 'man2html' in their path? I don't think I can just use a "dummy" command like echo, as the /usr/bin/install command would return an error:

/usr/bin/install -c -m 644 '../../../../code/libmofo/man/convertstring.html' '/home/jcurl/mofo/build/windows/release/share/doc/libm
/usr/bin/install: cannot stat `../../../../code/libmofo/man/convertstring.html': No such file or directory
make[3]: *** [install-htmlDATA] Error 1
make[3]: Leaving directory `/home/jcurl/mofo/build/windows/libmofo/man'
make[2]: *** [install-am] Error 2
make[2]: Leaving directory `/home/jcurl/mofo/build/windows/libmofo/man'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/jcurl/mofo/build/windows/libmofo'
make: *** [install-recursive] Error 1

Definitely not what I want...

reply via email to

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