summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfile <file@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-02-12 23:16:53 +0000
committerfile <file@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-02-12 23:16:53 +0000
commitb2bf663e370dd30179499b73b8bddcec42273c00 (patch)
tree9adc507f7fa321e123c87696db80e2739d941753
parent4e43b8f19fb1d78c36f82dfa7d148ce5bc1f4ca1 (diff)
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. ........ git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2159 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r--Makefile3
-rw-r--r--firmware/Makefile74
2 files changed, 66 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index c3e40a0..e895314 100644
--- a/Makefile
+++ b/Makefile
@@ -364,6 +364,9 @@ else # DYNFS
endif
endif
+hotplug-uninstall:
+ $(MAKE) -C firmware hotplug-uninstall
+
xpp-install:
ifneq (,$(findstring xpp,$(obj-m)))
@$(MAKE) -C xpp/utils install
diff --git a/firmware/Makefile b/firmware/Makefile
index 9d4efaf..d6821a7 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -58,11 +58,69 @@ have_download:
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 @@ object-build: $(FIRMWARE) $(OBJECT_FILES)
# 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