#*****************************************************************************/
WITH-CRYPTO = 42 # comment this out, if no libcrypto should be used
-#WITH-ASTERISK = 42 # comment this out, if you don't require built-in Asterisk channel driver.
-#WITH-SOCKET = 42 # compile for socket based mISDN (this options is far unfinished !!!)
+WITH-ASTERISK = 42 # comment this out, if you don't require built-in Asterisk channel driver.
# note: check your location and the names of libraries.
# select location to install
INSTALL_BIN = /usr/local/bin
+INSTALL_CHAN = /usr/lib/asterisk/modules
INSTALL_DATA = /usr/local/lcr
-LIBS += -lisdnnet -lmISDN -lpthread
+LIBS += -lmisdn -lpthread
CHANLIBS += -lmISDN
# give location of the curses or ncurses library
WIZZARD = ./wizzard
LCR = ./lcr
LCRADMIN = ./lcradmin
+CFLAGS_LCRADMIN = -DINSTALL_DATA=\"$(INSTALL_DATA)\"
ifdef WITH-ASTERISK
-CHAN_LCR = ./chan_lcr
+CHAN_LCR = ./chan_lcr.so
endif
LCRWATCH = ./lcrwatch
GEN = ./gentones
GENW = ./genwave
GENRC = ./genrc
GENEXT = ./genextension
-CFLAGS = -DINSTALL_DATA=\"$(INSTALL_DATA)\" -I/usr/include/mISDNuser/
+CFLAGS = -Wall -g -DINSTALL_DATA=\"$(INSTALL_DATA)\"
+CFLAGS += -I/usr/include/mISDNuser
#CFLAGS = -Wall -g -DINSTALL_DATA=\"$(INSTALL_DATA)\"
ifdef WITH-CRYPTO
CFLAGS += -DCRYPTO
endif
-ifdef WITH-SOCKET
-CFLAGS += -DSOCKET_MISDN
-endif
ifdef WITH-CRYPTO
LIBDIR += -L/usr/local/ssl/lib
CFLAGS += -I/usr/local/ssl/include
-#LIBS += -lcrypto
-LIBS += /usr/local/ssl/lib/libcrypto.a
+LIBS += -lcrypto
+#LIBS += /usr/local/ssl/lib/libcrypto.a
endif
#all:
# @exit
all: $(CHAN_LCR) $(LCR) $(LCRADMIN) $(GEN) $(GENW) $(GENRC) $(GENEXT)
- @sh -c 'grep -n strcpy *.c* --exclude chan_lcr.c --exclude bchannel.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 ; 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 ; 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 ; 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 ; 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 ; if test $$''? = 0 ; then echo "dont use snprintf, use makro instead." ; exit -1 ; fi'
+ @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'
@echo "All LCR binaries done"
- @sync
@exit
main.o: main.c *.h Makefile
$(PP) -c $(CFLAGS) message.c -o message.o
options.o: options.c *.h Makefile
- $(PP) -c $(CFLAGS) options.c -o options.o
+ $(CC) -c $(CFLAGS) options.c -o options.o
+options.ooo: options.c *.h Makefile
+ $(PP) -c $(CFLAGS) options.c -o options.ooo
interface.o: interface.c *.h Makefile
$(PP) -c $(CFLAGS) interface.c -o interface.o
apppbx.o: apppbx.cpp *.h Makefile
$(PP) -c $(CFLAGS) apppbx.cpp -o apppbx.o
+callerid.o: callerid.c *.h Makefile
+ $(CC) -c $(CFLAGS) callerid.c -o callerid.o
+callerid.ooo: callerid.c *.h Makefile
+ $(PP) -c $(CFLAGS) callerid.c -o callerid.ooo
+
join.o: join.cpp *.h Makefile
$(PP) -c $(CFLAGS) join.cpp -o join.o
$(PP) -c $(CFLAGS) trace.c -o trace.o
chan_lcr.o: chan_lcr.c *.h Makefile
- $(CC) -c $(CFLAGS) chan_lcr.c -o chan_lcr.o
+ $(CC) -D_GNU_SOURCE -c $(CFLAGS) chan_lcr.c -o chan_lcr.o
bchannel.o: bchannel.c *.h Makefile
- $(CC) -c $(CFLAGS) bchannel.c -o bchannel.o
+ $(CC) -D_GNU_SOURCE -c $(CFLAGS) bchannel.c -o bchannel.o
#$(WIZZARD): wizzard.c Makefile
# -o $(WIZZARD)
$(LCR): main.o \
- options.o \
+ options.ooo \
interface.o \
extension.o \
cause.o \
endpoint.o \
endpointapp.o \
apppbx.o \
+ callerid.ooo \
crypt.o \
action.o \
action_vbox.o \
socket_server.o \
trace.o
$(PP) $(LIBDIR) \
- main.o \
- options.o \
+ main.o \
+ options.ooo \
interface.o \
extension.o \
cause.o \
endpoint.o \
endpointapp.o \
apppbx.o \
+ callerid.ooo \
crypt.o \
action.o \
action_vbox.o \
$(LIBS) -o $(LCR)
$(LCRADMIN): lcradmin.c cause.c *.h Makefile
- $(PP) $(LIBDIR) $(CFLAGS) $(CURSES) -lm lcradmin.c cause.c \
+ $(PP) $(LIBDIR) $(CFLAGS_LCRADMIN) $(CURSES) -lm lcradmin.c cause.c \
-o $(LCRADMIN)
-$(CHAN_LCR): chan_lcr.o bchannel.o
- $(CC) $(LIBDIR) chan_lcr.o bchannel.o \
- $(CHANLIBS) -o $(CHAN_LCR)
+$(CHAN_LCR): chan_lcr.o bchannel.o callerid.o options.o *.h Makefile
+ $(CC) -shared -Xlinker -x $(LDFLAGS) -o $(CHAN_LCR) chan_lcr.o bchannel.o callerid.o options.o
+
$(LCRWATCH): watch.c *.h Makefile
$(PP) $(LIBDIR) $(CFLAGS) -lm watch.c \
$(PP) $(LIBDIR) $(CFLAGS) -lm genrc.c \
-o $(GENRC)
-$(GENEXT): options.o extension.o genext.o
- $(PP) $(CFLAGS) options.o extension.o genext.o -o $(GENEXT)
+$(GENEXT): options.ooo extension.o genext.o
+ $(PP) $(CFLAGS) options.ooo extension.o genext.o -o $(GENEXT)
#install:
# @echo Remember, this is a beta release. To overwrite your current installed
# @exit
install:
- -killall -9 -w -q lcr # the following error must be ignored
+ make
cp $(LCR) $(INSTALL_BIN)
cp $(LCRADMIN) $(INSTALL_BIN)
-ifdef WITH_ASTERISK
- cp $(CHAN_LCR) $(INSTALL_BIN)
+ifdef WITH-ASTERISK
+ cp $(CHAN_LCR) $(INSTALL_CHAN)
endif
# cp $(LCRWATCH) $(INSTALL_BIN)
cp $(GEN) $(INSTALL_BIN)
@if test -a $(INSTALL_DATA)/tones_efi ; then \
echo "NOTE: special efi tones already exists, not overwritten." ; else \
cp -a tones_efi $(INSTALL_DATA) ; fi
- sync
clean:
touch *
rm -f $(LCR) $(LCRADMIN) $(CHAN_LCR) $(LCRWATCH) $(GEN) $(GENW) $(GENRC) $(GENEXT)
- rm -f *.o
+ rm -f *.o *.ooo
rm -f .*.c.sw* .*.cpp.sw* .*.h.sw*
rm -f bla nohup.out a.out
rm -f debug*.log
cd .. && tar --exclude=.git -cvzf lcr_`date +%Y%m%d`.tar.gz lcr
start: $(LCR)
- sync
- -killall -9 -w -q lcr # the following error must be ignored
- $(LCR) start
-
-s: $(LCR)
- sync
- -killall -9 -w -q lcr # the following error must be ignored
$(LCR) start
fork: $(LCR)
- sync
- -killall -9 -w -q lcr # the following error must be ignored
$(LCR) fork
snapshot: clean