[MPlayer-dev-eng] [PATCH] make clean should remove all files generated by make

Diego Biurrun diego at biurrun.de
Wed Nov 14 12:13:06 CET 2012


On Tue, Oct 02, 2012 at 07:36:56PM +0300, Ivan Kalvachev wrote:
> On 9/27/12, Diego Biurrun <diego at biurrun.de> wrote:
> > On Mon, Sep 24, 2012 at 07:32:06PM +0200, Reimar Döffinger wrote:
> >> I don't know what the idea behind the current split between "clean"
> >> and "distclean" is.
> >> But IMHO "make clean" should remove all files that "make" can
> >> regenerate, only leaving stuff e.g. generated by configure.
> >> Do you agree?
> >
> > That's the basic idea.
> >
> >> --- Makefile	(revision 35213)
> >> +++ Makefile	(working copy)
> >> @@ -972,17 +972,17 @@
> >>  clean:
> >>  	-$(MAKE) -C ffmpeg $@
> >>  	-rm -rf tests/res
> >> -	-rm -f $(call ADD_ALL_DIRS,/*.o /*.a /*.ho /*~)
> >> +	-rm -f $(call ADD_ALL_DIRS,/*.o /*.d /*.a /*.ho /*~)
> >
> > Removing .d files on distclean is probably a leftover from the times when
> > .d files were not generated as a sideeffect of compilation and generating
> > them all at every make invocation was costly.
> 
> AFAIK, The make bug is still present.
> The one where you get error when file have been removed or renamed but
> its dependency is still present in the build directory.

This is not a bug in make; it's a peculiarity that arises from generating
dependencies automatically.  The .d files contain references to a file
that does not exist (anymore), thus make looks for a rule to generate the
file and fails to find one.  Then make (rightfully) complains that a file
it is supposed to build depends on something else that make knows not how
to build...

Diego


More information about the MPlayer-dev-eng mailing list