[zaptel-commits] file: branch 1.4 r2158 - in /branches/1.4: Makefile firmware/Makefile

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Mon Feb 12 16:13:40 MST 2007


Author: file
Date: Mon Feb 12 17:13:39 2007
New Revision: 2158

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2158
Log:
Add hotplug-uninstall target to main Makefile and make the firmware Makefile keep a record of the installed firmware in the hotplug directory. This means that as long as you have the latest version of firmware installed your checkout will never install it again, and all new checkouts will not either. This might also help those building packages for distros.

Modified:
    branches/1.4/Makefile
    branches/1.4/firmware/Makefile

Modified: branches/1.4/Makefile
URL: http://svn.digium.com/view/zaptel/branches/1.4/Makefile?view=diff&rev=2158&r1=2157&r2=2158
==============================================================================
--- branches/1.4/Makefile (original)
+++ branches/1.4/Makefile Mon Feb 12 17:13:39 2007
@@ -372,6 +372,9 @@
   endif
 endif
 
+hotplug-uninstall:
+	$(MAKE) -C firmware hotplug-uninstall
+
 xpp-install:
 ifneq (,$(findstring xpp,$(obj-m)))
 	@$(MAKE) -C xpp/utils install

Modified: branches/1.4/firmware/Makefile
URL: http://svn.digium.com/view/zaptel/branches/1.4/firmware/Makefile?view=diff&rev=2158&r1=2157&r2=2158
==============================================================================
--- branches/1.4/firmware/Makefile (original)
+++ branches/1.4/firmware/Makefile Mon Feb 12 17:13:39 2007
@@ -58,11 +58,69 @@
 		exit 1; \
 	fi
 
-# Download and extract firmware tarball
-zaptel-fw-%.tar.gz: have_download
-	@if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;	
+# Download and extract firmware tarballs
+zaptel-fw-oct6114-064-%.tar.gz: have_download
+ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" == "no" ] ) || ( [ -d $(INSTALL_PREFIX)/usr/lib/hotplug/firmware ] && ! [ -f $(INSTALL_PREFIX)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION) ] ) || ( [ -d $(INSTALL_PREFIX)/lib/firmware ] && ! [ -f $(INSTALL_PREFIX)/lib/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
+	@echo "Attempting to download $@"
+	@if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
 	if test ! -f $@; then exit 1; fi; \
 	(cat $@ | gzip -d | tar -xf -)
+ifeq ($(HOTPLUG_FIRMWARE),yes)
+	@echo "Installing zaptel-fw-oct6114-064.bin to hotplug firmware directories"
+	if [ -d $(INSTALL_PREFIX)/usr/lib/hotplug/firmware ]; then \
+		$(INSTALL) -m 644 zaptel-fw-oct6114-064.bin $(INSTALL_PREFIX)/usr/lib/hotplug/firmware; \
+		touch $(INSTALL_PREFIX)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION); \
+	fi
+	if [ -d $(INSTALL_PREFIX)/lib/firmware ]; then \
+		$(INSTALL) -m 644 zaptel-fw-oct6114-064.bin $(INSTALL_PREFIX)/lib/firmware; \
+		touch $(INSTALL_PREFIX)/lib/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION); \
+	fi
+endif
+else
+	@echo "Firmware zaptel-fw-oct6114-064.bin is already installed with latest version $(OCT6114_064_VERSION)"
+endif
+
+zaptel-fw-oct6114-128-%.tar.gz: have_download
+ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" == "no" ] ) || ( [ -d $(INSTALL_PREFIX)/usr/lib/hotplug/firmware ] && ! [ -f $(INSTALL_PREFIX)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ) || ( [ -d $(INSTALL_PREFIX)/lib/firmware ] && ! [ -f $(INSTALL_PREFIX)/lib/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
+	@echo "Attempting to download $@"
+	@if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
+	if test ! -f $@; then exit 1; fi; \
+	(cat $@ | gzip -d | tar -xf -)
+ifeq ($(HOTPLUG_FIRMWARE),yes)
+	@echo "Installing zaptel-fw-oct6114-128.bin to hotplug firmware directories"
+	if [ -d $(INSTALL_PREFIX)/usr/lib/hotplug/firmware ]; then \
+		$(INSTALL) -m 644 zaptel-fw-oct6114-128.bin $(INSTALL_PREFIX)/usr/lib/hotplug/firmware; \
+		touch $(INSTALL_PREFIX)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION); \
+	fi
+	if [ -d $(INSTALL_PREFIX)/lib/firmware ]; then \
+		$(INSTALL) -m 644 zaptel-fw-oct6114-128.bin $(INSTALL_PREFIX)/lib/firmware; \
+		touch $(INSTALL_PREFIX)/lib/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION); \
+	fi
+endif
+else
+	@echo "Firmware zaptel-fw-oct6114-128.bin is already installed with latest version $(OCT6114_128_VERSION)"
+endif
+
+zaptel-fw-tc400m-%.tar.gz: have_download
+ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" == "no" ] ) || ( [ -d $(INSTALL_PREFIX)/usr/lib/hotplug/firmware ] && ! [ -f $(INSTALL_PREFIX)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION) ] ) || ( [ -d $(INSTALL_PREFIX)/lib/firmware ] && ! [ -f $(INSTALL_PREFIX)/lib/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
+	@echo "Attempting to download $@"
+	@if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
+	if test ! -f $@; then exit 1; fi; \
+	(cat $@ | gzip -d | tar -xf -)
+ifeq ($(HOTPLUG_FIRMWARE),yes)
+	@echo "Installing zaptel-fw-tc400m.bin to hotplug firmware directories"
+	if [ -d $(INSTALL_PREFIX)/usr/lib/hotplug/firmware ]; then \
+		$(INSTALL) -m 644 zaptel-fw-tc400m.bin $(INSTALL_PREFIX)/usr/lib/hotplug/firmware; \
+		touch $(INSTALL_PREFIX)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION); \
+	fi
+	if [ -d $(INSTALL_PREFIX)/lib/firmware ]; then \
+		$(INSTALL) -m 644 zaptel-fw-tc400m.bin $(INSTALL_PREFIX)/lib/firmware; \
+		touch $(INSTALL_PREFIX)/lib/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION); \
+	fi
+endif
+else
+	@echo "Firmware zaptel-fw-tc400m.bin is already installed with latest version $(TC400M_VERSION)"
+endif
 
 # Clean up any downloaded/extracted firmware packages
 dist-clean: clean
@@ -78,22 +136,16 @@
 
 # Install all downloaded firmware images for hotplug usage and build headers for inclusion
 hotplug-install: $(FIRMWARE)
-ifneq (,$(FIRMWARE))
-	if [ -d $(INSTALL_PREFIX)/usr/lib/hotplug/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-*.bin $(INSTALL_PREFIX)/usr/lib/hotplug/firmware; \
-	fi
-	if [ -d $(INSTALL_PREFIX)/lib/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-*.bin $(INSTALL_PREFIX)/lib/firmware; \
-	fi
-endif
 
 # Uninstall any installed zaptel firmware images from hotplug firmware directories
 hotplug-uninstall:
 	if [ -d $(INSTALL_PREFIX)/usr/lib/hotplug/firmware ]; then \
 		rm -f $(INSTALL_PREFIX)/usr/lib/hotplug/firmware/zaptel-fw-*.bin; \
+		rm -f $(INSTALL_PREFIX)/usr/lib/hotplug/firmware/.zaptel-fw*; \
 	fi
 	if [ -d $(INSTALL_PREFIX)/lib/firmware ]; then \
 		rm -f $(INSTALL_PREFIX)/lib/firmware/zaptel-fw-*.bin; \
+		rm -f $(INSTALL_PREFIX)/lib/firmware/.zaptel-fw*; \
 	fi
 
 # Build object file of an oct6114 064 firmware image for linking



More information about the zaptel-commits mailing list