[MPlayer-dev-eng] [PATCH] Fix 'make distclean'

Georgi Petrov gogothebee at gmail.com
Tue Feb 3 00:00:41 CET 2009


I found the problem about help_mp.h not being deleted by "make
distclean" under Windows.

When mplayer.exe is run from the svn root directory, it creates a
sub-directory called "mplayer". Please note that if mplayer.exe is
executed from MSYS environment it doesn't create the mplayer sub
directory for some reason, but when executed from windows shell, it
does. Then when "make distclean" is executed, there is the following
line:

rm -f mplayer mencoder

but since "mplayer" is actually a subdirectory (and the "rm" is
supposed to delete the executable *file* mplayer, as it is called in
UNIX), the command fails:

rm -f mplayer mencoder
rm: `mplayer' is a directory
make: *** [clean] Error 1

And the further clean commands after it are not executed, which
includes the following one (which deletes help_mp.h):

rm -f configure.log config.mak config.h codecs.conf.h help_mp.h \
           version.h vidix/pci_dev_ids.c vidix/pci_ids.h
vidix/pci_names.c vidix
            /pci_names.h vidix/pci_vendors.h \
           codec-cfg cpuinfo TAGS tags

The fix is simple. Change

rm -f mplayer mencoder

to:

rm -rf mplayer mencoder

This ensures that make distclean cleans both the executable mplayer
and the sub directory mplayer, so the command always succeeds.

I attach the patch.
-------------- next part --------------
Index: Makefile
===================================================================
--- Makefile	(revision 28448)
+++ Makefile	(working copy)
@@ -930,7 +930,7 @@
 
 clean:
 	rm -f $(foreach dir,$(DIRS),$(foreach suffix,/*.o /*.a /*.ho /*~, $(addsuffix $(suffix),$(dir))))
-	rm -f mplayer$(EXESUF) mencoder$(EXESUF)
+	rm -rf mplayer$(EXESUF) mencoder$(EXESUF)
 
 distclean: clean testsclean toolsclean driversclean dhahelperclean dhahelperwinclean
 	rm -rf DOCS/tech/doxygen


More information about the MPlayer-dev-eng mailing list