groff
[Top][All Lists]
Advanced

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

Re: [Groff] Typesetting with groff from Makefiles


From: Keith MARSHALL
Subject: Re: [Groff] Typesetting with groff from Makefiles
Date: Tue, 21 Jun 2005 11:28:44 +0100

> I'll simply use a modified version of Keith's suggestion:
>
> foo.ps: foo.ms
>                groff --some-options foo.ms >$@ \
>                || ($(RM) $@; false)

Indeed, you can use `false', instead of `exit 1', as I suggested.
But note that `false' is *not* a shell builtin in standard Bourne
shell -- it is in `ksh' or `bash' -- so you are potentially adding
an extra external process invocation here.  `exit' is a builtin in
*all* Bourne compatible shells, AFAIK.

> That seems to be a reasonable idiom (although it adds a shell
> invocation or two -- it there a sane, portable  way of
> eliminating the parenthesis?)

You could also try...

  foo.ps: foo.ms
                groff $(GROFF_OPTIONS) foo.ms >$@ \
                || { $(RM) $@; exit 1; }

That should avoid one level of forking in the shell, but note
the extra semicolon, which is required when you use braces in
place of parentheses.  There is also a slight possibility that,
without the extra forked shell, you may not get back the exit
code you expect, at the appropriate time.

HTH.

Best regards,
Keith.




reply via email to

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