summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2001-12-08 19:06:36 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2001-12-08 19:06:36 +0000
commit295b744618e906719d1ef077dc31d9ff975fe21c (patch)
treeca5c237765e45c5eac033be66be476ee7bc49efe /Makefile
parent954abd6c016492772dab9990f66857b969ec03dc (diff)
Version 0.1.4 from FTP
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@36 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'Makefile')
-rwxr-xr-xMakefile34
1 files changed, 27 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 4b45c64..31c3be7 100755
--- a/Makefile
+++ b/Makefile
@@ -31,18 +31,20 @@ KFLAGS+=-DDEFAULT_TONE_ZONE=$(DEFAULTZONE)
KFLAGS+=-DTORMENTA_BASE=$(BASEADDR)
KFLAGS+=-DSTANDALONE_ZAPATA
+CFLAGS+=-DSTANDALONE_ZAPATA
+
MODCONF=$(shell if [ -f /etc/modules.conf ]; then echo /etc/modules.conf; else echo /etc/conf.modules ; fi)
TZOBJS=zonedata.lo tonezone.lo
LIBTONEZONE=libtonezone.so.1.0
-MODULES=zaptel.o tor2.o torisa.o wcfxsusb.o wcfxo.o
+MODULES=zaptel.o tor2.o torisa.o wcfxsusb.o wcfxo.o wcfxs.o
MODULES+=$(shell if [ -f wct1xxp.c ]; then echo wct1xxp.o; fi)
-
-PRIMARY=wcfxsusb
-#PRIMARY=torisa
+ZTTOOL=$(shell if [ -f /usr/include/newt.h ]; then echo zttool; fi)
+#PRIMARY=wcfxsusb
+PRIMARY=torisa
#PRIMARY=wcfxo
-all: $(MODULES) ztcfg torisatool makefw
+all: $(MODULES) ztcfg torisatool makefw $(ZTTOOL) sethdlc
devel: tor2ee
@@ -66,6 +68,9 @@ wcfxo.o: wcfxo.c zaptel.h
wct1xxp.o:wct1xxp.c
gcc $(KFLAGS) -c wct1xxp.c
+wcfxs.o:wcfxs.c
+ gcc $(KFLAGS) -c wcfxs.c
+
tor2ee.o: tor2-hw.h
tor2ee: tor2ee.o
@@ -91,6 +96,11 @@ gendigits: gendigits.o
zaptel.c: tones.h
+zttool.o: zttool.c zaptel.h
+
+zttool: zttool.o
+ $(CC) -o zttool zttool.o -lnewt
+
$(LIBTONEZONE): $(TZOBJS)
$(CC) -shared -Wl,-soname,libtonezone.so.1 -lm -o $@ $(TZOBJS)
/sbin/ldconfig -n .
@@ -118,6 +128,8 @@ devices:
install: all devices
install -m 755 ztcfg /sbin
+ install -m 755 sethdlc /sbin
+ if [ -f zttool ]; then install -m 755 zttool /sbin; fi
mkdir -p /lib/modules/`uname -r`/misc
for x in $(MODULES); do \
install -m 644 $$x /lib/modules/`uname -r`/misc ; \
@@ -130,16 +142,20 @@ install: all devices
( cd /usr/lib ; rm -f libtonezone.so ; ln -sf $(LIBTONEZONE) libtonezone.so )
/sbin/ldconfig
- mv -f $(MODCONF) $(MODCONF).bak
+ 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" > $(MODCONF)
+ grep -v "post-install wcfxsusb /sbin/ztcfg" | \
+ grep -v "post-install wcfxs /sbin/ztcfg" > $(MODCONF) || true
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
+ 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
@@ -152,11 +168,15 @@ install: all devices
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
/sbin/depmod -a
[ -f /etc/zaptel.conf ] || install -m 644 zaptel.conf.sample /etc/zaptel.conf
clean:
rm -f torisatool makefw tor2fw.h
+ rm -f zttool
rm -f *.o ztcfg tzdriver sethdlc
rm -f $(TZOBJS) $(LIBTONEZONE) *.lo
rm -f gendigits tones.h