diff --git a/Makefile b/Makefile index 4b69318e354e3a19a93211207c840d94cc3f3ff8..56e385825fe9af3b7576ec4b86ca273c704194c2 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 8cea3499f4b96ec218f285478c2f939b3e9fdcfe..5f2a6af9be5c6b0e3a0e7728e8f30aad45156e02 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 a5e195f98964e65007fd9b9f9d4f63516c1ac55f..2182acb652f7c0a9c05569c67ee1c7d6f5a2f532 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 49c3e4f4d95ff2e329ea49cd1c3ce491be6b9b6b..8663754e6701a35f6795817f10535ed749fc177e 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 4c61b4854d289806df765f1da58df5b217c475e3..4eb932953102af6f4c824e01d9999205279ab3cc 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 49c041a4b91063362c8914e087451e95d9466e6e..9eb4dff908f495e713bf22bd0b301930f83bdf03 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 9858180bdf51104cfb9948dfe9f14be154b6fad4..636f1f3118f68ff2426af3a5bf202034ac040609 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 773594c64ce6671523515447dc0a0086bc9028f0..4169e2a154e3e4a825e541f385e66c8ff1c25811 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 c8fe28b2df8b2d895bb18e1f9db727d36257d6bd..0bdb057c236d7a55791c27766b4aa2c20a5f3c40 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 5a2b050725d3df03bd71c30a1776b437566e2633..5b127713d9f372395d4db4bfab868eca5220aa34 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 e97010f0fa2547bbcb596c63d44657b70f083355..391b4550a884ff11a99eb3cffc8fa4ae0da38ac0 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 dd21bbee361f266af44eaee7837b728f06118f49..cc90f358e3adb4f327ab698fef4561e57925bfbc 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