chan-capi/Makefile

89 lines
2.1 KiB
Makefile
Raw Normal View History

2005-06-02 18:47:35 +00:00
#
# (CAPI*)
#
# An implementation of Common ISDN API 2.0 for Asterisk
#
# Makefile, based on the Asterisk Makefile, Coypright (C) 1999, Mark Spencer
#
# Copyright (C) 2005 Cytronics & Melware
#
# Armin Schindler <armin@melware.de>
#
# Reworked, but based on the work of
# Copyright (C) 2002-2005 Junghanns.NET GmbH
#
# Klaus-Peter Junghanns <kapejod@ns1.jnetdns.de>
#
# This program is free software and may be modified and
# distributed under the terms of the GNU Public License.
#
2005-09-10 13:53:22 +00:00
OSNAME=${shell uname}
2005-06-02 18:47:35 +00:00
.EXPORT_ALL_VARIABLES:
INSTALL_PREFIX=
2005-09-10 13:53:22 +00:00
ifeq (${OSNAME},FreeBSD)
ASTERISK_HEADER_DIR=$(INSTALL_PREFIX)/usr/local/include
else
2005-06-02 18:47:35 +00:00
ASTERISK_HEADER_DIR=$(INSTALL_PREFIX)/usr/include
2005-09-10 13:53:22 +00:00
endif
2005-06-02 18:47:35 +00:00
2005-09-10 13:53:22 +00:00
ASTERISKVERSION=$(shell if [ -f .version ]; then cat .version; else if [ -d CVS ]; then if [ -f CVS/Tag ] ; then echo "CVS-`sed 's/^T//g' CVS/Tag`-`date +"%D-%T"`"; else echo "CVS-HEAD-`date +"%D-%T"`"; fi; fi; fi)
2005-06-02 18:47:35 +00:00
2005-09-10 13:53:22 +00:00
ifeq (${OSNAME},FreeBSD)
MODULES_DIR=$(INSTALL_PREFIX)/usr/local/lib/asterisk/modules
else
2005-06-02 18:47:35 +00:00
MODULES_DIR=$(INSTALL_PREFIX)/usr/lib/asterisk/modules
2005-09-10 13:53:22 +00:00
endif
2005-06-02 18:47:35 +00:00
PROC=$(shell uname -m)
DEBUG=-g #-pg
INCLUDE=-I$(ASTERISK_HEADER_DIR)
2005-09-10 13:53:22 +00:00
ifeq (${OSNAME},FreeBSD)
INCLUDE+=$(shell [ -d /usr/include/i4b/include ] && \
echo -n -I/usr/include/i4b/include)
endif
2005-08-07 10:27:50 +00:00
CFLAGS=-pipe -fPIC -Wall -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE
2005-06-02 18:47:35 +00:00
CFLAGS+=-O6
CFLAGS+=$(shell if $(CC) -march=$(PROC) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=$(PROC)"; fi)
CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
CFLAGS+=-DASTERISKVERSION=\"$(ASTERISKVERSION)\"
LIBS=-ldl -lpthread -lm
CC=gcc
INSTALL=install
SHAREDOS=chan_capi.so
2005-06-02 18:47:35 +00:00
CFLAGS+=-Wno-missing-prototypes -Wno-missing-declarations
CFLAGS+=-DCRYPTO
all: config.h $(SHAREDOS)
clean:
rm -f config.h
rm -f *.so *.o
%.so : %.o
$(CC) -shared -Xlinker -x -o $@ $<
config.h:
./create_config.sh "$(ASTERISK_HEADER_DIR)"
chan_capi.so: chan_capi.o c20msg.o
$(CC) -shared -Xlinker -x -o $@ $^ -lcapi20
2005-06-02 18:47:35 +00:00
install: all
for x in $(SHAREDOS); do $(INSTALL) -m 755 $$x $(MODULES_DIR) ; done
config: all
cp capi.conf $(INSTALL_PREFIX)/etc/asterisk/
samples: config