> 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.


_______________________________________________
Groff mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/groff

Reply via email to