?? makefile
字號:
## Makefile for tormenta/carrier driver and utilities# $Id: Makefile,v 1.52.2.6 2005/01/17 00:57:59 russell Exp $#BASEADDR=0xd0000## Okay, the people at RedHat have to break everything they can possibly even attempt to.# So, we have to look in /usr/src/linux-2.4/include for header files given their brain dead# crappy installation. (Mind you, I'm a RedHat user myself, so I suppose I'm just as# stupid as they are). Everyone else who is mildly sane of course links /usr/include/linux# to their working kernel source directory, the way God himself does, of course# (assuming He's running Linux -- which we all know He must).#HOSTCC=gccKINCLUDES=$(shell if [ -d /usr/src/linux-2.4/include ]; then echo /usr/src/linux-2.4/include ; else echo /usr/src/linux/include ; fi)CFLAGS+=-I. -O4 -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVERCFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)CFLAGS+=$(shell if uname -m | grep -q x86_64; then echo "-m64"; fi)LCFLAGS=-fPIC $(CFLAGS) -DBUILDING_TONEZONEKFLAGS+=-I/usr/src/linux-2.4/include -O6KFLAGS+=-DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -I/usr/src/linux/drivers/net \ -Wall -I. -Wstrict-prototypes -fomit-frame-pointer -I/usr/src/linux/drivers/net/wan -I /usr/src/linux/include -I/usr/src/linux/include/netKFLAGS+=$(shell [ -f $(KINCLUDES)/linux/modversions.h ] && echo "-DMODVERSIONS -include $(KINCLUDES)/linux/modversions.h")KFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-msoft-float -fsigned-char"; fi)## Features are now configured in zconfig.h##KFLAGS+=-DSTANDALONE_ZAPATACFLAGS+=-DSTANDALONE_ZAPATAROOT_PREFIX=INSTALL_PREFIX=CONFIG_FILE=$(INSTALL_PREFIX)/etc/zaptel.confCFLAGS+=-DZAPTEL_CONFIG=\"$(CONFIG_FILE)\"BUILDVER=$(shell if uname -r | grep -q ^2.6; then echo "linux26"; else echo "linux24"; fi)MODCONF=$(shell if [ -d $(ROOT_PREFIX)/etc/modprobe.d ]; then echo "$(ROOT_PREFIX)/etc/modprobe.d/zaptel"; elif [ -d $(ROOT_PREFIX)/etc/modutils ]; then echo "$(ROOT_PREFIX)/etc/modutils/zaptel"; elif [ -f $(ROOT_PREFIX)/etc/modprobe.conf ]; then echo "$(ROOT_PREFIX)/etc/modprobe.conf"; elif [ -f $(ROOT_PREFIX)/etc/modules.conf ]; then echo "$(ROOT_PREFIX)/etc/modules.conf"; else echo $(ROOT_PREFIX)/etc/conf.modules ; fi)ifeq (${BUILDVER},linux24)#We only support DEVFS in linux 2.4 kernels, since its considered obsolete post 2.4DYNFS=$(shell ps ax | grep -v grep | grep -q devfsd && echo "yes")endififeq (${BUILDVER},linux26)#Tests for newer linux-2.6 udev supportDYNFS=$(shell ps ax | grep -v grep | grep udevd && echo "yes")endifTZOBJS=zonedata.lo tonezone.loLIBTONEZONE=libtonezone.so.1.0MODULES=zaptel tor2 torisa wcusb wcfxo wcfxs \ ztdynamic ztd-eth wct1xxp wct4xxp wcte11xp # ztdummy#MODULES+=wcfxsusbMODULESO=$(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)BINS=ztcfg torisatool makefw ztmonitor ztspeed $(ZTTOOL) zttest#PRIMARY=wcfxsusbPRIMARY=torisa#PRIMARY=wcfxoPWD=$(shell pwd)KERNEL_SOURCE?=/lib/modules/`uname -r`/buildall: $(BUILDVER)linux24: $(MODULESO) $(BINS)linux26: linux26: prereq $(BINS) @if ! [ -d $(KERNEL_SOURCE) ]; then echo "You do not appear to have the kernel sources for your current kernel installed."; exit 1 ; fi make -C $(KERNEL_SOURCE) SUBDIRS=$(PWD) modulesobj-m := $(MODULESO) ztdummy.o#ifneq ($(TOPDIR),)#include $(TOPDIR)/Rules.make#endifMOD_DESTDIR := zapteldevel: tor2ee tests: patgen pattest patlooptest hdlcstress hdlctest hdlcgen hdlcverify timertesttor2.o: tor2.c tor2-hw.h tor2fw.h zaptel.h $(HOSTCC) $(KFLAGS) -c tor2.czaptel.o: zaptel.c zaptel.h digits.h arith.h sec.h mec.h sec-2.h mec2.h mec3.h zconfig.h $(HOSTCC) $(KFLAGS) -c zaptel.ctorisa.o: torisa.c zaptel.h torisa.h $(HOSTCC) $(KFLAGS) -c torisa.cwcusb.o: wcusb.c wcusb.h zaptel.h $(HOSTCC) $(KFLAGS) -c wcusb.cwcfxsusb.o: wcfxsusb.c wcfxsusb.h zaptel.h $(HOSTCC) $(KFLAGS) -c wcfxsusb.cwcfxo.o: wcfxo.c zaptel.h $(HOSTCC) $(KFLAGS) -c wcfxo.cwct1xxp.o:wct1xxp.c zaptel.h $(HOSTCC) $(KFLAGS) -c wct1xxp.cwcte11xp.o:wcte11xp.c zaptel.h $(HOSTCC) $(KFLAGS) -c wcte11xp.cwct4xxp.o:wct4xxp.c zaptel.h $(HOSTCC) $(KFLAGS) -c wct4xxp.cwcfxs.o:wcfxs.c zaptel.h $(HOSTCC) $(KFLAGS) -c wcfxs.cwcs3200p.o:wcs3200p.c zaptel.h $(HOSTCC) $(KFLAGS) -c wcs3200p.cztdummy.o:ztdummy.c ztdummy.h $(HOSTCC) $(KFLAGS) -c ztdummy.cztdynamic.o: ztdynamic.c zaptel.h $(HOSTCC) $(KFLAGS) -c ztdynamic.cztd-eth.o: ztd-eth.c zaptel.h $(HOSTCC) $(KFLAGS) -c ztd-eth.ctor2ee.o: tor2-hw.htor2ee: tor2ee.o $(CC) $(CFLAGS) -o tor2ee tor2ee.o -lpcizonedata.lo: zonedata.c $(CC) -c $(LCFLAGS) -o zonedata.lo zonedata.ctonezone.lo: tonezone.c $(CC) -c $(LCFLAGS) -o tonezone.lo tonezone.ctorisatool: torisatool.o $(CC) -o torisatool torisatool.otones.h: gendigits ./gendigitstor2fw.h: makefw tormenta2.rbt ./makefw tormenta2.rbt tor2fw > tor2fw.hgendigits: gendigits.o $(CC) -o gendigits gendigits.o -lmzaptel.c: tones.h prereq: tones.h tor2fw.hzttool.o: zttool.c zaptel.hztprovision.o: ztprovision.c zaptel.hztmonitor.o: ztmonitor.c zaptel.hztspeed.o: ztspeed.c $(CC) -c ztspeed.czttool: zttool.o $(CC) -o zttool zttool.o -lnewtztprovision: ztprovision.o $(CC) -o ztprovision ztprovision.o -lnewtztmonitor: ztmonitor.o $(CC) -o ztmonitor ztmonitor.oztcat: ztcat.o $(CC) -o ztcat ztcat.o -ltonezoneztspeed: ztspeed.o $(CC) -o ztspeed ztspeed.osethdlc-new: sethdlc-new.o $(CC) -o sethdlc-new sethdlc-new.osethdlc-new.o: sethdlc-new.c $(CC) -c $(CFLAGS) -I$(KINCLUDES) sethdlc-new.clibtonezone.a: $(TZOBJS) ar rcs libtonezone.a $(TZOBJS)$(LIBTONEZONE): $(TZOBJS) $(CC) -shared -Wl,-soname,libtonezone.so.1 -lm -o $@ $(TZOBJS) [ `id -u` = 0 ] && /sbin/ldconfig || : ln -sf libtonezone.so.1 libtonezone.so ztcfg.c: ztcfg.hztcfg-shared: ztcfg.o $(LIBTONEZONE) $(CC) -o ztcfg-shared ztcfg.o -lm -L. -ltonezoneztcfg: ztcfg.o libtonezone.a $(CC) -o ztcfg ztcfg.o -lm -L. libtonezone.aztcfg-dude: ztcfg-dude.o mknotch.o complex.o $(LIBTONEZONE) $(CC) -o ztcfg ztcfg-dude.o mknotch.o complex.o -lm -L. -ltonezonemknotch.o: mknotch.cc $(CC) -c mknotch.cccomplex.o: complex.cc $(CC) -c complex.ccusbfxstest.o: usbfxstest.c $(CC) -g -c usbfxstest.cusbfxstest: usbfxstest.o $(CC) -o usbfxstest usbfxstest.o -lzapfxstest: fxstest.o $(CC) -o fxstest fxstest.o -ltonezonefxsdump: fxsdump.o $(CC) -o fxsdump fxsdump.o -lmstackcheck: checkstack $(BUILDVER) ./checkstack *.odevices:ifeq ($(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]; \ doneelse @echo "**** Dynamic filesystem detected -- not creating device nodes" @echo "**** If you are running udev, read README.udev"endifinstall: all devices $(LIBTONEZONE) 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) ztdummy.ko; do \ install -D -m 644 $$x $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/$$x ; \ 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 -D -m 644 $$x $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/$$x ; \ done; \ if ! [ -f wcfxsusb.o ]; then \ rm -f $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/wcfxsusb.ko; \ fi; \ fi install -D -m 755 $(LIBTONEZONE) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE) if [ -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE); 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 ( cd $(INSTALL_PREFIX)/usr/lib ; rm -f libtonezone.so ; ln -sf $(LIBTONEZONE) libtonezone.so ) [ `id -u` = 0 ] && /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" | \ 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 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 [ `id -u` = 0 ] && /sbin/depmod -a || : [ -f $(CONFIG_FILE) ] || install -D -m 644 zaptel.conf.sample $(CONFIG_FILE)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 [ ! -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 clean: rm -f torisatool makefw tor2fw.h rm -f zttool rm -f *.o ztcfg tzdriver sethdlc sethdlc-new rm -f $(TZOBJS) $(LIBTONEZONE) *.lo rm -f *.ko *.mod.c .*o.cmd rm -f gendigits tones.h rm -f libtonezone* rm -f tor2ee rm -f core
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -