Aw: Re: make .SUFFIXES bug?

Carsten Kunze carsten.kunze at arcor.de
Sat Dec 19 20:31:32 UTC 2015


Thomas Dickey <dickey at his.com> wrote:
> On Tue, Dec 15, 2015 at 04:01:41PM +0100, Carsten Kunze wrote:
> > current groff doesn't build on FreeBSD.  I had noticed the same issue some
> > months ago on NetBSD and cross checked on FreeBSD and it had worked on
> > FreeBSD.  There must have somethig changed since then.  How to reproduce:
> > 
> > When there is a file "test.1.man" and a makefile:
> > 
> > .SUFFIXES:
> > .SUFFIXES: .roff .in .ps .mom .pdf .me .ms .ps .html .txt .texi .dvi .pdf
> > .xhtml .man .c .cpp .log .o .obj .sed .sin .test .test$(EXEEXT) .trs .ypp
 
> According to POSIX
> 
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html
> 
> .SUFFIXES
>     Prerequisites of .SUFFIXES shall be appended to the list of known
> suffixes
>     and are used in conjunction with the inference rules (see Inference
> Rules). 
>     If .SUFFIXES does not have any prerequisites, the list of known
> suffixes
>     shall be cleared.
> 
> and goes on to list the expected suffixes:
> 
> .SUFFIXES: .o .c .y .l .a .sh .f .c? .y? .l? .sh? .f?

Why is this relevant?  The first "empty" .SUFFIXES line in the example
above clears all default (or previously set) suffixes and the second one
sets the project relevant suffixes.  So I can assume that for the following
suffix rules *these* specified suffixes are used.

> > .man:
> >         @echo Making $@ from $<
> >         rm -f $@
> >         @LC_ALL=C \
> >          sed -e "s|foo|bar|g" \
> >          $< >$@
> > 
> > "make test.1" results in "make: don't know how to make test.1. Stop".
> > 
> > When ".man" is put to the start of the list it works.  It also works when
> > the first .SUFFIXES line is removed.
> > 
> > The answer from NetBSD is that this is very likely a bug in make.  May
> > this
> > also be the case for FreeBSD?
 
> That's ironic, considering that a while back they were adamant that if
> the suffix wasn't in the list cited in POSIX, then it was a bug in the
> makefile.

I agree, but ".man" is in the list.
 
> Your example does not list a suffix for ".1".  It would be harmless to
> update groff's makefile to provide that, and a corresponding suffix-rule.

Please don't consider .1 as a suffix here.  The task is to make "test.1", it
could also be named test_1 or whatever.  So according to the known
suffixes make looks for a file "test.1<suffix>" until it finds "test.1.man".
So the ".man:" rule generates a <file> from a <file>.man, in this case
test.1 from test.1.man.  So I do not really see a bug in the makefile.

Carsten


More information about the freebsd-current mailing list