2001-10-17 15:04:18 +00:00
|
|
|
#
|
|
|
|
# Asterisk -- A telephony toolkit for Linux.
|
|
|
|
#
|
|
|
|
# Makefile for CDR backends (dynamically loaded)
|
|
|
|
#
|
|
|
|
# Copyright (C) 1999, Mark Spencer
|
|
|
|
#
|
|
|
|
# Mark Spencer <markster@linux-support.net>
|
|
|
|
#
|
|
|
|
# This program is free software, distributed under the terms of
|
|
|
|
# the GNU General Public License
|
|
|
|
#
|
|
|
|
|
|
|
|
MODS=cdr_csv.so
|
|
|
|
|
|
|
|
CFLAGS+=
|
|
|
|
|
2002-06-28 18:46:01 +00:00
|
|
|
#
|
|
|
|
# MySQL stuff... Autoconf anyone??
|
|
|
|
#
|
2003-04-23 16:23:12 +00:00
|
|
|
MODS+=$(shell if [ -d /usr/local/mysql/include ] || [ --d /usr/include/mysql ] || [ -d /usr/local/include/mysql ] || [ -d /opt/mysql/include ]; then echo "cdr_mysql.so"; fi)
|
|
|
|
CFLAGS+=$(shell if [ -d /usr/local/mysql/include ]; then echo "-I/usr/local/mysql/include"; fi)
|
2002-06-28 18:46:01 +00:00
|
|
|
CFLAGS+=$(shell if [ -d /usr/include/mysql ]; then echo "-I/usr/include/mysql"; fi)
|
|
|
|
CFLAGS+=$(shell if [ -d /usr/local/include/mysql ]; then echo "-I/usr/local/include/mysql"; fi)
|
2002-09-25 02:36:01 +00:00
|
|
|
CFLAGS+=$(shell if [ -d /opt/mysql/include/mysql ]; then echo "-I/opt/mysql/include/mysql"; fi)
|
2002-06-28 18:46:01 +00:00
|
|
|
MLFLAGS=
|
|
|
|
MLFLAGS+=$(shell if [ -d /usr/lib/mysql ]; then echo "-L/usr/lib/mysql"; fi)
|
2003-04-23 16:23:12 +00:00
|
|
|
MLFLAGS+=$(shell if [ -d /usr/local/mysql/lib ]; then echo "-L/usr/local/mysql/lib"; fi)
|
2002-06-28 18:46:01 +00:00
|
|
|
MLFLAGS+=$(shell if [ -d /usr/local/lib/mysql ]; then echo "-L/usr/local/lib/mysql"; fi)
|
2002-09-25 02:36:01 +00:00
|
|
|
MLFLAGS+=$(shell if [ -d /opt/mysql/lib/mysql ]; then echo "-L/opt/mysql/lib/mysql"; fi)
|
2002-06-28 18:46:01 +00:00
|
|
|
|
2001-10-17 15:04:18 +00:00
|
|
|
all: $(MODS)
|
|
|
|
|
|
|
|
install: all
|
|
|
|
for x in $(MODS); do $(INSTALL) -m 755 $$x $(MODULES_DIR) ; done
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.so *.o
|
|
|
|
|
|
|
|
%.so : %.o
|
|
|
|
$(CC) -shared -Xlinker -x -o $@ $<
|
2002-06-28 18:46:01 +00:00
|
|
|
|
|
|
|
cdr_mysql.so: cdr_mysql.o
|
2002-09-25 02:36:01 +00:00
|
|
|
$(CC) -shared -Xlinker -x -o $@ $< -lmysqlclient -lz $(MLFLAGS)
|