2008-09-21 06:57:51 +00:00
|
|
|
## Makefile.am -- Process this file with automake to produce Makefile.in
|
2008-06-01 16:52:10 +00:00
|
|
|
|
2008-09-21 06:57:51 +00:00
|
|
|
## This file is part of linux-call-router
|
|
|
|
## Copyright (C) 2007 Joerg Habenicht (j.habenicht@gmx.de)
|
|
|
|
## Copyright (C) 2008 Peter Schlaile (peter -at- schlaile.de)
|
2012-01-13 05:24:21 +00:00
|
|
|
## Copyright (C) 2008-2012 Andreas Eversberg (andreas@eversberg.eu)
|
2007-10-02 14:08:50 +00:00
|
|
|
|
2008-09-21 06:57:51 +00:00
|
|
|
## 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.
|
2007-10-02 14:08:50 +00:00
|
|
|
|
2008-09-21 06:57:51 +00:00
|
|
|
## 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.
|
2007-10-02 14:08:50 +00:00
|
|
|
|
2008-09-21 06:57:51 +00:00
|
|
|
## You should have received a copy of the GNU General Public License
|
|
|
|
## along with this library; see the file COPYING. If not, write to
|
|
|
|
## the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
## Boston, MA 02110-1301, USA.
|
2007-10-03 16:25:20 +00:00
|
|
|
|
2010-03-25 13:06:52 +00:00
|
|
|
INSTALLdir = $(DESTDIR)/usr/local/lcr
|
2007-10-03 16:25:20 +00:00
|
|
|
|
2008-10-23 19:26:44 +00:00
|
|
|
pkglogdir=$(localstatedir)/log/@PACKAGE@
|
|
|
|
pkgsysconfdir=$(sysconfdir)/@PACKAGE@
|
|
|
|
|
2010-03-25 13:06:52 +00:00
|
|
|
#CONFIGdir=$(DESTDIR)$(pkgsysconfdir)
|
|
|
|
#SHAREdir=$(DESTDIR)$(pkgdatadir)
|
|
|
|
#LOGdir=$(DESTDIR)$(pkglogdir)
|
|
|
|
#EXTENSIONdir=$(DESTDIR)$(localstatedir)/lib/lcr
|
2007-10-02 14:08:50 +00:00
|
|
|
|
2010-03-25 13:06:52 +00:00
|
|
|
CONFIGdir=$(INSTALLdir)
|
|
|
|
SHAREdir=$(INSTALLdir)
|
|
|
|
LOGdir=$(INSTALLdir)
|
|
|
|
EXTENSIONdir=$(INSTALLdir)/extensions
|
2008-10-23 19:26:44 +00:00
|
|
|
|
2010-03-25 13:06:52 +00:00
|
|
|
astmoddir = $(DESTDIR)/usr/lib/asterisk/modules
|
2008-10-11 06:51:38 +00:00
|
|
|
|
2008-09-21 06:57:51 +00:00
|
|
|
INSTALLATION_DEFINES = \
|
2008-10-23 19:26:44 +00:00
|
|
|
-DCONFIG_DATA="\"$(CONFIGdir)\"" \
|
|
|
|
-DSHARE_DATA="\"$(SHAREdir)\"" \
|
|
|
|
-DLOG_DIR="\"$(LOGdir)\"" \
|
2008-11-04 08:31:09 +00:00
|
|
|
-DEXTENSION_DATA="\"$(EXTENSIONdir)\""
|
2007-10-02 14:08:50 +00:00
|
|
|
|
2010-05-31 16:45:02 +00:00
|
|
|
GSM_INCLUDE =
|
|
|
|
GSM_SOURCE =
|
|
|
|
GSM_LIB =
|
2007-10-02 14:08:50 +00:00
|
|
|
|
2010-05-31 16:45:02 +00:00
|
|
|
if ENABLE_GSM
|
2009-05-11 09:07:58 +00:00
|
|
|
|
2010-05-31 16:45:02 +00:00
|
|
|
GSM_INCLUDE +=
|
2009-05-11 09:07:58 +00:00
|
|
|
|
2011-02-20 16:34:24 +00:00
|
|
|
GSM_SOURCE += gsm_audio.c gsm.cpp
|
2010-05-31 16:45:02 +00:00
|
|
|
|
|
|
|
GSM_LIB += /usr/lib/libgsm.a
|
2009-05-11 09:07:58 +00:00
|
|
|
|
|
|
|
#gsm_audio.po: gsm_audio.c gsm_audio.h
|
|
|
|
# $(CC) -D_GNU_SOURCE -fPIC -c gsm_audio.c -o gsm_audio.po
|
|
|
|
|
|
|
|
endif
|
2007-10-02 14:08:50 +00:00
|
|
|
|
2010-05-31 16:45:02 +00:00
|
|
|
if ENABLE_GSM_BS
|
|
|
|
|
2011-09-02 09:08:56 +00:00
|
|
|
GSM_INCLUDE += -DWITH_GSM_BS
|
2010-05-31 16:45:02 +00:00
|
|
|
|
2010-12-22 18:35:28 +00:00
|
|
|
GSM_SOURCE += gsm_bs.cpp
|
2010-05-31 16:45:02 +00:00
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
if ENABLE_GSM_MS
|
|
|
|
|
2011-09-02 09:08:56 +00:00
|
|
|
GSM_INCLUDE += -DWITH_GSM_MS
|
2010-05-31 16:45:02 +00:00
|
|
|
|
2011-09-02 09:08:56 +00:00
|
|
|
GSM_SOURCE += gsm_ms.cpp
|
2010-05-31 16:45:02 +00:00
|
|
|
|
|
|
|
endif
|
|
|
|
|
2009-09-26 11:20:29 +00:00
|
|
|
if ENABLE_SS5
|
|
|
|
|
|
|
|
SS5_INCLUDE = -DWITH_SS5
|
|
|
|
|
|
|
|
SS5_SOURCE = ss5.cpp ss5_encode.c ss5_decode.c
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2012-01-13 05:24:21 +00:00
|
|
|
SIP_LIB =
|
|
|
|
|
|
|
|
if ENABLE_SIP
|
|
|
|
|
|
|
|
# FIXME: remove that
|
|
|
|
#pkgconfigdir = $(libdir)/pkgconfig
|
|
|
|
#pkgconfig_DATA = sofia-sip-ua.pc
|
|
|
|
|
|
|
|
SIP_INCLUDE = -DWITH_SIP $(SOFIA_CFLAGS)
|
|
|
|
|
|
|
|
SIP_SOURCE = sip.cpp
|
|
|
|
|
|
|
|
SIP_LIB += $(SOFIA_LIBS)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2008-09-21 06:57:51 +00:00
|
|
|
bin_PROGRAMS = lcradmin gentones genwave
|
2007-10-02 14:08:50 +00:00
|
|
|
|
2008-10-23 19:26:44 +00:00
|
|
|
sbin_PROGRAMS = lcr genrc genextension
|
|
|
|
|
2008-09-21 06:57:51 +00:00
|
|
|
if ENABLE_ASTERISK_CHANNEL_DRIVER
|
2008-10-23 19:26:44 +00:00
|
|
|
noinst_PROGRAMS = chan_lcr.so
|
|
|
|
chan_lcr_so_SOURCES =
|
2008-09-21 06:57:51 +00:00
|
|
|
chan_lcr_so_LDFLAGS = -shared
|
2010-01-16 10:20:23 +00:00
|
|
|
chan_lcr_so_LDADD = chan_lcr.po bchannel.po options.po callerid.po select.po
|
2008-10-23 19:26:44 +00:00
|
|
|
|
|
|
|
chan_lcr.po: chan_lcr.c chan_lcr.h
|
2011-02-10 13:35:47 +00:00
|
|
|
$(CC) $(INCLUDES) $(AST_CFLAGS) $(CPPFLAGS) $(CFLAGS) -D_GNU_SOURCE -fPIC -c chan_lcr.c -o chan_lcr.po
|
2007-10-02 14:08:50 +00:00
|
|
|
|
2008-10-23 19:26:44 +00:00
|
|
|
bchannel.po: bchannel.c bchannel.h
|
2011-02-10 13:35:47 +00:00
|
|
|
$(CC) $(INCLUDES) -D_GNU_SOURCE $(CPPFLAGS) $(CFLAGS) -fPIC -c bchannel.c -o bchannel.po
|
2007-10-02 14:08:50 +00:00
|
|
|
|
2008-10-23 19:26:44 +00:00
|
|
|
callerid.po: callerid.c callerid.h
|
2011-02-10 13:35:47 +00:00
|
|
|
$(CC) $(INCLUDES) -D_GNU_SOURCE $(CPPFLAGS) $(CFLAGS) -fPIC -c callerid.c -o callerid.po
|
2007-10-02 14:08:50 +00:00
|
|
|
|
2008-10-23 19:26:44 +00:00
|
|
|
options.po: options.c options.h
|
2011-02-10 13:35:47 +00:00
|
|
|
$(CC) $(INCLUDES) -D_GNU_SOURCE $(CPPFLAGS) $(CFLAGS) -fPIC -c options.c -o options.po
|
2008-10-23 19:26:44 +00:00
|
|
|
|
2010-01-16 10:20:23 +00:00
|
|
|
select.po: select.c select.h
|
2011-02-10 13:35:47 +00:00
|
|
|
$(CC) $(INCLUDES) -D_GNU_SOURCE $(CPPFLAGS) $(CFLAGS) -fPIC -c select.c -o select.po
|
2010-01-16 10:20:23 +00:00
|
|
|
|
2008-10-23 19:26:44 +00:00
|
|
|
install-exec-hook:
|
|
|
|
mkdir -p $(astmoddir)
|
|
|
|
$(INSTALL) -d $(astmoddir)
|
|
|
|
$(INSTALL) chan_lcr.so $(astmoddir)
|
2007-10-02 14:08:50 +00:00
|
|
|
endif
|
|
|
|
|
2012-01-13 05:24:21 +00:00
|
|
|
INCLUDES = $(all_includes) $(GSM_INCLUDE) $(SS5_INCLUDE) $(SIP_INCLUDE) -Wall $(INSTALLATION_DEFINES)
|
2009-05-11 09:07:58 +00:00
|
|
|
|
2012-01-14 17:36:26 +00:00
|
|
|
lcr_SOURCES = \
|
|
|
|
main.c select.c trace.c \ options.c \ tones.c \ alawulaw.c \ cause.c \ interface.c \ message.c \ callerid.c \ socket_server.c \
|
|
|
|
port.cpp \ vbox.cpp \ mISDN.cpp \ dss1.cpp \ loop.c remote.cpp \
|
|
|
|
$(GSM_SOURCE) $(SS5_SOURCE) $(SIP_SOURCE) \
|
|
|
|
endpoint.cpp \ endpointapp.cpp \
|
|
|
|
apppbx.cpp \ route.c \ action.cpp action_efi.cpp \ action_vbox.cpp \ extension.c \ crypt.cpp \ mail.c \
|
|
|
|
join.cpp \ joinpbx.cpp \ joinremote.cpp
|
2007-10-02 14:08:50 +00:00
|
|
|
|
2012-01-13 05:24:21 +00:00
|
|
|
lcr_LDADD = $(LIBCRYPTO) -lmisdn -lpthread $(GSM_LIB) $(SIP_LIB)
|
2009-05-11 09:07:58 +00:00
|
|
|
|
2007-10-02 14:08:50 +00:00
|
|
|
|
2008-09-21 06:57:51 +00:00
|
|
|
lcradmin_SOURCES = lcradmin.c cause.c options.c
|
2007-10-02 14:08:50 +00:00
|
|
|
genextension_SOURCES = genext.c options.c extension.c
|
|
|
|
|
2008-09-21 06:57:51 +00:00
|
|
|
# Special install function to preserve existing configs.
|
|
|
|
# Optimization with equivalen results are welcome
|
|
|
|
|
|
|
|
install-data-hook:
|
|
|
|
@sh -c 'grep -n strcpy *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use strcpy, use makro instead." ; exit -1 ; fi'
|
|
|
|
@sh -c 'grep -n strncpy *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use strncpy, use makro instead." ; exit -1 ; fi'
|
|
|
|
@sh -c 'grep -n strcat *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use strcat, use makro instead." ; exit -1 ; fi'
|
|
|
|
@sh -c 'grep -n strncat *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use strncat, use makro instead." ; exit -1 ; fi'
|
|
|
|
@sh -c 'grep -n sprintf *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use sprintf, use makro instead." ; exit -1 ; fi'
|
|
|
|
@sh -c 'grep -n snprintf *.c* --exclude chan_lcr.c --exclude bchannel.c --exclude callerid.c ; if test $$''? = 0 ; then echo "dont use snprintf, use makro instead." ; exit -1 ; fi'
|
2008-10-23 19:26:44 +00:00
|
|
|
mkdir -p $(CONFIGdir)
|
|
|
|
mkdir -p $(SHAREdir)
|
|
|
|
mkdir -p $(LOGdir)
|
|
|
|
mkdir -p $(EXTENSIONdir)
|
|
|
|
@if test -a $(CONFIGdir)/options.conf ; then \
|
2008-09-21 06:57:51 +00:00
|
|
|
echo "NOTE: options.conf already exists, not changed." ; else \
|
2008-10-23 19:26:44 +00:00
|
|
|
cp -v default/options.conf $(CONFIGdir) ; fi
|
|
|
|
@if test -a $(CONFIGdir)/interface.conf ; then \
|
2008-09-21 06:57:51 +00:00
|
|
|
echo "NOTE: interface.conf already exists, not changed." ; else \
|
2008-10-23 19:26:44 +00:00
|
|
|
cp -v default/interface.conf $(CONFIGdir) ; fi
|
|
|
|
@if test -a $(CONFIGdir)/routing.conf ; then \
|
2008-09-21 06:57:51 +00:00
|
|
|
echo "NOTE: routing.conf already exists, not changed." ; else \
|
2008-10-23 19:26:44 +00:00
|
|
|
cp -v default/routing.conf $(CONFIGdir) ; fi
|
|
|
|
@if test -a $(CONFIGdir)/numbering_int.conf ; then \
|
2008-09-21 06:57:51 +00:00
|
|
|
echo "NOTE: numbering_int.conf is obsolete, please use routing." ; fi
|
2008-10-23 19:26:44 +00:00
|
|
|
@if test -a $(CONFIGdir)/numbering_ext.conf ; then \
|
2008-09-21 06:57:51 +00:00
|
|
|
echo "NOTE: numbering_ext.conf is obsolete, please use routing." ; fi
|
2008-10-23 19:26:44 +00:00
|
|
|
@if test -a $(CONFIGdir)/directory.list ; then \
|
2008-09-21 06:57:51 +00:00
|
|
|
echo "NOTE: directory.list already exists, not changed." ; else \
|
2008-10-23 19:26:44 +00:00
|
|
|
cp -v default/directory.list $(CONFIGdir) ; fi
|
|
|
|
@if test -a $(SHAREdir)/tones_american ; then \
|
2008-09-21 06:57:51 +00:00
|
|
|
echo "NOTE: american tones already exists, not overwritten." ; else \
|
2008-10-23 19:26:44 +00:00
|
|
|
cp -a tones_american $(SHAREdir) ; fi
|
|
|
|
@if test -a $(SHAREdir)/tones_german ; then \
|
2008-09-21 06:57:51 +00:00
|
|
|
echo "NOTE: german tones already exists, not overwritten." ; else \
|
2008-10-23 19:26:44 +00:00
|
|
|
cp -a tones_german $(SHAREdir) ; fi
|
|
|
|
@if test -a $(SHAREdir)/vbox_german ; then \
|
2008-09-21 06:57:51 +00:00
|
|
|
echo "NOTE: german vbox tones already exists, not overwritten." ; else \
|
2008-10-23 19:26:44 +00:00
|
|
|
cp -a vbox_german $(SHAREdir) ; fi
|
|
|
|
@if test -a $(SHAREdir)/vbox_english ; then \
|
2008-09-21 06:57:51 +00:00
|
|
|
echo "NOTE: english vbox tones already exists, not overwritten." ; else \
|
2008-10-23 19:26:44 +00:00
|
|
|
cp -a vbox_english $(SHAREdir) ; fi
|
|
|
|
@if test -a $(SHAREdir)/tones_efi ; then \
|
2008-09-21 06:57:51 +00:00
|
|
|
echo "NOTE: special efi tones already exists, not overwritten." ; else \
|
2008-10-23 19:26:44 +00:00
|
|
|
cp -a tones_efi $(SHAREdir) ; fi
|
2007-10-02 14:08:50 +00:00
|
|
|
|
2008-11-04 08:31:09 +00:00
|
|
|
clean-generic:
|
|
|
|
rm -f *.po
|
|
|
|
|
2007-10-02 14:08:50 +00:00
|
|
|
# test rule, nothing important
|
|
|
|
#echo:
|
|
|
|
# -echo $(all_libraries) >&2
|
|
|
|
|
|
|
|
# CAUTION: CRUDE CRUDE HACK !!
|
|
|
|
# This transforms all compiling and linking calls from gcc into g++
|
|
|
|
# This should better be removed and all .c files renamed to .cpp
|
|
|
|
COMPILE=$(CXXCOMPILE)
|
|
|
|
LINK=$(CXXLINK)
|
|
|
|
|
|
|
|
|