work on chan_lcr: bridging works, interface selection possible
[lcr.git] / Makefile
index 0f8a0e9..ce4b9fb 100644 (file)
--- a/Makefile
+++ b/Makefile
 
 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 !!!)
 # 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
 
-ifdef WITH-SOCKET
 LIBS += -lmisdn -lpthread
-else
-LIBS += -lisdnnet -lmISDN -lpthread
-endif
 CHANLIBS += -lmISDN
 
 # give location of the curses or ncurses library
@@ -43,13 +39,11 @@ GENW = ./genwave
 GENRC = ./genrc
 GENEXT = ./genextension
 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 -I/usr/include/mISDNuser
-endif
 ifdef WITH-CRYPTO
 LIBDIR += -L/usr/local/ssl/lib
 CFLAGS += -I/usr/local/ssl/include
@@ -63,12 +57,12 @@ endif
 #      @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
@@ -80,7 +74,9 @@ message.o: message.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
@@ -128,7 +124,9 @@ apppbx.o: apppbx.cpp *.h Makefile
        $(PP) -c $(CFLAGS) apppbx.cpp -o apppbx.o
 
 callerid.o: callerid.c *.h Makefile
-       $(PP) -c $(CFLAGS) callerid.c -o callerid.o
+       $(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
@@ -161,13 +159,10 @@ trace.o: trace.c *.h Makefile
        $(PP) -c $(CFLAGS) trace.c -o trace.o
 
 chan_lcr.o: chan_lcr.c *.h Makefile
-       $(CC) -D_GNU_SOURCE  -c $(CFLAGS) chan_lcr.c -o chan_lcr.o
-
-chan_lcr.so: chan_lcr.o *.h Makefile
-       gcc -shared -x $(LDFLAGS) -o chan_lcr.so 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
@@ -175,7 +170,7 @@ bchannel.o: bchannel.c *.h Makefile
 #      -o $(WIZZARD) 
 
 $(LCR): main.o \
-       options.o \
+       options.ooo \
        interface.o \
        extension.o \
        cause.o \
@@ -190,7 +185,7 @@ $(LCR): main.o \
        endpoint.o \
        endpointapp.o \
        apppbx.o \
-       callerid.o \
+       callerid.ooo \
        crypt.o \
        action.o \
        action_vbox.o \
@@ -203,7 +198,7 @@ $(LCR): main.o \
        trace.o
        $(PP) $(LIBDIR) \
                main.o \
-       options.o \
+       options.ooo \
        interface.o \
        extension.o \
        cause.o \
@@ -218,7 +213,7 @@ $(LCR): main.o \
        endpoint.o \
        endpointapp.o \
        apppbx.o \
-       callerid.o \
+       callerid.ooo \
        crypt.o \
        action.o \
        action_vbox.o \
@@ -235,9 +230,9 @@ $(LCRADMIN): lcradmin.c cause.c *.h Makefile
        $(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 \
@@ -255,8 +250,8 @@ $(GENRC): genrc.c *.h Makefile
        $(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
@@ -264,11 +259,12 @@ $(GENEXT): options.o extension.o genext.o
 #      @exit
 
 install:
+       make
        -killall -9 -w -q lcr # the following error must be ignored
        cp $(LCR) $(INSTALL_BIN)
        cp $(LCRADMIN) $(INSTALL_BIN)
 ifdef WITH-ASTERISK
-       cp $(CHAN_LCR) $(INSTALL_BIN)
+       cp $(CHAN_LCR) $(INSTALL_CHAN)
 endif
 #      cp $(LCRWATCH) $(INSTALL_BIN)
        cp $(GEN) $(INSTALL_BIN)