2010-08-28 05:59:27 +08:00
|
|
|
#
|
|
|
|
# DAHDI
|
|
|
|
#
|
|
|
|
# Makefile for firmware downloading/installation
|
|
|
|
#
|
2013-07-02 00:09:10 +08:00
|
|
|
# Copyright (C) 2007-2013, Digium, Inc.
|
2010-08-28 05:59:27 +08:00
|
|
|
#
|
|
|
|
# Joshua Colp <jcolp@digium.com>
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# See http://www.asterisk.org for more information about
|
|
|
|
# the Asterisk project. Please do not directly contact
|
|
|
|
# any of the maintainers of this project for assistance;
|
|
|
|
# the project provides a web site, mailing lists and IRC
|
|
|
|
# channels for your use.
|
|
|
|
#
|
|
|
|
# This program is free software, distributed under the terms of
|
|
|
|
# the GNU General Public License Version 2 as published by the
|
|
|
|
# Free Software Foundation. See the LICENSE file included with
|
|
|
|
# this program for more details.
|
|
|
|
#
|
|
|
|
|
|
|
|
.PHONY: dist-clean clean all uninstall have_download install object-build hotplug-install hotplug-dirs hotplug-uninstall make_firmware_object firmware-loaders
|
|
|
|
|
2013-05-21 05:46:21 +08:00
|
|
|
OCT6114_032_VERSION:=1.05.01
|
2010-08-28 05:59:27 +08:00
|
|
|
OCT6114_064_VERSION:=1.05.01
|
|
|
|
OCT6114_128_VERSION:=1.05.01
|
2011-11-01 23:27:21 +08:00
|
|
|
OCT6114_256_VERSION:=1.05.01
|
2010-08-28 05:59:27 +08:00
|
|
|
TC400M_VERSION:=MR6.12
|
|
|
|
VPMADT032_VERSION:=1.25.0
|
|
|
|
HX8_VERSION:=2.06
|
2011-11-02 04:35:15 +08:00
|
|
|
VPMOCT032_VERSION:=1.12.0
|
2011-11-01 23:27:27 +08:00
|
|
|
WCT820_VERSION:=1.76
|
2014-03-12 12:58:11 +08:00
|
|
|
TE133_VERSION:=780019
|
2013-12-18 03:37:21 +08:00
|
|
|
TE134_VERSION:=780017
|
2014-03-18 00:58:49 +08:00
|
|
|
TE435_VERSION:=e0019
|
2014-04-25 04:11:56 +08:00
|
|
|
TE436_VERSION:=10017
|
2013-07-02 00:09:10 +08:00
|
|
|
A8A_VERSION:=1d0017
|
2014-03-18 00:54:27 +08:00
|
|
|
A8B_VERSION:=1d0019
|
2013-07-02 00:09:10 +08:00
|
|
|
A4A_VERSION:=a0017
|
2014-03-18 00:54:27 +08:00
|
|
|
A4B_VERSION:=b0019
|
2010-08-28 05:59:27 +08:00
|
|
|
|
|
|
|
FIRMWARE_URL:=http://downloads.digium.com/pub/telephony/firmware/releases
|
|
|
|
|
2013-07-02 00:09:10 +08:00
|
|
|
ALL_FIRMWARE=FIRMWARE-OCT6114-032 FIRMWARE-OCT6114-064 FIRMWARE-OCT6114-128 FIRMWARE-OCT6114-256
|
|
|
|
ALL_FIRMWARE+=FIRMWARE-TC400M FIRMWARE-HX8 FIRMWARE-VPMOCT032 FIRMWARE-TE820 FIRMWARE-TE133 FIRMWARE-TE134
|
2013-09-11 04:54:33 +08:00
|
|
|
ALL_FIRMWARE+=FIRMWARE-A8A FIRMWARE-A8B FIRMWARE-A4A FIRMWARE-A4B FIRMWARE-TE435
|
2010-08-28 05:59:27 +08:00
|
|
|
|
|
|
|
# Firmware files should use the naming convention: dahdi-fw-<base name>-<sub name>-<version> or dahdi-fw-<base name>-<version>
|
|
|
|
# First example: dahdi-fw-oct6114-064-1.05.01
|
|
|
|
# This means this is version 1.05.01 of the oct6114-064 firmware
|
|
|
|
# Second example: dahdi-fw-tc400m-MR5.6
|
|
|
|
# This means this is version MR5.6 of the tc400m firmware
|
|
|
|
|
|
|
|
# Build a list of firmware package filenames we need
|
2013-05-21 05:46:21 +08:00
|
|
|
FIRMWARE:=$(ALL_FIRMWARE:FIRMWARE-OCT6114-032=dahdi-fw-oct6114-032-$(OCT6114_032_VERSION).tar.gz)
|
|
|
|
FIRMWARE:=$(FIRMWARE:FIRMWARE-OCT6114-064=dahdi-fw-oct6114-064-$(OCT6114_064_VERSION).tar.gz)
|
2010-08-28 05:59:27 +08:00
|
|
|
FIRMWARE:=$(FIRMWARE:FIRMWARE-OCT6114-128=dahdi-fw-oct6114-128-$(OCT6114_128_VERSION).tar.gz)
|
2011-11-01 23:27:21 +08:00
|
|
|
FIRMWARE:=$(FIRMWARE:FIRMWARE-OCT6114-256=dahdi-fw-oct6114-256-$(OCT6114_256_VERSION).tar.gz)
|
2010-08-28 05:59:27 +08:00
|
|
|
FIRMWARE:=$(FIRMWARE:FIRMWARE-TC400M=dahdi-fw-tc400m-$(TC400M_VERSION).tar.gz)
|
|
|
|
FIRMWARE:=$(FIRMWARE:FIRMWARE-HX8=dahdi-fw-hx8-$(HX8_VERSION).tar.gz)
|
2011-06-29 06:28:53 +08:00
|
|
|
FIRMWARE:=$(FIRMWARE:FIRMWARE-VPMOCT032=dahdi-fw-vpmoct032-$(VPMOCT032_VERSION).tar.gz)
|
2011-11-01 23:27:27 +08:00
|
|
|
FIRMWARE:=$(FIRMWARE:FIRMWARE-TE820=dahdi-fw-te820-$(WCT820_VERSION).tar.gz)
|
2013-05-21 05:46:21 +08:00
|
|
|
FIRMWARE:=$(FIRMWARE:FIRMWARE-TE133=dahdi-fw-te133-$(TE133_VERSION).tar.gz)
|
|
|
|
FIRMWARE:=$(FIRMWARE:FIRMWARE-TE134=dahdi-fw-te134-$(TE134_VERSION).tar.gz)
|
2013-09-11 04:54:33 +08:00
|
|
|
FIRMWARE:=$(FIRMWARE:FIRMWARE-TE435=dahdi-fw-te435-$(TE435_VERSION).tar.gz)
|
2014-04-25 04:11:56 +08:00
|
|
|
FIRMWARE:=$(FIRMWARE:FIRMWARE-TE436=dahdi-fw-te436-$(TE436_VERSION).tar.gz)
|
2013-07-02 00:09:10 +08:00
|
|
|
FIRMWARE:=$(FIRMWARE:FIRMWARE-A8A=dahdi-fw-a8b-$(A8B_VERSION).tar.gz)
|
|
|
|
FIRMWARE:=$(FIRMWARE:FIRMWARE-A8B=dahdi-fw-a8a-$(A8A_VERSION).tar.gz)
|
|
|
|
FIRMWARE:=$(FIRMWARE:FIRMWARE-A4A=dahdi-fw-a4b-$(A4B_VERSION).tar.gz)
|
|
|
|
FIRMWARE:=$(FIRMWARE:FIRMWARE-A4B=dahdi-fw-a4a-$(A4A_VERSION).tar.gz)
|
2010-08-28 05:59:27 +08:00
|
|
|
|
|
|
|
FWLOADERS:=dahdi-fwload-vpmadt032-$(VPMADT032_VERSION).tar.gz
|
|
|
|
|
|
|
|
# Build a list of object files if hotplug will not be used
|
2013-05-21 05:46:21 +08:00
|
|
|
OBJECT_FILES:=$(ALL_FIRMWARE:FIRMWARE-OCT6114-032=dahdi-fw-oct6114-032.o)
|
2010-08-28 05:59:27 +08:00
|
|
|
OBJECT_FILES:=$(ALL_FIRMWARE:FIRMWARE-OCT6114-064=dahdi-fw-oct6114-064.o)
|
|
|
|
OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-OCT6114-128=dahdi-fw-oct6114-128.o)
|
2011-11-01 23:27:21 +08:00
|
|
|
OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-OCT6114-256=dahdi-fw-oct6114-256.o)
|
2010-08-28 05:59:27 +08:00
|
|
|
OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-TC400M=dahdi-fw-tc400m.o)
|
|
|
|
OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-HX8=dahdi-fw-hx8.o)
|
2012-04-02 21:58:11 +08:00
|
|
|
OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-VPMOCT032=dahdi-fw-vpmoct032.o)
|
2010-08-28 05:59:27 +08:00
|
|
|
|
|
|
|
# Force usage of wget, for now
|
|
|
|
DOWNLOAD=wget
|
|
|
|
WGET=wget
|
2014-03-13 04:35:51 +08:00
|
|
|
INSTALL_FIRMWARE=../../../build_tools/install_firmware
|
2014-03-31 00:55:17 +08:00
|
|
|
RUN_INST=$(INSTALL_FIRMWARE) $(1) $(2) $(DESTDIR)
|
2010-08-28 05:59:27 +08:00
|
|
|
|
|
|
|
# If "fetch" is used, --continue is not a valid option.
|
|
|
|
ifeq ($(WGET),wget)
|
|
|
|
WGET_ARGS:=--continue
|
|
|
|
endif
|
|
|
|
|
|
|
|
all: $(FIRMWARE)
|
|
|
|
|
|
|
|
# Clean up any downloaded/extracted firmware packages
|
|
|
|
dist-clean: clean
|
|
|
|
rm -f dahdi-fw-*.bin
|
|
|
|
rm -f dahdi-fw-*.tar.gz
|
|
|
|
rm -f dahdi-fwload-*.tar.gz
|
|
|
|
rm -f make_firmware_object
|
|
|
|
|
|
|
|
# Clean up anything we built
|
|
|
|
clean:
|
|
|
|
rm -f dahdi-fw-*.o
|
|
|
|
|
|
|
|
# Download and extract firmware tarballs
|
|
|
|
dahdi-fw-%.tar.gz:
|
|
|
|
@if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.$(subst .tar.gz,,$*) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.$(subst .tar.gz,,$*) ] ); then \
|
|
|
|
echo "Attempting to download $@"; \
|
|
|
|
if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi; \
|
|
|
|
if test ! -f $@; then exit 1; fi; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
firmware-loaders: $(FWLOADERS)
|
|
|
|
|
|
|
|
.PHONY: dahdi-fwload-vpmadt032-$(VPMADT032_VERSION).tar.gz
|
|
|
|
dahdi-fwload-vpmadt032-$(VPMADT032_VERSION).tar.gz:
|
|
|
|
@if test ! -f $@; then echo "Attempting to download $@"; $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi; \
|
|
|
|
if test ! -f $@; then exit 1; fi; \
|
2010-10-20 20:22:42 +08:00
|
|
|
(cd ../../..; cat drivers/dahdi/firmware/$@ | gzip -d | tar --no-same-owner -xf -)
|
2010-08-28 05:59:27 +08:00
|
|
|
|
|
|
|
# Create object files suitable for linking against
|
|
|
|
object-build: $(FIRMWARE) $(OBJECT_FILES)
|
|
|
|
|
|
|
|
$(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)
|
2014-03-31 00:55:17 +08:00
|
|
|
@$(call RUN_INST,dahdi-fw-oct6114-032,$(OCT6114_032_VERSION))
|
|
|
|
@$(call RUN_INST,dahdi-fw-oct6114-064,$(OCT6114_064_VERSION))
|
|
|
|
@$(call RUN_INST,dahdi-fw-oct6114-128,$(OCT6114_128_VERSION))
|
|
|
|
@$(call RUN_INST,dahdi-fw-oct6114-256,$(OCT6114_256_VERSION))
|
|
|
|
@$(call RUN_INST,dahdi-fw-tc400m,$(TC400M_VERSION))
|
|
|
|
@$(call RUN_INST,dahdi-fw-hx8,$(HX8_VERSION))
|
|
|
|
@$(call RUN_INST,dahdi-fw-vpmoct032,$(VPMOCT032_VERSION))
|
|
|
|
@$(call RUN_INST,dahdi-fw-te820,$(WCT820_VERSION))
|
|
|
|
@$(call RUN_INST,dahdi-fw-te133,$(TE133_VERSION))
|
|
|
|
@$(call RUN_INST,dahdi-fw-te134,$(TE134_VERSION))
|
|
|
|
@$(call RUN_INST,dahdi-fw-te435,$(TE435_VERSION))
|
2014-04-25 04:11:56 +08:00
|
|
|
@$(call RUN_INST,dahdi-fw-te436,$(TE436_VERSION))
|
2014-03-31 00:55:17 +08:00
|
|
|
@$(call RUN_INST,dahdi-fw-a8a,$(A8A_VERSION))
|
|
|
|
@$(call RUN_INST,dahdi-fw-a8b,$(A8B_VERSION))
|
|
|
|
@$(call RUN_INST,dahdi-fw-a4a,$(A4A_VERSION))
|
|
|
|
@$(call RUN_INST,dahdi-fw-a4b,$(A4B_VERSION))
|
2013-05-21 05:46:21 +08:00
|
|
|
|
2010-08-28 05:59:27 +08:00
|
|
|
# Uninstall any installed dahdi firmware images from hotplug firmware directories
|
|
|
|
hotplug-uninstall:
|
|
|
|
if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
|
|
|
|
rm -f $(DESTDIR)/usr/lib/hotplug/firmware/dahdi-fw-*.bin; \
|
|
|
|
rm -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw*; \
|
|
|
|
fi
|
|
|
|
if [ -d $(DESTDIR)/lib/firmware ]; then \
|
|
|
|
rm -f $(DESTDIR)/lib/firmware/dahdi-fw-*.bin; \
|
|
|
|
rm -f $(DESTDIR)/lib/firmware/.dahdi-fw*; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
make_firmware_object: make_firmware_object.in ../dahdi-base.o
|
|
|
|
@export BFDNAME=`LANG=C objdump -f ../dahdi-base.o | grep -e "dahdi-base.o:" | sed "s/.*file format \(.*\)/\1/"`; \
|
|
|
|
export BFDARCH=`LANG=C objdump -f ../dahdi-base.o | grep -e "architecture:" | sed "s/.*ture: \(.*\),.*/\1/"`; \
|
|
|
|
sed -e s/BFDNAME/$${BFDNAME}/ -e s/BFDARCH/$${BFDARCH}/ $< > $@
|
|
|
|
@chmod +x $@
|
|
|
|
|
2013-05-21 05:46:21 +08:00
|
|
|
# Build object file of an oct6114 032 firmware image for linking
|
|
|
|
dahdi-fw-oct6114-032.o: dahdi-fw-oct6114-032-$(OCT6114_032_VERSION).tar.gz dahdi-fw-oct6114-032.bin make_firmware_object
|
|
|
|
@echo Making firmware object file for dahdi-fw-oct6114-032.bin
|
|
|
|
./make_firmware_object dahdi-fw-oct6114-032.bin $@
|
|
|
|
|
2010-08-28 05:59:27 +08:00
|
|
|
# Build object file of an oct6114 064 firmware image for linking
|
|
|
|
dahdi-fw-oct6114-064.o: dahdi-fw-oct6114-064-$(OCT6114_064_VERSION).tar.gz dahdi-fw-oct6114-064.bin make_firmware_object
|
|
|
|
@echo Making firmware object file for dahdi-fw-oct6114-064.bin
|
|
|
|
./make_firmware_object dahdi-fw-oct6114-064.bin $@
|
|
|
|
|
|
|
|
# Build object file of an oct6114 128 firmware image for linking
|
|
|
|
dahdi-fw-oct6114-128.o: dahdi-fw-oct6114-128-$(OCT6114_128_VERSION).tar.gz dahdi-fw-oct6114-128.bin make_firmware_object
|
|
|
|
@echo Making firmware object file for dahdi-fw-oct6114-128.bin
|
|
|
|
./make_firmware_object dahdi-fw-oct6114-128.bin $@
|
|
|
|
|
2011-11-01 23:27:21 +08:00
|
|
|
# Build object file of an oct6114 256 firmware image for linking
|
|
|
|
dahdi-fw-oct6114-256.o: dahdi-fw-oct6114-256-$(OCT6114_256_VERSION).tar.gz dahdi-fw-oct6114-256.bin make_firmware_object
|
|
|
|
@echo Making firmware object file for dahdi-fw-oct6114-256.bin
|
|
|
|
./make_firmware_object dahdi-fw-oct6114-256.bin $@
|
|
|
|
|
2010-08-28 05:59:27 +08:00
|
|
|
# Build object file of a TC400M firmware image for linking
|
|
|
|
dahdi-fw-tc400m.o: dahdi-fw-tc400m-$(TC400M_VERSION).tar.gz dahdi-fw-tc400m.bin make_firmware_object
|
|
|
|
@echo Making firmware object file for dahdi-fw-tc400m.bin
|
|
|
|
./make_firmware_object dahdi-fw-tc400m.bin $@
|
2012-04-02 21:58:11 +08:00
|
|
|
|
|
|
|
# Build object file of a VPMOCT032 firmware image for linking
|
|
|
|
dahdi-fw-vpmoct032.o: dahdi-fw-vpmoct032-$(VPMOCT032_VERSION).tar.gz dahdi-fw-vpmoct032.bin make_firmware_object
|
|
|
|
@echo Making firmware object file for dahdi-fw-vpmoct032.bin
|
|
|
|
./make_firmware_object dahdi-fw-vpmoct032.bin $@
|