uninstallation support
authorDiego Biurrun <diego@biurrun.de>
Thu, 18 May 2006 12:14:02 +0000 (12:14 +0000)
committerDiego Biurrun <diego@biurrun.de>
Thu, 18 May 2006 12:14:02 +0000 (12:14 +0000)
inspired by a patch from Richard, richiek.,@,.optushome.,.,.com.,.,.au

Originally committed as revision 5398 to svn://svn.ffmpeg.org/ffmpeg/trunk

Makefile
common.mak
vhook/Makefile

index 4ccfa04..3692672 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -156,6 +156,35 @@ ifeq ($(CONFIG_PP),yes)
        $(MAKE) -C libavcodec/libpostproc install-headers
 endif
 
        $(MAKE) -C libavcodec/libpostproc install-headers
 endif
 
+uninstall: uninstall-progs uninstall-libs uninstall-headers uninstall-man uninstall-vhook
+
+ALLPROGS=ffmpeg ffplay ffserver
+uninstall-progs:
+       rm -f $(addprefix $(bindir)/, $(ALLPROGS))
+
+ALLMANPAGES=$(addsuffix .1, $(ALLPROGS))
+uninstall-man:
+ifneq ($(CONFIG_WIN32),yes)
+       rm -f $(addprefix $(mandir)/man1/,$(ALLMANPAGES))
+endif
+
+uninstall-vhook:
+       $(MAKE) -C vhook uninstall
+
+uninstall-libs:
+       $(MAKE) -C libavutil   uninstall-libs
+       $(MAKE) -C libavcodec  uninstall-libs
+       $(MAKE) -C libavformat uninstall-libs
+       $(MAKE) -C libavcodec/libpostproc uninstall-libs
+
+uninstall-headers:
+       $(MAKE) -C libavutil   uninstall-headers
+       $(MAKE) -C libavcodec  uninstall-headers
+       $(MAKE) -C libavformat uninstall-headers
+       $(MAKE) -C libavcodec/libpostproc uninstall-headers
+       -rmdir "$(incdir)"
+       -rmdir "$(prefix)/include/postproc"
+
 dep:   depend
 
 depend: .depend
 dep:   depend
 
 depend: .depend
index 94272c5..ff25cf6 100644 (file)
@@ -96,6 +96,22 @@ install-headers:
        install -m 644 $(addprefix "$(SRC_DIR)"/,$(HEADERS)) "$(incdir)"
        install -m 644 $(BUILD_ROOT)/lib$(NAME).pc "$(libdir)/pkgconfig"
 
        install -m 644 $(addprefix "$(SRC_DIR)"/,$(HEADERS)) "$(incdir)"
        install -m 644 $(BUILD_ROOT)/lib$(NAME).pc "$(libdir)/pkgconfig"
 
+uninstall: uninstall-libs uninstall-headers
+
+uninstall-libs:
+ifeq ($(CONFIG_WIN32),yes)
+       -rm -f $(prefix)/$(SLIBNAME)
+else
+       -rm -f $(libdir)/$(SLIBNAME_WITH_MAJOR) \
+             $(libdir)/$(SLIBNAME)            \
+             $(libdir)/$(SLIBNAME_WITH_VERSION)
+endif
+       -rm -f $(libdir)/$(LIB)
+
+uninstall-headers:
+       rm -f $(addprefix $(incdir)/,$(HEADERS))
+       rm -f $(libdir)/pkgconfig/lib$(NAME).pc
+
 #
 # include dependency files if they exist
 #
 #
 # include dependency files if they exist
 #
index a176fd0..7e073e7 100644 (file)
@@ -32,6 +32,11 @@ install: $(HOOKS)
        install -d "$(libdir)/vhook"
        install -m 755 $(HOOKS) "$(libdir)/vhook"
 
        install -d "$(libdir)/vhook"
        install -m 755 $(HOOKS) "$(libdir)/vhook"
 
+ALLHOOKS=$(HOOKS) imlib2$(SLIBSUF) drawtext$(SLIBSUF)
+uninstall:
+       rm -f $(addprefix $(libdir)/vhook/,$(ALLHOOKS))
+       -rmdir "$(libdir)/vhook/"
+
 %$(SLIBSUF): %.o
        $(CC) $(LDFLAGS) -g -o $@ $(SHFLAGS) $<
 
 %$(SLIBSUF): %.o
        $(CC) $(LDFLAGS) -g -o $@ $(SHFLAGS) $<