[zaptel-commits] file: trunk r2159 - in /trunk: ./ Makefile firmware/Makefile

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


Author: file
Date: Mon Feb 12 17:16:53 2007
New Revision: 2159

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2159
Log:
Merged revisions 2158 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.4

........
r2158 | file | 2007-02-12 18:13:39 -0500 (Mon, 12 Feb 2007) | 2 lines

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:
    trunk/   (props changed)
    trunk/Makefile
    trunk/firmware/Makefile

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

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

Modified: trunk/firmware/Makefile
URL: http://svn.digium.com/view/zaptel/trunk/firmware/Makefile?view=diff&rev=2159&r1=2158&r2=2159
==============================================================================
--- trunk/firmware/Makefile (original)
+++ trunk/firmware/Makefile Mon Feb 12 17:16:53 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