2001-05-13 00:57:53 +08:00
|
|
|
#
|
|
|
|
# libpri: An implementation of Primary Rate ISDN
|
|
|
|
#
|
|
|
|
# Written by Mark Spencer <markster@linux-support.net>
|
|
|
|
#
|
|
|
|
# Copyright (C) 2001, Linux Support Services, Inc.
|
|
|
|
# All Rights Reserved.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
#
|
2003-07-08 07:37:18 +08:00
|
|
|
#
|
|
|
|
# Uncomment if you want libpri not send PROGRESS_INDICATOR w/ALERTING
|
|
|
|
#ALERTING=-DALERTING_NO_PROGRESS
|
|
|
|
|
2004-03-15 13:53:25 +08:00
|
|
|
# Uncomment if you want libpri to count number of Q921/Q931 sent/received
|
|
|
|
#LIBPRI_COUNTERS=-DLIBPRI_COUNTERS
|
|
|
|
|
2004-12-16 04:15:28 +08:00
|
|
|
CC=gcc
|
|
|
|
|
2004-05-22 12:25:53 +08:00
|
|
|
OSARCH=$(shell uname -s)
|
2004-09-01 01:40:59 +08:00
|
|
|
PROC=$(shell uname -m)
|
2004-05-22 12:25:53 +08:00
|
|
|
|
2001-05-13 00:57:53 +08:00
|
|
|
TOBJS=testpri.o
|
2004-03-29 16:09:01 +08:00
|
|
|
T2OBJS=testprilib.o
|
2001-05-13 00:57:53 +08:00
|
|
|
STATIC_LIBRARY=libpri.a
|
|
|
|
DYNAMIC_LIBRARY=libpri.so.1.0
|
2004-10-28 04:43:23 +08:00
|
|
|
STATIC_OBJS=pri.o q921.o prisched.o q931.o pri_facility.o
|
|
|
|
DYNAMIC_OBJS=pri.lo q921.lo prisched.lo q931.lo pri_facility.lo
|
2004-03-15 13:53:25 +08:00
|
|
|
CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g $(ALERTING) $(LIBPRI_COUNTERS)
|
2003-02-19 02:15:47 +08:00
|
|
|
INSTALL_PREFIX=
|
2004-12-16 04:15:28 +08:00
|
|
|
INSTALL_BASE=/usr
|
2004-05-22 12:25:53 +08:00
|
|
|
ifeq (${OSARCH},Linux)
|
|
|
|
LDCONFIG_FLAGS=-n
|
|
|
|
else
|
|
|
|
ifeq (${OSARCH},FreeBSD)
|
|
|
|
LDCONFIG_FLAGS=-m
|
|
|
|
CFLAGS += -I../zaptel -I../zapata
|
|
|
|
endif
|
|
|
|
endif
|
2004-12-16 04:15:28 +08:00
|
|
|
ifeq (${OSARCH},SunOS)
|
|
|
|
CFLAGS += -DSOLARIS -I../zaptel-solaris -lsocket -lnsl
|
|
|
|
SOFLAGS =
|
|
|
|
LDCONFIG = echo
|
|
|
|
INSTALL_BASE = /usr/local
|
|
|
|
else
|
|
|
|
SOFLAGS = -Wl,-soname,libpri.so.1
|
|
|
|
LDCONFIG = /sbin/ldconfig
|
|
|
|
endif
|
2001-05-13 00:57:53 +08:00
|
|
|
|
2004-09-01 01:40:59 +08:00
|
|
|
#The problem with sparc is the best stuff is in newer versions of gcc (post 3.0) only.
|
|
|
|
#This works for even old (2.96) versions of gcc and provides a small boost either way.
|
|
|
|
#A ultrasparc cpu is really v9 but the stock debian stable 3.0 gcc doesnt support it.
|
|
|
|
ifeq ($(PROC),sparc64)
|
|
|
|
PROC=ultrasparc
|
|
|
|
CFLAGS += -mtune=$(PROC) -O3 -pipe -fomit-frame-pointer -mcpu=v8
|
|
|
|
endif
|
|
|
|
|
2004-03-31 04:18:12 +08:00
|
|
|
all: depend $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
|
2001-05-13 00:57:53 +08:00
|
|
|
|
2004-01-27 08:39:59 +08:00
|
|
|
update:
|
|
|
|
@echo "Updating from CVS"
|
|
|
|
@cvs update -d
|
|
|
|
|
2001-05-13 00:57:53 +08:00
|
|
|
install: $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
|
2004-12-16 04:15:28 +08:00
|
|
|
mkdir -p $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib
|
|
|
|
mkdir -p $(INSTALL_PREFIX)/$(INSTALL_BASE)/include
|
|
|
|
install -m 644 libpri.h $(INSTALL_PREFIX)/$(INSTALL_BASE)/include
|
|
|
|
install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib
|
|
|
|
( cd $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib ; ln -sf libpri.so.1 libpri.so )
|
|
|
|
install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib
|
|
|
|
$(LDCONFIG)
|
2001-05-13 00:57:53 +08:00
|
|
|
|
2004-02-02 13:55:03 +08:00
|
|
|
uninstall:
|
|
|
|
@echo "Removing Libpri"
|
2004-12-16 04:15:28 +08:00
|
|
|
rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/libpri.so.1.0
|
|
|
|
rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/libpri.so
|
|
|
|
rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/lib/libpri.a
|
|
|
|
rm -f $(INSTALL_PREFIX)/$(INSTALL_BASE)/include/libpri.h
|
2004-02-02 13:55:03 +08:00
|
|
|
|
2002-03-16 06:52:37 +08:00
|
|
|
pritest: pritest.o
|
2004-09-01 01:40:59 +08:00
|
|
|
$(CC) -o pritest pritest.o -L. -lpri -lzap $(CFLAGS)
|
2002-03-16 06:52:37 +08:00
|
|
|
|
2004-03-29 16:09:01 +08:00
|
|
|
testprilib.o: testprilib.c
|
|
|
|
$(CC) $(CFLAGS) -D_REENTRANT -D_GNU_SOURCE -o $@ -c $<
|
|
|
|
|
|
|
|
testprilib: testprilib.o
|
2004-09-01 01:40:59 +08:00
|
|
|
$(CC) -o testprilib testprilib.o -L. -lpri -lpthread $(CFLAGS)
|
2004-03-29 16:09:01 +08:00
|
|
|
|
2002-03-16 06:52:37 +08:00
|
|
|
pridump: pridump.o
|
2004-09-01 01:40:59 +08:00
|
|
|
$(CC) -o pridump pridump.o -L. -lpri -lzap $(CFLAGS)
|
2002-03-16 06:52:37 +08:00
|
|
|
|
2004-03-31 04:18:12 +08:00
|
|
|
include .depend
|
|
|
|
|
2001-05-13 00:57:53 +08:00
|
|
|
%.lo : %.c
|
|
|
|
$(CC) -fPIC $(CFLAGS) -o $@ -c $<
|
|
|
|
|
|
|
|
$(STATIC_LIBRARY): $(STATIC_OBJS)
|
|
|
|
ar rcs $(STATIC_LIBRARY) $(STATIC_OBJS)
|
|
|
|
ranlib $(STATIC_LIBRARY)
|
|
|
|
|
|
|
|
$(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS)
|
2004-12-16 04:15:28 +08:00
|
|
|
$(CC) -shared $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
|
|
|
|
$(LDCONFIG) $(LDCONFIG_FLAGS) .
|
2001-05-13 00:57:53 +08:00
|
|
|
ln -sf libpri.so.1 libpri.so
|
|
|
|
|
|
|
|
clean:
|
2004-01-27 08:39:59 +08:00
|
|
|
rm -f *.o *.so *.lo *.so.1 *.so.1.0
|
2004-03-29 16:09:01 +08:00
|
|
|
rm -f testpri testprilib $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
|
2002-03-16 06:52:37 +08:00
|
|
|
rm -f pritest pridump
|
2004-03-31 04:18:12 +08:00
|
|
|
rm -f .depend
|
|
|
|
|
|
|
|
depend: .depend
|
|
|
|
|
|
|
|
.depend:
|
|
|
|
./mkdep ${CFLAGS} `ls *.c`
|