[Asterisk-cvs] zaptel Makefile,1.32,1.33

markster at lists.digium.com markster at lists.digium.com
Fri Feb 20 11:02:55 CST 2004


Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv24211

Modified Files:
	Makefile 
Log Message:
Makefile fixes for the 2.6 kernel


Index: Makefile
===================================================================
RCS file: /usr/cvsroot/zaptel/Makefile,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- Makefile	4 Feb 2004 01:33:49 -0000	1.32
+++ Makefile	20 Feb 2004 15:50:20 -0000	1.33
@@ -33,29 +33,33 @@
 
 INSTALL_PREFIX=
 
-MODCONF=$(shell if [ -d $(INSTALL_PREFIX)/etc/modutils ]; then echo "$(INSTALL_PREFIX)/etc/modutils/zaptel"; elif [ -f $(INSTALL_PREFIX)/etc/modules.conf ]; then echo $(INSTALL_PREFIX)/etc/modules.conf; else echo $(INSTALL_PREFIX)/etc/conf.modules ; fi)
+MODCONF=$(shell if [ -d $(INSTALL_PREFIX)/etc/modprobe.d ]; then echo "$(INSTALL_PREFIX)/etc/modprobe.d/zaptel"; elif [ -d $(INSTALL_PREFIX)/etc/modutils ]; then echo "$(INSTALL_PREFIX)/etc/modutils/zaptel"; elif [ -f $(INSTALL_PREFIX)/etc/modules.conf ]; then echo $(INSTALL_PREFIX)/etc/modules.conf; else echo $(INSTALL_PREFIX)/etc/conf.modules ; fi)
 
 DEVFS=$(shell ps ax | grep -v grep | grep devfsd)
 
 TZOBJS=zonedata.lo tonezone.lo
 LIBTONEZONE=libtonezone.so.1.0
-MODULES=zaptel.o tor2.o torisa.o wcusb.o wcfxo.o wcfxs.o \
-	ztdynamic.o ztd-eth.o wct1xxp.o wct4xxp.o # ztdummy.o
-#MODULES+=wcfxsusb.o
+MODULES=zaptel tor2 torisa wcusb wcfxo wcfxs \
+	ztdynamic ztd-eth wct1xxp wct4xxp # ztdummy
+#MODULES+=wcfxsusb
+
+MODULESO=$(shell for x in $(MODULES); do echo "$$x.o "; done )
+MODULESKO=$(shell for x in $(MODULES); do echo "$$x.ko "; done )
+
 ZTTOOL=$(shell if [ -f /usr/include/newt.h ]; then echo zttool; fi)
 #PRIMARY=wcfxsusb
 PRIMARY=torisa
 #PRIMARY=wcfxo
 PWD=$(shell pwd)
 
-all:	$(MODULES) ztcfg torisatool makefw ztmonitor ztspeed $(ZTTOOL)
+all:	$(MODULESO) ztcfg torisatool makefw ztmonitor ztspeed $(ZTTOOL)
 
 linux26: 
 linux26: prereq ztcfg torisatool makefw ztmonitor ztspeed $(ZTTOOL)
 	@if ! [ -d /usr/src/linux-2.6 ]; then echo "Link /usr/src/linux-2.6 to your kernel sources first!"; exit 1 ; fi
 	make -C /usr/src/linux-2.6 SUBDIRS=$(PWD) modules
 
-obj-m := $(MODULES)
+obj-m := $(MODULESO)
 
 #ifneq ($(TOPDIR),)
 #include $(TOPDIR)/Rules.make
@@ -223,12 +227,23 @@
 	fi
 	if [ -f zttool ]; then install -m 755 zttool $(INSTALL_PREFIX)/sbin; fi
 	mkdir -p $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc
-	for x in $(MODULES); do \
-		install -m 644 $$x $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc ; \
-	done
-	if ! [ -f wcfxsusb.o ]; then \
-		rm -f $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/wcfxsusb.o; \
+
+	if [ -f zaptel.ko ]; then \
+		for x in $(MODULESKO); do \
+			install -m 644 $$x $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc ; \
+		done; \
+		if ! [ -f wcfxsusb.ko ]; then \
+			rm -f $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/wcfxsusb.o; \
+		fi; \
+	else \
+		for x in $(MODULESO); do \
+			install -m 644 $$x $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc ; \
+		done; \
+		if ! [ -f wcfxsusb.o ]; then \
+			rm -f $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/wcfxsusb.ko; \
+		fi; \
 	fi
+
 	mkdir -p $(INSTALL_PREFIX)/usr/lib
 	install -m 755 $(LIBTONEZONE) $(INSTALL_PREFIX)/usr/lib
 	install -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/linux
@@ -236,7 +251,6 @@
 	install -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include
 	( cd $(INSTALL_PREFIX)/usr/lib ; rm -f libtonezone.so ; ln -sf $(LIBTONEZONE) libtonezone.so )
 	/sbin/ldconfig
-
 	if [ -f $(MODCONF) ]; then mv -f $(MODCONF) $(MODCONF).bak ; fi
 	cat $(MODCONF).bak | grep -v "alias char-major-250" | \
 	grep -v "post-install torisa /sbin/ztcfg" | \
@@ -248,27 +262,19 @@
 	if ! grep "alias char-major-196" $(MODCONF); then \
 		echo "alias char-major-196 $(PRIMARY)" >> $(MODCONF); \
 	fi
-	if ! grep "post-install wcfxs" $(MODCONF); then \
-		echo "post-install wcfxs /sbin/ztcfg" >> $(MODCONF); \
-	fi
-	if ! grep "post-install wcfxsusb" $(MODCONF); then \
-		echo "post-install wcfxsusb /sbin/ztcfg" >> $(MODCONF); \
-	fi
-	if ! grep "post-install torisa" $(MODCONF); then \
-		echo "post-install torisa /sbin/ztcfg" >> $(MODCONF); \
-	fi
-	if ! grep "post-install tor2" $(MODCONF); then \
-		echo "post-install tor2 /sbin/ztcfg" >> $(MODCONF); \
-	fi
-	if ! grep "post-install wcfxo" $(MODCONF); then \
-		echo "post-install wcfxo /sbin/ztcfg" >> $(MODCONF); \
-	fi
-	if ! grep "post-install wct1xxp" $(MODCONF); then \
-		echo "post-install wct1xxp /sbin/ztcfg" >> $(MODCONF); \
-	fi
-	if ! grep "post-install wct4xxp" $(MODCONF); then \
-		echo "post-install wct4xxp /sbin/ztcfg" >> $(MODCONF); \
-	fi
+		
+	for x in $(MODULES); do \
+		if ! grep "post-install $$x" $(MODCONF); then \
+			if ! grep "install $$x " $(MODCONF); then \
+				if [ "$$x" != "zaptel" ] ; then \
+					if [ -f zaptel.ko ]; then echo "install $$x /sbin/modprobe --ignore-install $$x && /sbin/ztcfg" >> $(MODCONF); \
+					else echo "post-install $$x /sbin/ztcfg" >> $(MODCONF); \
+					fi; \
+				fi; \
+			fi; \
+		fi; \
+	done
+
 	if [ -d /etc/modutils ]; then \
 		/sbin/update-modules ; \
 	fi




More information about the svn-commits mailing list