[FFmpeg-devel] [RFC] Hack to disable implicit rules

Reimar Döffinger Reimar.Doeffinger
Tue Feb 16 18:59:06 CET 2010


On Tue, Feb 16, 2010 at 09:43:34AM +0000, M?ns Rullg?rd wrote:
> Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:
> 
> > Hello,
> > since I've only recently seen them causing issues (mostly due to MinGW and
> > Cygwin make being broken most of the time) and found a way that seems
> > to disable them (although maybe more as a side-effect), I'd like to propose
> > this patch.
> > What are your opinions?
> > Index: common.mak
> > ===================================================================
> > --- common.mak	(revision 21840)
> > +++ common.mak	(working copy)
> > @@ -4,6 +4,10 @@
> >
> >  all: # make "all" default target
> >
> > +# disable suffix rules, we do not use them and like this we avoid (most?)
> > +# implicit rules which might cause slowdowns or bugs
> > +.SUFFIXES:
> > +
> 
> Does this fix an actual problem?

Not for FFmpeg, no.

> I already looked at this, and that
> pseudo-target doesn't actually disable much at all, only the old .c.o
> style rules.  New-style %.c:%.o builtin rules are still in effect.

Are there any?
In my tests and with -d, this seemed to behave the same way as make -r
(correction: a proper test suggests a small handful of rules remain).
I can say for sure that there are no builtin "new-style" rules at least for
.c -> .o and .S -> .o
For targets with .o or no extension, the only rules left seem to be related to
RCS, e.g. using a Makefile only containing above .SUFFIXES line:
> make -d test.o
Considering target file `test.o'.
 File `test.o' does not exist.
 Looking for an implicit rule for `test.o'.
 Trying pattern rule with stem `test.o'.
 Trying implicit prerequisite `test.o,v'.
 Trying pattern rule with stem `test.o'.
 Trying implicit prerequisite `RCS/test.o,v'.
 Trying pattern rule with stem `test.o'.
 Trying implicit prerequisite `RCS/test.o'.
 Trying pattern rule with stem `test.o'.
 Trying implicit prerequisite `s.test.o'.
 Trying pattern rule with stem `test.o'.
 Trying implicit prerequisite `SCCS/s.test.o'.
 No implicit rule found for `test.o'.

> make -d test
Considering target file `test'.
 Looking for an implicit rule for `test'.
 Trying pattern rule with stem `test'.
 Trying implicit prerequisite `test,v'.
 Trying pattern rule with stem `test'.
 Trying implicit prerequisite `RCS/test,v'.
 Trying pattern rule with stem `test'.
 Trying implicit prerequisite `RCS/test'.
 Trying pattern rule with stem `test'.
 Trying implicit prerequisite `s.test'.
 Trying pattern rule with stem `test'.
 Trying implicit prerequisite `SCCS/s.test'.
 No implicit rule found for `test'.

The output with an empty Makefile is a lot longer, and at least contains rules for .c, .cpp,
.f, .C, .cc, .F, .y, .s, .S, .r, .p, .l, .w, .web, .mod, .sh and maybe more.



More information about the ffmpeg-devel mailing list