summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorfile <file@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-07-15 20:29:11 +0000
committerfile <file@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-07-15 20:29:11 +0000
commitb9d38dca097d3c57cb416bd9ae54efacb3e38f21 (patch)
tree7c04b91ad53da7554ca2f01286066f0f5f4f3894 /Makefile
parent5ac8b562340e6dc0c38f88ce86f9df50058bd032 (diff)
Merged revisions 1233 via svnmerge from
https://origsvn.digium.com/svn/zaptel/branches/1.2 ........ r1233 | file | 2006-07-15 15:26:53 -0500 (Sat, 15 Jul 2006) | 2 lines Add support for loading the VPM450M firmware using hotplug from userspace. ........ git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1234 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 25 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index a3b9b28..059c813 100644
--- a/Makefile
+++ b/Makefile
@@ -7,7 +7,7 @@
.EXPORT_ALL_VARIABLES:
-.PHONY: menuselect distclean dist-clean clean version.h all _all install b410p devices programs modules linux24 linux26 xpp tests devel data stackcheck install-udev config update install-programs install-modules install-linux24 install-linux26
+.PHONY: menuselect distclean dist-clean clean version.h all _all install b410p devices programs modules linux24 linux26 xpp tests devel data stackcheck install-udev config update install-programs install-modules install-linux24 install-linux26 firmware
HOSTCC=gcc
CC=gcc
@@ -137,6 +137,7 @@ MODULESO:=$(MODULES:%=%.o)
MODULESKO:=$(MODULES:%=%.ko)
ifeq ($(BUILDVER),linux26)
MODULES_BUILD:=$(MODULESKO)
+HOTPLUG_FIRMWARE:=yes
else
MODULES_BUILD:=$(MODULESO)
endif
@@ -152,6 +153,15 @@ EXTRA_CFLAGS:=-I$(PWD)/include -I$(PWD)/include/oct6100api
obj-m:=$(MODULESO)
wct4xxp-objs:=wct4xxp_base.o vpm450m.o
+# Set this to override hotplug firmware loading and revert to classic header
+#HOTPLUG_FIRMWARE=no
+ifeq ($(HOTPLUG_FIRMWARE),yes)
+CFLAGS+=-DHOTPLUG_FIRMWARE
+VPM450M_FIRMWARE_HEADER=
+else
+VPM450M_FIRMWARE_HEADER=vpm450m_fw.h
+endif
+
# Also build xpp in the subdirectory xpp/ . But only for >=2.6.10 and only
# for i386 or x86_64. On other archs the module will probably build but panic.
# These lines are only meaningful when this Makefile is used as kconfig for
@@ -181,7 +191,7 @@ modules: $(BUILDVER)
linux24: prereq vpm450m_fw.h $(MODULESO) $(BINS)
-linux26: prereq vpm450m_fw.h $(BINS)
+linux26: prereq $(VPM450M_FIRMWARE_HEADER) $(BINS)
@if [ -z "$(KSRC)" -o ! -d "$(KSRC)" ]; then echo "You do not appear to have the sources for the $(KVERS) kernel installed."; exit 1 ; fi
$(KMAKE) modules
@@ -356,7 +366,7 @@ else # DYNFS
endif
endif
-install: all devices
+install: all devices firmware
if [ -f ztcfg ]; then \
$(INSTALL) -D -m 755 ztcfg $(INSTALL_PREFIX)/sbin/ztcfg; \
fi
@@ -413,6 +423,18 @@ endif
install-udev: devices
+firmware:
+ifeq ($(HOTPLUG_FIRMWARE),yes)
+ if [ -d /usr/lib/hotplug/firmware ]; then \
+ install -D -m 644 *.ima /usr/lib/hotplug/firmware ; \
+ elif [ -d /lib/firmware ]; then \
+ install -D -m 644 *.ima /lib/firmware ; \
+ fi
+ @echo "Installed firmware"
+else
+ @echo "Not installing firmware because we are not using hotplug firmware"
+endif
+
config:
if [ -d $(INSTALL_PREFIX)/etc/rc.d/init.d ]; then \
$(INSTALL) -D -m 755 zaptel.init $(INSTALL_PREFIX)/etc/rc.d/init.d/zaptel; \