X-Git-Url: http://git.eversberg.eu/gitweb.cgi?p=lcr.git;a=blobdiff_plain;f=Makefile;h=171b57b7b6878ada05499b38bd0a450718995b8a;hp=0f8a0e9a30e29917ab5b2caf710f51ce7ad26293;hb=b1ab2b9ac1cfc15d2a8f5850145dd69043cc3ef7;hpb=58b134cb12ac8526321da6e270c93b9d0e78a3e0 diff --git a/Makefile b/Makefile index 0f8a0e9..171b57b 100644 --- a/Makefile +++ b/Makefile @@ -11,18 +11,14 @@ 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,18 +39,16 @@ 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 -#LIBS += -lcrypto -LIBS += /usr/local/ssl/lib/libcrypto.a +LIBS += -lcrypto +#LIBS += /usr/local/ssl/lib/libcrypto.a endif #all: @@ -63,14 +57,13 @@ 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 main.o: main.c *.h Makefile @@ -80,7 +73,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 +123,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 +158,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 +169,7 @@ bchannel.o: bchannel.c *.h Makefile # -o $(WIZZARD) $(LCR): main.o \ - options.o \ + options.ooo \ interface.o \ extension.o \ cause.o \ @@ -190,7 +184,7 @@ $(LCR): main.o \ endpoint.o \ endpointapp.o \ apppbx.o \ - callerid.o \ + callerid.ooo \ crypt.o \ action.o \ action_vbox.o \ @@ -202,8 +196,8 @@ $(LCR): main.o \ socket_server.o \ trace.o $(PP) $(LIBDIR) \ - main.o \ - options.o \ + main.o \ + options.ooo \ interface.o \ extension.o \ cause.o \ @@ -218,7 +212,7 @@ $(LCR): main.o \ endpoint.o \ endpointapp.o \ apppbx.o \ - callerid.o \ + callerid.ooo \ crypt.o \ action.o \ action_vbox.o \ @@ -231,13 +225,13 @@ $(LCR): main.o \ trace.o \ $(LIBS) -o $(LCR) -$(LCRADMIN): lcradmin.c cause.c *.h Makefile +$(LCRADMIN): lcradmin.c cause.c options.c *.h Makefile $(PP) $(LIBDIR) $(CFLAGS_LCRADMIN) $(CURSES) -lm lcradmin.c cause.c \ - -o $(LCRADMIN) + options.c -o $(LCRADMIN) + +$(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 -$(CHAN_LCR): chan_lcr.o bchannel.o - $(CC) $(LIBDIR) chan_lcr.o bchannel.o \ - $(CHANLIBS) -o $(CHAN_LCR) $(LCRWATCH): watch.c *.h Makefile $(PP) $(LIBDIR) $(CFLAGS) -lm watch.c \ @@ -255,8 +249,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 +258,11 @@ $(GENEXT): options.o extension.o genext.o # @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) + cp $(CHAN_LCR) $(INSTALL_CHAN) endif # cp $(LCRWATCH) $(INSTALL_BIN) cp $(GEN) $(INSTALL_BIN) @@ -308,12 +302,11 @@ endif @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 @@ -323,18 +316,9 @@ tar: 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