[svn-commits] kpfleming: linux/trunk r4571 - /linux/trunk/Makefile

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jul 8 13:45:04 CDT 2008


Author: kpfleming
Date: Tue Jul  8 13:45:03 2008
New Revision: 4571

URL: http://svn.digium.com/view/dahdi?view=rev&rev=4571
Log:
clean up install and uninstall targets, and make 'uninstall' target completely functional

Modified:
    linux/trunk/Makefile

Modified: linux/trunk/Makefile
URL: http://svn.digium.com/view/dahdi/linux/trunk/Makefile?view=diff&rev=4571&r1=4570&r2=4571
==============================================================================
--- linux/trunk/Makefile (original)
+++ linux/trunk/Makefile Tue Jul  8 13:45:03 2008
@@ -92,7 +92,7 @@
 stackcheck: checkstack modules
 	./checkstack kernel/*.ko kernel/*/*.ko
 
-install: all devices install-modules install-include install-firmware
+install: all install-modules install-devices install-include install-firmware
 	@echo "###################################################"
 	@echo "###"
 	@echo "### DAHDI installed successfully."
@@ -101,6 +101,8 @@
 	@echo "###"
 	@echo "###################################################"
 
+uninstall: uninstall-modules uninstall-devices uninstall-include uninstall-firmware
+
 install-modconf:
 	build_tools/genmodconf $(BUILDVER) "$(ROOT_PREFIX)" "$(filter-out dahdi dahdi_dummy xpp dahdi_transcode dahdi_dynamic,$(BUILD_MODULES)) $(MODULE_ALIASES)"
 	@if [ -d /etc/modutils ]; then \
@@ -111,6 +113,9 @@
 ifeq ($(HOTPLUG_FIRMWARE),yes)
 	$(MAKE) -C drivers/dahdi/firmware hotplug-install DESTDIR=$(DESTDIR) HOTPLUG_FIRMWARE=$(HOTPLUG_FIRMWARE)
 endif
+
+uninstall-firmware:
+	$(MAKE) -C drivers/dahdi/firmware hotplug-uninstall DESTDIR=$(DESTDIR)
 
 install-include:
 	install -D -m 644 include/dahdi/kernel.h $(DESTDIR)/usr/include/dahdi/kernel.h
@@ -118,8 +123,15 @@
 # Include any driver-specific header files here
 	install -D -m 644 include/dahdi/wctdm_user.h $(DESTDIR)/usr/include/dahdi/wctdm_user.h
 
-devices:
-ifneq (yes,$(DYNFS))
+uninstall-include:
+	rm -f $(DESTDIR)/usr/include/dahdi/kernel.h
+	rm -f $(DESTDIR)/usr/include/dahdi/user.h
+# Include any driver-specific header files here
+	rm -f $(DESTDIR)/usr/include/dahdi/wctdm_user.h
+	-rmdir $(DESTDIR)/usr/include/dahdi
+
+install-devices:
+ifndef DYNFS
 	mkdir -p $(DESTDIR)/dev/dahdi
 	rm -f $(DESTDIR)/dev/dahdi/ctl
 	rm -f $(DESTDIR)/dev/dahdi/channel
@@ -146,24 +158,16 @@
 	build_tools/genudevrules > $(DESTDIR)/etc/udev/rules.d/dahdi.rules
 endif
 
-install-udev: devices
-
-uninstall-hotplug:
-	$(MAKE) -C drivers/dahdi/firmware hotplug-uninstall DESTDIR=$(DESTDIR)
-
-uninstall-modules:
-ifdef DESTDIR
-	echo "Uninstalling modules is not supported with a custom DESTDIR."
-	exit 1
-else
-	echo -n "Removing DAHDI modules for kernel $(KVERS), please wait..."
-	@build_tools/uninstall-modules dahdi $(KVERS)
-	echo "done."
+uninstall-devices:
+ifndef DYNFS
+	-rm -rf $(DESTDIR)/dev/dahdi
+else # DYNFS
+	rm -f $(DESTDIR)/etc/udev/rules.d/dahdi.rules
 endif
 
 install-modules: modules
 ifndef DESTDIR
-	@if modinfo zaptel 2>&1 > /dev/null; then \
+	@if modinfo zaptel > /dev/null 2>&1; then \
 		echo -n "Removing Zaptel modules for kernel $(KVERS), please wait..."; \
 		build_tools/uninstall-modules zaptel $(KVERS); \
 		echo "done."; \
@@ -171,6 +175,20 @@
 endif
 	$(KMAKE) INSTALL_MOD_PATH=$(DESTDIR) INSTALL_MOD_DIR=dahdi modules_install
 	[ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
+
+uninstall-modules:
+ifdef DESTDIR
+	echo "Uninstalling modules is not supported with a DESTDIR specified."
+	exit 1
+else
+	@if modinfo dahdi> /dev/null 2>&1 ; then \
+		echo -n "Removing DAHDI modules for kernel $(KVERS), please wait..."; \
+		build_tools/uninstall-modules dahdi $(KVERS); \
+		echo "done."; \
+	fi
+	@rm -rf /lib/modules/$(KVERS)/dahdi
+	[ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
+endif
 
 update:
 	@if [ -d .svn ]; then \




More information about the svn-commits mailing list