Makefile.in
上传用户:weyjxb
上传日期:2020-05-18
资源大小:52k
文件大小:6k
- # Makefile for Quicknet Telephony cards Linux Drivers
- #
- # This program is free software; you can redistribute it and/or
- # modify it under the terms of the GNU General Public License
- # as published by the Free Software Foundation; either version
- # 2 of the License, or (at your option) any later version.
- #
- # Authors: Craig Southeren <csoutheren@quicknet.net>
- #
- # Modified from the original by Greg Herlein
- #
- # Original Makefile created by Greg Herlen and Ed Okerson
- #
- # $Log: Makefile.in,v $
- # Revision 1.5 2002/04/20 06:18:51 tadavis
- # Created a new /proc interface.
- #
- # Revision 1.4 2002/02/26 06:13:13 tadavis
- # Bug fixes for asterisk.
- #
- # - fix poll
- # - fix read
- #
- # Revision 1.3 2002/02/25 04:32:49 tadavis
- # Fixed makefile for tagbuild.
- #
- # Revision 1.2 2002/02/25 04:28:03 tadavis
- # Added RPM spec file; made sure it was correct in the Makefile.
- #
- # Revision 1.1.1.1 2001/11/14 05:05:12 tadavis
- # Imported Sources
- #
- #
- #
- KERNEL_DIR = @KERNEL_DIR@
- INCLUDE_DIR = @INCLUDE_DIR@
- ifdef RPM_BUILD_ROOT
- MODULE_DIR = $(RPM_BUILD_ROOT)@MODULE_DIR@
- else
- MODULE_DIR = @MODULE_DIR@
- endif
- VOIP_MAX = @VOIP_MAX@
- RMMOD = @RMMOD@
- LSMOD = @LSMOD@
- DEPMOD = @DEPMOD@
- INSTALL = @INSTALL@
- #
- # set compile flags
- #
- CFLAGS = -D__KERNEL__ -DMODULE -Wall -I$(INCLUDE_DIR)
- #
- # Comment/uncomment the following line to enable/disable debugging
- #
- #DEBUG = y
- ifeq ($(DEBUG),y)
- CFLAGS += -O -g -DVOIP_DEBUG
- else
- CFLAGS += -O2
- endif
- #
- # include kernel flags
- #
- ifeq (0,$(shell if test -e $(KERNEL_DIR)/.config ; then echo 0 ; fi))
- include $(KERNEL_DIR)/.config
- endif
- MODFLAGS:=
- #
- # include MODULE versions if needed
- #
- ifdef CONFIG_MODVERSIONS
- CFLAGS += -DMODVERSIONS -include $(KERNEL_DIR)/include/linux/modversions.h
- endif
- all: voipblaster.o phonedev.o
- ##################################################
- voip-proc.o: voipblaster.h ixjuser.h
- voip-device.o: voipblaster.h ixjuser.h voip-ver.h
- voipblaster.o: voip-proc.o voip-device.o voipblaster.h ixjuser.h
- # ${CC} ${CFLAGS} -o $@ -c voipblaster.c -DVOIP_MAX=$(VOIP_MAX)
- $(LD) -r -o $@ voip-proc.o voip-device.o
- phonedev.o: phonedev.c phonedev.h
- ${CC} ${CFLAGS} -DEXPORT_SYMTAB -o $@ -c phonedev.c
- INSTALLTARGS = voipblaster.o phonedev.o
- ##################################################
- install: $(INSTALLTARGS) devices
- @mkdir -p $(MODULE_DIR)
- @for module in $(INSTALLTARGS) ; do
- echo Installing $$module... ;
- $(INSTALL) $$module $(MODULE_DIR) ;
- done
- $(DEPMOD) -ae
- @if $(LSMOD) | grep -q voipblaster ; then echo Unloading voipblaster... ; $(RMMOD) voipblaster ; fi
- @if $(LSMOD) | grep -q phonedev ; then echo Unloading phonedev... ; $(RMMOD) phonedev ; fi
- @echo "Enter "modprobe voipblaster" to load the driver"
- ##################################################
- rpm_install: $(INSTALLTARGS) devices
- @mkdir -p $(MODULE_DIR)
- @for module in $(INSTALLTARGS) ; do
- echo Installing $$module... ;
- cp $$module $(MODULE_DIR) ;
- done
- ##################################################
- devices:
- @for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
- DEVICE=/dev/phone$$i ;
- if test ! -c $$DEVICE ; then
- echo "Adding $$DEVICE" ;
- mknod $$DEVICE c 100 $$i ;
- chmod a+rw $$DEVICE ;
- fi ;
- done
- ##################################################
- rpm_devices:
- mkdir -p $(RPM_BUILD_ROOT)/dev
- @for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do
- DEVICE=$(RPM_BUILD_ROOT)/dev/phone$$i ;
- if test ! -c $$DEVICE ; then
- echo "Adding $$DEVICE" ;
- mknod $$DEVICE c 100 $$i ;
- chmod a+rw $$DEVICE ;
- fi ;
- done
- ##################################################
- HDRDIR = /usr/include/linux
- install-headers:
- @for hdr in telephony.h phonedev.h ixjuser.h ; do
- if cmp -s $$hdr $(HDRDIR)/$$hdr ; then
- echo $$hdr same as already installed ;
- else
- echo Installing $$hdr... ;
- mv $(HDRDIR)/$$hdr $(HDRDIR)/$${hdr}.old ;
- install $$hdr $(HDRDIR) ;
- fi
- done
- ##################################################
- VERSION_FILE = voip-ver.h
- SPEC_FILE = voipblaster.spec
- MAJOR_VERSION:=$(strip $(subst #define,, $(subst VOIP_VER_MAJOR,,
- $(shell grep "define VOIP_VER_MAJOR *" $(VERSION_FILE)))))
- MINOR_VERSION:=$(strip $(subst #define,, $(subst VOIP_VER_MINOR,,
- $(shell grep "define *VOIP_VER_MINOR*" $(VERSION_FILE)))))
- BUILD_VER:=$(strip $(subst #define,,$(subst VOIP_BLD_VER,,
- $(shell grep "define *VOIP_BLD_VER" $(VERSION_FILE)))))
- VERSION := $(MAJOR_VERSION).$(MINOR_VERSION).$(BUILD_VER)
- CVS_TAG := v$(MAJOR_VERSION)_$(MINOR_VERSION)_$(BUILD_VER)
- tagbuild:
- cvs tag -c $(CVS_TAG)
- let BLD=$(BUILD_VER)+1 ;
- echo "Incrementing to build number $$BLD";
- sed "s/VOIP_BLD_VER[ ]*[0-9]*.*$$/VOIP_BLD_VER $$BLD/" $(VERSION_FILE) > $(VERSION_FILE).new
- mv -f $(VERSION_FILE).new $(VERSION_FILE)
- sed "s/e VOIP_BLD_VER[ ]*[0-9]*.*$$/e VOIP_BLD_VER $$BLD/" $(SPEC_FILE) > $(SPEC_FILE).new
- mv -f $(SPEC_FILE).new $(SPEC_FILE)
- cvs commit -m "Incremented build number after tagging." $(VERSION_FILE)
- rpmtag:
- let BLD=$(BUILD_VER)+1 ;
- echo "Incrementing to build number $$BLD";
- sed "s/e VOIP_BLD_VER[ ]*[0-9]*.*$$/e VOIP_BLD_VER $$BLD/" $(SPEC_FILE) > $(SPEC_FILE).new
- mv -f $(SPEC_FILE).new $(SPEC_FILE)
- ##################################################
- TARFILE = voipblaster-$(VERSION)-src.tar.gz
- DISTDIR = voipblaster-$(VERSION)
- dist:
- @rm -rf $(DISTDIR)
- @mkdir $(DISTDIR)
- @cp voip-device.c voip-proc.c voipblaster.h ixjuser.h telephony.h phonedev.c phonedev.h
- configure configure.in Makefile.in voip-config.h.in voip-ver.h
- CHANGES COPYING VOIP-DRIVER-HOWTO INSTALL install-sh
- voipblaster.spec $(DISTDIR)
- tar -czvf $(TARFILE) $(DISTDIR)
- @rm -rf $(DISTDIR)
- ##################################################
- clean:
- rm -rf *.o *~ *.bak *.old *.gz config.cache config.log config.status $(TARFILE)
- dist-clean: clean
- rm -rf config.h Makefile
- pristine: dist-clean
- rm -rf configure