Re: [AD] Makedoc patch (was: 4.0.x branch)

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Mon, Feb 18, 2002 at 10:31:47PM +0100, Eric Botcazou wrote:
> > The docs look really nice with this :) I also updated my patch to
> > generate a .chm, to work with the new makedoc.
> 
> I think we could merge it (but I won't do it myself).  Grzegorz, do
> you agree ?

Of course. The compiled help looks really nice with css and Elias' patch
has been sitting in my mail inbox for some time. I was going to merge
it myself after the first patch was commited, but Elias was faster than me.

> > make docs
> > cd docs
> > makedoc -hhc allegro.hhc -hhp allegro.hhp -hhk allegro.hhk src/allegro._tx
> > hhc allegro.hhp
> 
> Ouch ! A little bit complicated, don't you think ?
> We could add it to makefile.all and create a new docs/chm directory.

The chm help file can be generated more easily without intervention from
the user through an optional windows specific chm-docs target, which
can be suggested after the compilation like with "install-gzipped-info"
under unix.  Now that makedoc is split into the _tx reader and the
output generators, the chm generator could call the html generator
(just in case), generate the hhc, hhp and hhk files and finally call
hhc all himself. This can be done with a simple 'system' call, not very
elegant but functional. Or something more clever #ifdef'ed for being
DJGPP specific.

I won't be doing this myself due to lack of time, but Elias, if you are
willing to modify your patch, create a wrapper like write_chm for this
which calls write_html (maybe in a custom chm directory to not overwrite
the html one if this is considered harmful), write_hhp, write_hhk and
write_hhc (which then could be made static internal). The first thing
to do in the wrapper is to check for the existance of hhc.exe and exit
if it's not found.

You proposed doing this with the makefile, but it's safer if you use
getenv, strtok and fstat to check in a loop the presence of the binary
somewhere in the PATH environment variable.  A refinement would be to even
run "hhc -v" or something like that to check the output for a specific
string, but I haven't tried if hhc supports such a 'friendly' feature. In
any case, makedoc should report a verbose error message with instructions
of what to do (where to get the hhc compiler) in case hhc.exe isn't found.

-- 
 Grzegorz Adam Hankiewicz   gradha@xxxxxxxxxx   http://gradha.infierno.org/



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/