[zaptel-commits] kpfleming: branch 1.4 r4490 - /branches/1.4/firmware/Makefile

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Tue Aug 19 15:11:39 CDT 2008


Author: kpfleming
Date: Tue Aug 19 15:11:39 2008
New Revision: 4490

URL: http://svn.digium.com/view/zaptel?view=rev&rev=4490
Log:
simplify this Makefile a bit by always creating /usr/lib/hotplug/firmware and /lib/firmware in $(DESTDIR) if hotplug firmware is being installed

work around a GNU make buglet that caused some target rules not to match


Modified:
    branches/1.4/firmware/Makefile

Modified: branches/1.4/firmware/Makefile
URL: http://svn.digium.com/view/zaptel/branches/1.4/firmware/Makefile?view=diff&rev=4490&r1=4489&r2=4490
==============================================================================
--- branches/1.4/firmware/Makefile (original)
+++ branches/1.4/firmware/Makefile Tue Aug 19 15:11:39 2008
@@ -62,7 +62,7 @@
 	fi
 
 # Download and extract firmware tarballs
-zaptel-fw-oct6114-064-%.tar.gz: have_download
+zaptel-fw-oct6114-064-$(OCT6114_064_VERSION).tar.gz: have_download
 ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/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;
@@ -70,8 +70,7 @@
 	(cat $@ | gzip -d | tar -xf -)
 endif
 
-
-zaptel-fw-oct6114-128-%.tar.gz: have_download
+zaptel-fw-oct6114-128-$(OCT6114_128_VERSION).tar.gz: have_download
 ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/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;
@@ -79,7 +78,7 @@
 	(cat $@ | gzip -d | tar -xf -)
 endif
 
-zaptel-fw-tc400m-%.tar.gz: have_download
+zaptel-fw-tc400m-$(TC400M_VERSION).tar.gz: have_download
 ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/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;
@@ -87,7 +86,7 @@
 	(cat $@ | gzip -d | tar -xf -)
 endif
 
-zaptel-fw-vpmadt032-%.tar.gz: have_download
+zaptel-fw-vpmadt032-$(VPMADT032_VERSION).tar.gz: have_download
 ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
 	@echo "Attempting to download $@"
 	@if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
@@ -107,69 +106,54 @@
 # Create object files suitable for linking against
 object-build: $(FIRMWARE) $(OBJECT_FILES)
 
-# Install all downloaded firmware images for hotplug usage and build headers for inclusion
-hotplug-install: $(FIRMWARE)
-ifeq ($(HOTPLUG_FIRMWARE),yes)
-ifeq ($(shell if ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
+$(DESTDIR)/usr/lib/hotplug/firmware $(DESTDIR)/lib/firmware:
+	mkdir -p $@
+
+# Install all downloaded firmware images for hotplug usage
+hotplug-install: $(DESTDIR)/usr/lib/hotplug/firmware $(DESTDIR)/lib/firmware $(FIRMWARE)
+ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION) ] ) || ( [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
 	@echo "Installing zaptel-fw-oct6114-064.bin to hotplug firmware directories"
-	if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-oct6114-064.bin $(DESTDIR)/usr/lib/hotplug/firmware && \
-		(rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-*; \
-		 touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION)); \
-	fi
-	if [ -d $(DESTDIR)/lib/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-oct6114-064.bin $(DESTDIR)/lib/firmware && \
-		(rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-064-*; \
-		 touch $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION)); \
-	fi
+	$(INSTALL) -m 644 zaptel-fw-oct6114-064.bin $(DESTDIR)/usr/lib/hotplug/firmware
+	rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-*
+	touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION)
+	$(INSTALL) -m 644 zaptel-fw-oct6114-064.bin $(DESTDIR)/lib/firmware
+	rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-064-*
+	touch $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION)
 else
 	@echo "Firmware zaptel-fw-oct6114-064.bin is already installed with required version $(OCT6114_064_VERSION)"
 endif
-ifeq ($(shell if ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
+ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ) || ( [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
 	@echo "Installing zaptel-fw-oct6114-128.bin to hotplug firmware directories"
-	if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-oct6114-128.bin $(DESTDIR)/usr/lib/hotplug/firmware && \
-		(rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-*; \
-		 touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION)); \
-	fi
-	if [ -d $(DESTDIR)/lib/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-oct6114-128.bin $(DESTDIR)/lib/firmware && \
-		(rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-*; \
-		 touch $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION)); \
-	fi
+	$(INSTALL) -m 644 zaptel-fw-oct6114-128.bin $(DESTDIR)/usr/lib/hotplug/firmware
+	rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-*
+	touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION)
+	$(INSTALL) -m 644 zaptel-fw-oct6114-128.bin $(DESTDIR)/lib/firmware
+	rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-*
+	touch $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION)
 else
 	@echo "Firmware zaptel-fw-oct6114-128.bin is already installed with required version $(OCT6114_128_VERSION)"
 endif
-ifeq ($(shell if ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
+ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION) ] ) || ( [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
 	@echo "Installing zaptel-fw-tc400m.bin to hotplug firmware directories"
-	if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-tc400m.bin $(DESTDIR)/usr/lib/hotplug/firmware && \
-		(rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-*; \
-		 touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION)); \
-	fi
-	if [ -d $(DESTDIR)/lib/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-tc400m.bin $(DESTDIR)/lib/firmware && \
-		(rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-tc400m-*; \
-		 touch $(DESTDIR)/lib/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION)); \
-	fi
+	$(INSTALL) -m 644 zaptel-fw-tc400m.bin $(DESTDIR)/usr/lib/hotplug/firmware
+	rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-*
+	touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION)
+	$(INSTALL) -m 644 zaptel-fw-tc400m.bin $(DESTDIR)/lib/firmware
+	rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-tc400m-*
+	touch $(DESTDIR)/lib/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION)
 else
 	@echo "Firmware zaptel-fw-tc400m.bin is already installed with required version $(TC400M_VERSION)"
 endif
-ifeq ($(shell if ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
+ifeq ($(shell if ( [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION) ] ) || ( [ -f $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
 	@echo "Installing zaptel-fw-vpmadt032.bin to hotplug firmware directories"
-	if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-vpmadt032.bin $(DESTDIR)/usr/lib/hotplug/firmware && \
-		(rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-*; \
-		 touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION)); \
-	fi
-	if [ -d $(DESTDIR)/lib/firmware ]; then \
-		$(INSTALL) -m 644 zaptel-fw-vpmadt032.bin $(DESTDIR)/lib/firmware && \
-		(rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-*; \
-		 touch $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION)); \
-	fi
+	$(INSTALL) -m 644 zaptel-fw-vpmadt032.bin $(DESTDIR)/usr/lib/hotplug/firmware
+	rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-*
+	touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION)
+	$(INSTALL) -m 644 zaptel-fw-vpmadt032.bin $(DESTDIR)/lib/firmware
+	rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-*
+	touch $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION)
 else
 	@echo "Firmware zaptel-fw-vpmadt032.bin is already installed with required version $(VPMADT032_VERSION)"
-endif
 endif
 
 # Uninstall any installed zaptel firmware images from hotplug firmware directories




More information about the zaptel-commits mailing list