[zaptel-commits] branch group/kernelmove r1030 - in /team/group/kernelmove: ./ kernel/

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Mon May 8 16:00:13 MST 2006


Author: tzafrir
Date: Mon May  8 18:00:13 2006
New Revision: 1030

URL: http://svn.digium.com/view/zaptel?rev=1030&view=rev
Log:
This one can basically build 2.4 and 2.6 kernels and most utils.
* kernel/Makefile: kernel 2.6 config
* kernel/makefile: kernel 2.4 recursive makefile (no install yet)
* makefw: a rewrite of makefw.c in perl. Not as neat, but works. 
  (added in previous commit)
* Ignore vim swap files

Added:
    team/group/kernelmove/kernel/Makefile   (with props)
    team/group/kernelmove/kernel/makefile
      - copied, changed from r1028, team/group/kernelmove/Makefile
Modified:
    team/group/kernelmove/   (props changed)
    team/group/kernelmove/Makefile
    team/group/kernelmove/kernel/   (props changed)

Propchange: team/group/kernelmove/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon May  8 18:00:13 2006
@@ -21,3 +21,4 @@
 *.so
 *.a
 version.h
+.*.swp

Modified: team/group/kernelmove/Makefile
URL: http://svn.digium.com/view/zaptel/team/group/kernelmove/Makefile?rev=1030&r1=1029&r2=1030&view=diff
==============================================================================
--- team/group/kernelmove/Makefile (original)
+++ team/group/kernelmove/Makefile Mon May  8 18:00:13 2006
@@ -29,7 +29,7 @@
 KVERS_MAJ:=$(shell echo $(KVERS) | cut -d. -f1-2)
 KINCLUDES:=$(KSRC)/include
 
-CFLAGS+=-I. -O4 -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
+CFLAGS+=-I. -Ikernel -O4 -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
 ifneq (,$(findstring ppc,$(UNAME_M)))
 CFLAGS_PPC:=-fsigned-char
 endif
@@ -60,7 +60,7 @@
 
 KFLAGS+=-DSTANDALONE_ZAPATA
 CFLAGS+=-DSTANDALONE_ZAPATA
-KMAKE  = $(MAKE) -C $(KSRC) SUBDIRS=$(PWD)
+KMAKE  = $(MAKE) -C $(KSRC) SUBDIRS=$(PWD)/$(KERNDIR)
 KMAKE_INST = $(KMAKE) \
   INSTALL_MOD_PATH=$(INSTALL_PREFIX) INSTALL_MOD_DIR=misc modules_install
 
@@ -165,6 +165,9 @@
 
 MOD_DESTDIR:=zaptel
 
+KERNDIR=kernel
+ZAPTEL_H=$(KERNDIR)/zaptel.h
+
 obj-m:=$(MODULESO)
 
 # Also build xpp in the subdirectory xpp/ . But only for >=2.6.10 and only 
@@ -195,7 +198,9 @@
 
 modules: $(BUILDVER)
 
-linux24: prereq $(MODULESO) $(BINS)
+#linux24: prereq $(MODULESO) $(BINS)
+linux24: prereq $(BINS)
+	make -C $(KERNDIR) MODULESO="$(MODULESO)" $(MODULESO)
 
 linux26: prereq $(BINS)
 	@echo $(KSRC)
@@ -268,11 +273,11 @@
 
 prereq: tones.h tor2fw.h radfw.h version.h
 
-zttool.o: zttool.c zaptel.h
-
-ztprovision.o: ztprovision.c zaptel.h
-
-ztmonitor.o: ztmonitor.c zaptel.h
+zttool.o: zttool.c $(ZAPTEL_H)
+
+ztprovision.o: ztprovision.c $(ZAPTEL_H)
+
+ztmonitor.o: ztmonitor.c $(ZAPTEL_H)
 
 ztspeed: CFLAGS=
 ztspeed.o: CFLAGS=
@@ -393,7 +398,7 @@
 	ln -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \
 		$(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO)
 	if [ -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO); fi
-	install -D -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/linux/zaptel.h
+	install -D -m 644 $(ZAPTEL_H) $(INSTALL_PREFIX)/usr/include/linux/$(ZAPTEL_H)
 	install -D -m 644 torisa.h $(INSTALL_PREFIX)/usr/include/linux/torisa.h
 	install -D -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include/tonezone.h
 	install -m 644 doc/ztcfg.8 $(INSTALL_PREFIX)/usr/share/man/man8
@@ -494,7 +499,7 @@
 	install -m 755 $(LIBTONEZONE) libtonezone.a $(LIB_DIR)
 	install -d $(INC_DIR)/linux
 	install -m 644 tonezone.h $(INC_DIR)
-	install -m 644 zaptel.h torisa.h $(INC_DIR)/linux
+	install -m 644 $(ZAPTEL_H) torisa.h $(INC_DIR)/linux
 
 install-modules: install-$(BUILDVER)
 install-linux24: $(MODULES_BUILD)
@@ -505,7 +510,7 @@
 	$(KMAKE_INST)
 
 clean:
-	rm -f torisatool makefw tor2fw.h radfw.h
+	rm -f torisatool tor2fw.h radfw.h
 	rm -f ${BINS}
 	rm -f *.o ztcfg tzdriver sethdlc sethdlc-new
 	rm -f $(TZOBJS) $(LIBTONEZONE_SO) *.lo

Propchange: team/group/kernelmove/kernel/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon May  8 18:00:13 2006
@@ -1,0 +1,11 @@
+*.ko
+*.mod.c
+.*.cmd
+.tmp_versions
+*.so
+*.a
+version.h
+radfw.h
+tor2fw.h
+tones.h
+.*.swp

Added: team/group/kernelmove/kernel/Makefile
URL: http://svn.digium.com/view/zaptel/team/group/kernelmove/kernel/Makefile?rev=1030&view=auto
==============================================================================
--- team/group/kernelmove/kernel/Makefile (added)
+++ team/group/kernelmove/kernel/Makefile Mon May  8 18:00:13 2006
@@ -1,0 +1,36 @@
+EXTRA_CFLAGS = -DSTANDALONE_ZAPATA 
+
+MODULES:=zaptel tor2 torisa wcusb wcfxo wctdm wctdm24xxp \
+	 ztdynamic ztd-eth wct1xxp wct4xxp wcte11xp pciradio \
+         ztd-loc ztdummy
+
+MODULESO:=$(MODULES:%=%.o)
+MOD_OBJS:=$(MODULESO:$(obj)/%)
+
+obj-m:=$(MODULESO)
+
+# generated header files. Currently generated in the main dir:
+$(src)/zaptel.c: $(obj)/version.h $(obj)/tones.h 
+$(src)/tor2.c:  $(obj)/tor2fw.h
+$(src)/pciradio.c:  $(obj)/radfw.h
+
+# Also build xpp in the subdirectory xpp/ . But only for >=2.6.10 and only 
+# for i386. On other archs the module will probably build but panic.
+# This line is only meaningful when this Makefile is used as kconfig for 
+# 2.6 build
+
+ifneq (,$(shell [ 0$(SUBLEVEL) -ge 10 ] && [ "$(ARCH)" = 'i386' ] && echo 1))
+obj-m+=xpp/
+endif
+
+$(obj)/tones.h: $(src)/../tones.h
+	cp $^ $@
+
+$(obj)/version.h: $(src)/../version.h
+	cp $^ $@
+
+$(obj)/tor2fw.h: $(src)/../tor2fw.h
+	cp $^ $@
+
+$(obj)/radfw.h: $(src)/../radfw.h
+	cp $^ $@

Propchange: team/group/kernelmove/kernel/Makefile
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/group/kernelmove/kernel/Makefile
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/group/kernelmove/kernel/Makefile
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: team/group/kernelmove/kernel/makefile (from r1028, team/group/kernelmove/Makefile)
URL: http://svn.digium.com/view/zaptel/team/group/kernelmove/kernel/makefile?p2=team/group/kernelmove/kernel/makefile&p1=team/group/kernelmove/Makefile&r1=1028&r2=1030&rev=1030&view=diff
==============================================================================
--- team/group/kernelmove/Makefile (original)
+++ team/group/kernelmove/kernel/makefile Mon May  8 18:00:13 2006
@@ -1,43 +1,5 @@
-#
-# Makefile for Zaptel driver modules and utilities
-#
-# Copyright (C) 2001-2006 Digium, Inc.
-#
-#
-.EXPORT_ALL_VARIABLES:
+# Kernel 2.4 makefile
 
-BASEADDR=0xd0000
-
-HOSTCC=gcc
-ifeq ($(DEB_HOST_GNU_TYPE),)
-UNAME_M:=$(shell uname -m)
-else
-UNAME_M:=$(DEB_HOST_GNU_TYPE)
-endif
-# If you want to build for a kernel other than the current kernel, set KVERS
-ifndef KVERS
-KVERS:=$(shell uname -r)
-endif
-ifndef KSRC
-  ifneq (,$(wildcard /lib/modules/$(KVERS)/build))
-    KSRC:=/lib/modules/$(KVERS)/build
-  else
-    KSRC_SEARCH_PATH:=/usr/src/linux-2.4 /usr/src/linux
-    KSRC:=$(shell for dir in $(KSRC_SEARCH_PATH); do if [ -d $$dir ]; then echo $$dir; break; fi; done)
-  endif
-endif
-KVERS_MAJ:=$(shell echo $(KVERS) | cut -d. -f1-2)
-KINCLUDES:=$(KSRC)/include
-
-CFLAGS+=-I. -O4 -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
-ifneq (,$(findstring ppc,$(UNAME_M)))
-CFLAGS_PPC:=-fsigned-char
-endif
-ifneq (,$(findstring x86_64,$(UNAME_M)))
-CFLAGS_X86-64:=-m64
-endif
-CFLAGS+=$(CFLAGS_PPC) $(CFLAGS_X86-64)
-LCFLAGS=-fPIC $(CFLAGS) -DBUILDING_TONEZONE
 KFLAGS=-I$(KINCLUDES) -O6
 KFLAGS+=-DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -I$(KSRC)/drivers/net \
 	-Wall -I. -Wstrict-prototypes -fomit-frame-pointer -I$(KSRC)/drivers/net/wan -I$(KINCLUDES)/net
@@ -59,165 +21,21 @@
 #
 
 KFLAGS+=-DSTANDALONE_ZAPATA
-CFLAGS+=-DSTANDALONE_ZAPATA
-KMAKE  = $(MAKE) -C $(KSRC) SUBDIRS=$(PWD)
-KMAKE_INST = $(KMAKE) \
-  INSTALL_MOD_PATH=$(INSTALL_PREFIX) INSTALL_MOD_DIR=misc modules_install
-
-ROOT_PREFIX=
-INSTALL_PREFIX=$(DESTDIR)
 
 CONFIG_FILE=$(INSTALL_PREFIX)/etc/zaptel.conf
 CFLAGS+=-DZAPTEL_CONFIG=\"$(CONFIG_FILE)\"
 
-ifeq ($(KVERS_MAJ),2.4)
-  BUILDVER:=linux24
-else
-  BUILDVER:=linux26
-endif
+#MODULES:=zaptel tor2 torisa wcusb wcfxo wctdm wctdm24xxp \
+#	 ztdynamic ztd-eth wct1xxp wct4xxp wcte11xp pciradio \
+#         ztd-loc # ztdummy
+#MODULES+=wcfxsusb
+#
+#MODULESO:=$(MODULES:%=%.o)
 
-ifeq ($(BUILDVER),linux26)
-  ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modprobe.d))
-    MODCONF:=$(ROOT_PREFIX)/etc/modprobe.d/zaptel
-  else
-    ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modules.d))
-      MODCONF:=$(ROOT_PREFIX)/etc/modules.d/zaptel
-    else
-      ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modprobe.conf))
-        MODCONF:=$(ROOT_PREFIX)/etc/modprobe.conf
-      else
-        ifneq (,$(wildcard $(ROOT_PREFIX)/etc/conf.modules))
-          MODCONF:=$(ROOT_PREFIX)/etc/conf.modules
-        endif
-      endif
-    endif
-  endif
-else # BUILDVER == linux24
-  ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modutils))
-    MODCONF:=$(ROOT_PREFIX)/etc/modutils/zaptel
-   else
-    ifneq (,$(wildcard $(ROOT_PREFIX)/etc/modules.conf))
-      MODCONF:=$(ROOT_PREFIX)/etc/modules.conf
-     endif
-  endif
-endif
+all: $(MODULESO)
 
-# This is not related to the version that we build. Rather, to the 
-# version that we runs. If we build for 2.4 using 2.4 headers on a 2.6
-# system with udev mounted on /dev , no point in installing files to /dev
-# because they'll be wiped at next reboot.
-DYNFS:=$(shell ps ax | grep -v grep | grep -qw 'devfsd\|udevd' && echo "yes")
-
-# Check for udev permissions directories
-ifneq (,$(wildcard $(ROOT_PREFIX)/etc/udev/rules.d))
-  UDEVRULES=yes
-  ifneq (,$(wildcard $(ROOT_PREFIX)/etc/udev/permissions.d))
-    UDEVPERMISSIONS=yes
-  endif
-endif
-
-CHKCONFIG:=$(shell sh -c 'type -p chkconfig' 2> /dev/null)
-ifndef CHKCONFIG
-CHKCONFIG:=:
-endif
-
-ifneq ($(wildcard .version),)
-  ZAPTELVERSION:=$(shell cat .version)
-endif
-
-# CVS mirrors of SVN have .svnrevision files showing
-# which SVN revision they are based on, and .svnbranch
-# showing the branch they are made from
-ifneq ($(wildcard .svnrevision),)
-  ZAPTELVERSION:=SVN-$(shell cat .svnbranch)-r$(shell cat .svnrevision)
-else
-  ifneq ($(wildcard .svn),)
-    ZAPTELVERSION=SVN-$(shell build_tools/make_svn_branch_name)
-  endif
-endif
-
-TZOBJS:=zonedata.lo tonezone.lo
-LIBTONEZONE_SO:=libtonezone.so
-LIBTONEZONE_SO_MAJOR_VER:=1
-LIBTONEZONE_SO_MINOR_VER:=0
-
-MODULES:=zaptel tor2 torisa wcusb wcfxo wctdm wctdm24xxp \
-	 ztdynamic ztd-eth wct1xxp wct4xxp wcte11xp pciradio \
-         ztd-loc # ztdummy
-#MODULES+=wcfxsusb
-# build ztdummy by default for 2.6 kernels
-ifeq (${BUILDVER},linux26)
-MODULES+=ztdummy
-endif
-
-MODULESO:=$(MODULES:%=%.o)
-MODULESKO:=$(MODULES:%=%.ko)
-ifeq ($(BUILDVER),linux26)
-MODULES_BUILD:=$(MODULESKO)
-else
-MODULES_BUILD:=$(MODULESO)
-endif
-
-BIN_DIR:=$(INSTALL_PREFIX)/sbin
-LIB_DIR:=$(INSTALL_PREFIX)/usr/lib
-INC_DIR:=$(INSTALL_PREFIX)/usr/include
-MOD_DIR:=$(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc
-
-MOD_DESTDIR:=zaptel
-
-obj-m:=$(MODULESO)
-
-# Also build xpp in the subdirectory xpp/ . But only for >=2.6.10 and only 
-# for i386. On other archs the module will probably build but panic.
-# This line is only meaningful when this Makefile is used as kconfig for 
-# 2.6 build
-
-ifneq (,$(shell [ 0$(SUBLEVEL) -ge 10 ] && [ "$(ARCH)" = 'i386' ] && echo 1))
-obj-m+=xpp/
-endif
-
-ifneq (,$(wildcard /usr/include/newt.h))
-ZTTOOL:=zttool
-endif
-BINS:=ztcfg ztmonitor ztspeed $(ZTTOOL) zttest fxotune
-UTILS:=tor2ee ztspeed zttool ztmonitor sethdlc-new \
-  usbfxstest fxstest fxotune fxsdump ztdiag
-UTILSO:=$(UTILS:%=%.o)
-
-#PRIMARY=wcfxsusb
-PRIMARY=torisa
-#PRIMARY=wcfxo
-PWD:=$(shell pwd)
-
-all: modules $(LIBTONEZONE_SO)
-
-programs: $(BINS)
-
-modules: $(BUILDVER)
-
-linux24: prereq $(MODULESO) $(BINS)
-
-linux26: prereq $(BINS)
-	@echo $(KSRC)
-	@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
-
-xpp: linux26
-
-#ifneq ($(TOPDIR),)
-#include $(TOPDIR)/Rules.make
-#endif
-
-version.h: FORCE
-	ZAPTELVERSION="${ZAPTELVERSION}" build_tools/make_version_h > $@.tmp
-	if cmp -s $@.tmp $@ ; then echo; else \
-		mv $@.tmp $@ ; \
-	fi
-	rm -f $@.tmp
-
-devel: tor2ee 
-
-tests: patgen pattest patlooptest hdlcstress hdlctest hdlcgen hdlcverify timertest
+version.h: ../version.h
+	cp $^ $@
 
 tor2.o: tor2-hw.h tor2fw.h
   
@@ -237,290 +55,28 @@
 
 ztdummy.o: ztdummy.h
 
-$(MODULESO): %.o: %.c zaptel.h
+$(MODULESO): %.o: %.c zaptel.h version.h
 	$(HOSTCC) $(KFLAGS) -o $@ -c $<
 
-tor2ee.o: tor2-hw.h
+tones.h: ../tones.h
+	cp $^ $@
 
-tor2ee: LDFLAGS+=-lpci
+tor2fw.h: ../tor2fw.h
+	cp $^ $@
 
-zonedata.lo: zonedata.c
-	$(CC) -c $(LCFLAGS) -o $@ $^
+radfw.h: ../radfw.h
+	cp $^ $@
 
-tonezone.lo: tonezone.c
-	$(CC) -c $(LCFLAGS) -o $@ $^
+zaptel.c: tones.h
 
-torisatool: torisatool.o
-	$(CC) -o $@ $^
-
-tones.h: gendigits
-	./gendigits > $@
-
-tor2fw.h: makefw tormenta2.rbt
-	./makefw tormenta2.rbt tor2fw > tor2fw.h
-
-radfw.h: makefw pciradio.rbt
-	./makefw pciradio.rbt radfw > radfw.h
-
-gendigits: LDFLAGS+=-lm
-
-zaptel.c: tones.h 
-
-prereq: tones.h tor2fw.h radfw.h version.h
-
-zttool.o: zttool.c zaptel.h
-
-ztprovision.o: ztprovision.c zaptel.h
-
-ztmonitor.o: ztmonitor.c zaptel.h
-
-ztspeed: CFLAGS=
-ztspeed.o: CFLAGS=
-zttool: LDFLAGS+=-lnewt
-sethdlc-new.o: CFLAGS+=-I$(KINCLUDES)
-
-libtonezone.a: $(TZOBJS)
-	ar rcs libtonezone.a $^
-
-$(LIBTONEZONE_SO): $(TZOBJS)
-	$(CC) -shared -Wl,-soname,$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) -lm -o $@ $^
-
-ztcfg.c: ztcfg.h
-
-ztcfg-shared: ztcfg.o $(LIBTONEZONE_SO)
-	$(CC) -o $@ $^ -lm
-
+# TODO: what about this one?
 data:
 	$(MAKE) -C datamods datamods
 
-ztcfg: ztcfg.o libtonezone.a
-	$(CC) -o $@ $^ -lm
-
-ztcfg-dude: ztcfg-dude.o mknotch.o complex.o $(LIBTONEZONE_SO)
-	$(CC) -o $@ $^ -lm
-
-mknotch.o: mknotch.cc
-	$(CC) -o $@ -c $^
-
-complex.o: complex.cc
-	$(CC) -o $@ -c $^
-
-usbfxstest: LDFLAGS+=-lzap
-fxstest: $(LIBTONEZONE_SO)
-fxstest: LDFLAGS+=-lm
-fxotune: LDFLAGS+=-lm
-fxsdump: LDFLAGS+=-lm
-
-stackcheck: checkstack $(BUILDVER)
-	./checkstack *.o
-
-$(UTILS): %: %.o
-	$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
-
-$(UTILSO): %.o: %.c
-	$(CC) $(CFLAGS) -o $@ -c $<
-
-devices:
-ifndef DYNFS
-	mkdir -p $(INSTALL_PREFIX)/dev/zap
-	rm -f $(INSTALL_PREFIX)/dev/zap/ctl
-	rm -f $(INSTALL_PREFIX)/dev/zap/channel
-	rm -f $(INSTALL_PREFIX)/dev/zap/pseudo
-	rm -f $(INSTALL_PREFIX)/dev/zap/timer
-	rm -f $(INSTALL_PREFIX)/dev/zap/253
-	rm -f $(INSTALL_PREFIX)/dev/zap/252
-	rm -f $(INSTALL_PREFIX)/dev/zap/251
-	rm -f $(INSTALL_PREFIX)/dev/zap/250
-	mknod $(INSTALL_PREFIX)/dev/zap/ctl c 196 0
-	mknod $(INSTALL_PREFIX)/dev/zap/timer c 196 253
-	mknod $(INSTALL_PREFIX)/dev/zap/channel c 196 254
-	mknod $(INSTALL_PREFIX)/dev/zap/pseudo c 196 255
-	N=1; \
-	while [ $$N -lt 250 ]; do \
-		rm -f $(INSTALL_PREFIX)/dev/zap/$$N; \
-		mknod $(INSTALL_PREFIX)/dev/zap/$$N c 196 $$N; \
-		N=$$[$$N+1]; \
-	done
-else # DYNFS
-  ifdef UDEVRULES
-    ifdef UDEVPERMISSIONS
-	install -m 444 udev/zaptel.rules $(INSTALL_PREFIX)/etc/udev/rules.d
-	install -m 444 udev/zaptel.permissions $(INSTALL_PREFIX)/etc/udev/permissions.d
-    else # !UDEVPERMISSIONS (newer, combined syntax)
-	install -m 444 udev/zaptel.rules-combined $(INSTALL_PREFIX)/etc/udev/rules.d/zaptel.rules
-    endif
-  else # !UDEVRULES
-	@echo "**** Dynamic filesystem detected -- not creating device nodes"
-  endif
-endif
-
-install: all devices
-	install -D -m 755 ztcfg $(INSTALL_PREFIX)/sbin/ztcfg
-	if [ -f sethdlc-new ]; then \
-		install -D -m 755 sethdlc-new $(INSTALL_PREFIX)/sbin/sethdlc; \
-	elif [ -f sethdlc ]; then \
-		install -D -m 755 sethdlc $(INSTALL_PREFIX)/sbin/sethdlc ; \
-	fi
-	if [ -f zttool ]; then install -D -m 755 zttool $(INSTALL_PREFIX)/sbin/zttool; fi
-	if [ -f zaptel.ko ]; then \
-		for x in $(MODULESKO); do \
-			rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/extra/$$x ; \
-		done; \
-		$(KMAKE_INST); \
-		if [ -f datamods/syncppp.ko ]; then \
-			$(MAKE) -C datamods install; \
-		else \
-			rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/{hdlc_*,syncppp}.ko; \
-		fi; \
-		if ! [ -f wcfxsusb.ko ]; then \
-			rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxsusb.ko; \
-		fi; \
-		rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxs.ko; \
-	else \
-		for x in $(MODULESO); do \
-			install -D -m 644 $$x $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/$$x ; \
-		done; \
-		if ! [ -f wcfxsusb.o ]; then \
-			rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxsusb.o; \
-		fi; \
-		rm -f $(INSTALL_PREFIX)/lib/modules/$(KVERS)/misc/wcfxs.o; \
-	fi
-	install -D -m 755 $(LIBTONEZONE_SO) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER)
-	[ `id -u` = 0 ] && /sbin/ldconfig || :
-	rm -f $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO)
-	ln -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \
-		$(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER)
-	ln -sf $(LIBTONEZONE_SO).$(LIBTONEZONE_SO_MAJOR_VER).$(LIBTONEZONE_SO_MINOR_VER) \
-		$(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO)
-	if [ -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE_SO); fi
-	install -D -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/linux/zaptel.h
-	install -D -m 644 torisa.h $(INSTALL_PREFIX)/usr/include/linux/torisa.h
-	install -D -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include/tonezone.h
-	install -m 644 doc/ztcfg.8 $(INSTALL_PREFIX)/usr/share/man/man8
-	install -m 644 doc/zttool.8 $(INSTALL_PREFIX)/usr/share/man/man8
-	if [ -n "$(MODCONF)" ]; then \
-		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" | \
-		grep -v "post-install wcfxsusb /sbin/ztcfg" | \
-		grep -v "alias wctdm" | \
-		grep -v "post-install wctdm /sbin/ztcfg" > $(MODCONF); \
-		if ! grep "options torisa" $(MODCONF); then \
-			echo "options torisa base=$(BASEADDR)" >> $(MODCONF); \
-		fi; \
-		if ! grep "alias char-major-196" $(MODCONF); then \
-			echo "alias char-major-196 $(PRIMARY)" >> $(MODCONF); \
-		fi; \
-		for x in $(MODULES); do \
-			if ! grep -q "post-install $$x" $(MODCONF); then \
-				if ! grep -q "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 ! grep "ias wcfxs" $(MODCONF); then \
-			echo "alias wcfxs wctdm" >> $(MODCONF); \
-		fi; \
-		if ! grep "alias wct2xxp" $(MODCONF); then \
-			echo "alias wct2xxp wct4xxp" >> $(MODCONF); \
-		fi; \
-	fi
-	if [ -d /etc/modutils ]; then \
-		/sbin/update-modules ; \
-	fi
-	[ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
-	[ -f $(CONFIG_FILE) ] || install -D -m 644 zaptel.conf.sample $(CONFIG_FILE)
-
-install-udev:
-  ifdef UDEVRULES
-    ifdef UDEVPERMISSIONS
-	install -m 444 udev/zaptel.rules $(INSTALL_PREFIX)/etc/udev/rules.d
-	install -m 444 udev/zaptel.permissions $(INSTALL_PREFIX)/etc/udev/permissions.d
-    else # !UDEVPERMISSIONS (newer, combined syntax)
-	install -m 444 udev/zaptel.rules-combined $(INSTALL_PREFIX)/etc/udev/rules.d/zaptel.rules
-    endif
-  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; \
-		$(CHKCONFIG) --add zaptel; \
-	elif [ -d $(INSTALL_PREFIX)/etc/init.d ]; then \
-		install -D -m 755 zaptel.init $(INSTALL_PREFIX)/etc/init.d/zaptel; \
-		$(CHKCONFIG) --add zaptel; \
-	fi 
-	if [ -d /etc/default ] && [ ! -f /etc/default/zaptel ]; then \
-			install -D -m 644 zaptel.sysconfig $(INSTALL_PREFIX)/etc/default/zaptel; \
-	fi
-	if [ -d /etc/sysconfig ] && [ ! -f /etc/sysconfig/zaptel ]; then \
-		install -D -m 644 zaptel.sysconfig $(INSTALL_PREFIX)/etc/sysconfig/zaptel; \
-	fi
-	if [ -d /etc/sysconfig/network-scripts ]; then \
-		install -D -m 755 ifup-hdlc $(INSTALL_PREFIX)/etc/sysconfig/network-scripts/ifup-hdlc; \
-	fi
-
-update:
-	@if [ -d .svn ]; then \
-		echo "Updating from Subversion..." ; \
-		svn update | tee update.out; \
-		rm -f .version; \
-		if [ `grep -c ^C update.out` -gt 0 ]; then \
-			echo ; echo "The following files have conflicts:" ; \
-			grep ^C update.out | cut -b4- ; \
-		fi ; \
-		rm -f update.out; \
-	elif [ -d CVS ]; then \
-		echo "Updating from CVS..." ; \
-		cvs -q -z3 update -Pd | tee update.out; \
-		rm -f .version; \
-		if [ `grep -c ^C update.out` -gt 0 ]; then \
-			echo ; echo "The following files have conflicts:" ; \
-			grep ^C update.out | cut -d' ' -f2- ; \
-		fi ; \
-		rm -f update.out; \
-	else \
-		echo "Not under version control";  \
-	fi
-
-# make should *fail* and not silently succeed if a program did not build
-install-programs: $(BINS) $(LIBTONEZONE) libtonezone.a
-	install -d $(BIN_DIR)
-	install $(BINS) $(BIN_DIR)
-	install -d $(LIB_DIR)
-	install -m 755 $(LIBTONEZONE) libtonezone.a $(LIB_DIR)
-	install -d $(INC_DIR)/linux
-	install -m 644 tonezone.h $(INC_DIR)
-	install -m 644 zaptel.h torisa.h $(INC_DIR)/linux
-
-install-modules: install-$(BUILDVER)
-install-linux24: $(MODULES_BUILD)
-	install -d $(MOD_DIR)
-	install -m 644 $(MODULES_BUILD) $(MOD_DIR)
-
-install-linux26: $(MODULESKO)
-	$(KMAKE_INST)
-
 clean:
-	rm -f torisatool makefw tor2fw.h radfw.h
-	rm -f ${BINS}
-	rm -f *.o ztcfg tzdriver sethdlc sethdlc-new
-	rm -f $(TZOBJS) $(LIBTONEZONE_SO) *.lo
-ifeq (${BUILDVER},linux26)
-	$(KMAKE) clean
-	$(MAKE) -C datamods clean
-endif
-	rm -f xpp/*.ko xpp/*.mod.c xpp/.*o.cmd
-	rm -f xpp/*.o xpp/*.mod.o
+	rm -f makefw tor2fw.h radfw.h
+	rm -f *.o 
 	rm -rf .tmp_versions
 	rm -f gendigits tones.h
-	rm -f libtonezone*
-	rm -f tor2ee
-	rm -f fxotune
-	rm -f core
-	rm -f ztcfg-shared fxstest
 
 FORCE:



More information about the zaptel-commits mailing list