---
 Makefile   |    2 ++
 subdir.mak |    6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

This is an RFC patch that addresses some oversights in the 'uninstall'
target.  I implemented it to remove absolutely everything that the
'install' target may have dropped onto the filesystem.  This may or may
not be considered overzealous.

Removing BUILT_HEADERS and INCINSTDIR I consider absolutely safe and
essential.  Removing BINDIR, LIBDIR/pkgconfig and MANDIR/man1 may be
discussed, but since it will only remove the directories if they are
empty anyway there should be no negative sideeffects.
diff --git a/Makefile b/Makefile
index afd783d..9facd10 100644
--- a/Makefile
+++ b/Makefile
@@ -146,12 +146,14 @@ uninstall: uninstall-progs uninstall-data uninstall-man
 
 uninstall-progs:
        $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))
+       -rmdir -p "$(BINDIR)"
 
 uninstall-data:
        $(RM) -r "$(DATADIR)"
 
 uninstall-man:
        $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
+       -rmdir -p "$(MANDIR)/man1"
 
 testclean:
        $(RM) -r tests/vsynth1 tests/vsynth2 tests/data
diff --git a/subdir.mak b/subdir.mak
index 7fdeddc..4e397b7 100644
--- a/subdir.mak
+++ b/subdir.mak
@@ -87,9 +87,11 @@ uninstall-libs::
        -$(RM) "$(LIBDIR)/$(LIBNAME)"
 
 uninstall-headers::
-       $(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS))
+       $(RM) $(addprefix "$(INCINSTDIR)/",$(HEADERS) $(BUILT_HEADERS))
        $(RM) "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
-       -rmdir "$(INCDIR)"
+       -rmdir -p "$(INCINSTDIR)"
+       -rmdir -p "$(INCDIR)"
+       -rmdir -p "$(LIBDIR)/pkgconfig"
 endef
 
 $(eval $(RULES))
-- 
1.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to