From 4ef13bdcda317b27b6cb59e7c5d8a9006abb6dc5 Mon Sep 17 00:00:00 2001 From: mogorman Date: Wed, 1 Feb 2006 18:39:41 +0000 Subject: Allows for user to uninstall asterisk binaries bug 6177 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@9052 f38db490-d61c-443f-a65b-d21fe96a405b --- Makefile | 34 ++++++++++++++++++++++++++++++++++ agi/Makefile | 3 +++ apps/Makefile | 2 ++ cdr/Makefile | 2 ++ channels/Makefile | 3 ++- codecs/Makefile | 2 ++ formats/Makefile | 2 ++ funcs/Makefile | 2 ++ pbx/Makefile | 2 ++ res/Makefile | 2 ++ stdtime/Makefile | 2 ++ utils/Makefile | 3 +++ 12 files changed, 58 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 4b69318e3..56e385825 100644 --- a/Makefile +++ b/Makefile @@ -912,3 +912,37 @@ cleantest: if cmp -s .cleancount .lastclean ; then echo ; else \ $(MAKE) clean; cp -f .cleancount .lastclean;\ fi + +_uninstall: + rm -f $(DESTDIR)$(MODULES_DIR)/* + rm -f $(DESTDIR)$(ASTSBINDIR)/*asterisk* + rm -f $(DESTDIR)$(ASTSBINDIR)/astgenkey + rm -f $(DESTDIR)$(ASTSBINDIR)/autosupport + rm -rf $(DESTDIR)$(ASTHEADERDIR) + rm -rf $(DESTDIR)$(ASTVARLIBDIR)/sounds + rm -rf $(DESTDIR)$(ASTVARLIBDIR)/firmware + rm -rf $(DESTDIR)$(ASTMANDIR)/man8 + for x in $(SUBDIRS); do $(MAKE) -C $$x uninstall || exit 1 ; done + +uninstall: _uninstall + @echo " +--------- Asterisk Uninstall Complete -----+" + @echo " + Asterisk binaries, sounds, man pages, +" + @echo " + headers, modules, and firmware builds, +" + @echo " + have all been uninstalled. +" + @echo " + +" + @echo " + To remove ALL traces of Asterisk, +" + @echo " + including configuration, spool +" + @echo " + directories, and logs, run the following +" + @echo " + command: +" + @echo " + +" + @echo " + $(MAKE) uninstall-all +" + @echo " +-------------------------------------------+" + + +uninstall-all: _uninstall + rm -rf $(DESTDIR)$(ASTLIBDIR) + rm -rf $(DESTDIR)$(ASTVARLIBDIR) + rm -rf $(DESTDIR)$(ASTSPOOLDIR) + rm -rf $(DESTDIR)$(ASTETCDIR) + rm -rf $(DESTDIR)$(ASTLOGDIR) + diff --git a/agi/Makefile b/agi/Makefile index 8cea3499f..5f2a6af9b 100644 --- a/agi/Makefile +++ b/agi/Makefile @@ -30,6 +30,9 @@ install: all mkdir -p $(DESTDIR)$(AGI_DIR) for x in $(AGIS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(AGI_DIR) ; done +uninstall: + for x in $(AGIS); do rm -f $(DESTDIR)$(AGI_DIR)/$$x ; done + eagi-test: eagi-test.o $(CC) $(CFLAGS) -o eagi-test eagi-test.o $(LIBS) diff --git a/apps/Makefile b/apps/Makefile index a5e195f98..2182acb65 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -92,6 +92,8 @@ install: all rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so +uninstall: + app_curl.so: app_curl.o $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CURLLIBS) diff --git a/cdr/Makefile b/cdr/Makefile index 49c3e4f4d..8663754e6 100644 --- a/cdr/Makefile +++ b/cdr/Makefile @@ -112,6 +112,8 @@ all: depend $(MODS) install: all for x in $(MODS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done +uninstall: + clean: rm -f *.so *.o .depend diff --git a/channels/Makefile b/channels/Makefile index 4c61b4854..4eb932953 100644 --- a/channels/Makefile +++ b/channels/Makefile @@ -234,6 +234,8 @@ install: all for x in $(CHANNEL_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done if ! [ -f chan_iax.so ]; then rm -f $(DESTDIR)$(MODULES_DIR)/chan_iax.so ; fi +uninstall: + depend: .depend .depend: @@ -241,4 +243,3 @@ depend: .depend env: env - diff --git a/codecs/Makefile b/codecs/Makefile index 49c041a4b..9eb4dff90 100644 --- a/codecs/Makefile +++ b/codecs/Makefile @@ -134,6 +134,8 @@ endif install: all for x in $(CODECS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done +uninstall: + depend: .depend .depend: diff --git a/formats/Makefile b/formats/Makefile index 9858180bd..636f1f311 100644 --- a/formats/Makefile +++ b/formats/Makefile @@ -58,6 +58,8 @@ format_ogg_vorbis.so : format_ogg_vorbis.o install: all for x in $(FORMAT_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done +uninstall: + depend: .depend .depend: diff --git a/funcs/Makefile b/funcs/Makefile index 773594c64..4169e2a15 100644 --- a/funcs/Makefile +++ b/funcs/Makefile @@ -75,6 +75,8 @@ func_odbc.so: func_odbc.o install: all for x in $(FUNCS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done +uninstall: + ifneq ($(wildcard .depend),) include .depend endif diff --git a/pbx/Makefile b/pbx/Makefile index c8fe28b2d..0bdb057c2 100644 --- a/pbx/Makefile +++ b/pbx/Makefile @@ -70,6 +70,8 @@ endif install: all for x in $(PBX_LIBS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done +uninstall: + depend: .depend .depend: diff --git a/res/Makefile b/res/Makefile index 5a2b05072..5b127713d 100644 --- a/res/Makefile +++ b/res/Makefile @@ -83,6 +83,8 @@ install: all echo "*** it if you want to use MusicOnHold ***";\ fi +uninstall: + res_crypto.so: res_crypto.o $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} $(CRYPTO_LIBS) diff --git a/stdtime/Makefile b/stdtime/Makefile index e97010f0f..391b4550a 100644 --- a/stdtime/Makefile +++ b/stdtime/Makefile @@ -8,6 +8,8 @@ libtime.a: $(OBJS) install: +uninstall: + clean: rm -f libtime.a *.o test .depend diff --git a/utils/Makefile b/utils/Makefile index dd21bbee3..cc90f358e 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -40,6 +40,9 @@ install: fi; \ done +uninstall: + for x in $(TARGET); do rm -f $$x $(DESTDIR)$(ASTSBINDIR)/$$x; done + clean: rm -f *.o astman smsq stereorize streamplayer check_expr .depend rm -f ast_expr2.o ast_expr2f.o -- cgit v1.2.3