From 0c40cb90167e265554592adf5e8940538824db47 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Sat, 26 May 2007 04:44:41 +0000 Subject: [PATCH] refactor build git-svn-id: http://svn.openzap.org/svn/openzap/trunk@157 a93c3328-9c30-0410-af19-c9cd2b2d52af --- libs/freetdm/{src => }/Makefile | 109 +++++++++++++---------- libs/freetdm/{src => }/docs/Doxygen.conf | 0 libs/freetdm/{src => }/general.makefile | 0 libs/freetdm/{src => }/wanpipe | 2 +- libs/freetdm/{src => }/zt | 2 +- 5 files changed, 63 insertions(+), 50 deletions(-) rename libs/freetdm/{src => }/Makefile (50%) rename libs/freetdm/{src => }/docs/Doxygen.conf (100%) rename libs/freetdm/{src => }/general.makefile (100%) rename libs/freetdm/{src => }/wanpipe (91%) rename libs/freetdm/{src => }/zt (55%) diff --git a/libs/freetdm/src/Makefile b/libs/freetdm/Makefile similarity index 50% rename from libs/freetdm/src/Makefile rename to libs/freetdm/Makefile index e7bed960d4..1c04d82ba0 100644 --- a/libs/freetdm/src/Makefile +++ b/libs/freetdm/Makefile @@ -29,42 +29,43 @@ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +SRC=src +OBJS=\ +$(SRC)/hashtable.o \ +$(SRC)/hashtable_itr.o \ +$(SRC)/zap_io.o \ +$(SRC)/zap_isdn.o \ +$(SRC)/zap_analog.o \ +$(SRC)/zap_config.o \ +$(SRC)/g711.o \ +$(SRC)/libteletone_detect.o \ +$(SRC)/libteletone_generate.o \ +$(SRC)/zap_buffer.o \ +$(SRC)/zap_threadmutex.o \ +$(SRC)/isdn/EuroISDNStateNT.o \ +$(SRC)/isdn/EuroISDNStateTE.o \ +$(SRC)/isdn/mfifo.o \ +$(SRC)/isdn/Q921.o \ +$(SRC)/isdn/Q931api.o \ +$(SRC)/isdn/Q931.o \ +$(SRC)/isdn/Q931ie.o \ +$(SRC)/isdn/Q931mes.o \ +$(SRC)/isdn/Q931StateNT.o \ +$(SRC)/isdn/Q931StateTE.o \ +$(SRC)/isdn/nationalie.o \ +$(SRC)/isdn/nationalmes.o \ +$(SRC)/isdn/nationalStateNT.o \ +$(SRC)/isdn/nationalStateTE.o \ +$(SRC)/isdn/Q932mes.o -OBJS=hashtable.o \ -hashtable_itr.o \ -zap_io.o \ -zap_isdn.o \ -zap_analog.o \ -zap_config.o \ -g711.o \ -libteletone_detect.o \ -libteletone_generate.o \ -zap_buffer.o \ -zap_threadmutex.o \ -isdn/EuroISDNStateNT.o \ -isdn/EuroISDNStateTE.o \ -isdn/mfifo.o \ -isdn/Q921.o \ -isdn/Q931api.o \ -isdn/Q931.o \ -isdn/Q931ie.o \ -isdn/Q931mes.o \ -isdn/Q931StateNT.o \ -isdn/Q931StateTE.o \ -isdn/nationalie.o \ -isdn/nationalmes.o \ -isdn/nationalStateNT.o \ -isdn/nationalStateTE.o \ -isdn/Q932mes.o - -HEADERS=isdn/include/Q931.h \ - include/openzap.h +HEADERS=$(SRC)/isdn/include/Q931.h \ + $(SRC)/include/openzap.h PWD=$(shell pwd) -INCS=-I$(PWD)/include -I$(PWD)/isdn/include +INCS=-I$(PWD)/$(SRC)//include -I$(PWD)/$(SRC)//isdn/include CFLAGS=$(ZAP_CFLAGS) $(INCS) MYLIB=libopenzap.a -TMP=-I../../libpri-1.2.4 -Iinclude -I. -w +TMP=-I../libpri-1.2.4 -I$(SRC)/include -I./src -w include general.makefile $(ZAP_MODS) @@ -74,31 +75,31 @@ $(MYLIB): $(OBJS) $(HEADERS) ar rcs $(MYLIB) $(OBJS) ranlib $(MYLIB) -testapp: testapp.c $(MYLIB) - $(CC) $(INCS) -L. testapp.c -o testapp -lopenzap -lm -lpthread +testapp: $(SRC)/testapp.c $(MYLIB) + $(CC) $(INCS) -L. $(SRC)/testapp.c -o testapp -lopenzap -lm -lpthread -testisdn: testisdn.c $(MYLIB) - $(CC) $(INCS) -L. testisdn.c -o testisdn -lopenzap -lm -lpthread +testisdn: $(SRC)/testisdn.c $(MYLIB) + $(CC) $(INCS) -L. $(SRC)/testisdn.c -o testisdn -lopenzap -lm -lpthread -testanalog: testanalog.c $(MYLIB) - $(CC) $(INCS) -L. testanalog.c -o testanalog -lopenzap -lm -lpthread +testanalog: $(SRC)/testanalog.c $(MYLIB) + $(CC) $(INCS) -L. $(SRC)/testanalog.c -o testanalog -lopenzap -lm -lpthread -priserver.o: priserver.c - $(CC) $(INCS) $(TMP) -c priserver.c -o priserver.o +priserver.o: $(SRC)/priserver.c + $(CC) $(INCS) $(TMP) -c $(SRC)/priserver.c -o $(SRC)/priserver.o -sangoma_pri.o: sangoma_pri.c - $(CC) $(INCS) $(TMP) -c sangoma_pri.c -o sangoma_pri.o +$(SRC)/sangoma_pri.o: $(SRC)/sangoma_pri.c + $(CC) $(INCS) $(TMP) -c $(SRC)/sangoma_pri.c -o $(SRC)/sangoma_pri.o -priserver: $(MYLIB) priserver.o sangoma_pri.o - $(CC) sangoma_pri.o priserver.o -L. -o priserver -lopenzap -lm -lpthread ../../libpri-1.2.4/libpri.a +priserver: $(MYLIB) $(SRC)/priserver.o $(SRC)/sangoma_pri.o + $(CC) $(SRC)/sangoma_pri.o $(SRC)/priserver.o -L. -o priserver -lopenzap -lm -lpthread ../../libpri-1.2.4/libpri.a -zap_io.o: zap_io.c +$(SRC)/zap_io.o: $(SRC)/zap_io.c $(CC) $(MOD_CFLAGS) $(CC_CFLAGS) $(CFLAGS) -c $< -o $@ -zap_wanpipe.o: zap_wanpipe.c +$(SRC)/zap_wanpipe.o: $(SRC)/zap_wanpipe.c $(CC) $(CFLAGS) $(ZAP_CFLAGS) $(WP_CFLAGS) -c $< -o $@ -zap_zt.o: zap_zt.c +$(SRC)/zap_zt.o: $(SRC)/zap_zt.c $(CC) $(CFLAGS) $(ZAP_CFLAGS) $(ZT_CFLAGS) -c $< -o $@ %.o: %.c @@ -106,6 +107,18 @@ zap_zt.o: zap_zt.c dox: cd docs && doxygen $(PWD)/docs/Doxygen.conf -clean: - rm -f *.o isdn/*.o $(MYLIB) *~ \#* testapp priserver testisdn testanalog + +mod_openzap/mod_openzap.so: $(MYLIB) + cd mod_openzap && make + +mod_openzap: mod_openzap/mod_openzap.so + +mod_openzap-install: mod_openzap + cd mod_openzap && make install + +mod_openzap-clean: + cd mod_openzap && make clean + +clean: mod_openzap-clean + rm -f $(SRC)/*.o $(SRC)/isdn/*.o $(MYLIB) *~ \#* testapp priserver testisdn testanalog diff --git a/libs/freetdm/src/docs/Doxygen.conf b/libs/freetdm/docs/Doxygen.conf similarity index 100% rename from libs/freetdm/src/docs/Doxygen.conf rename to libs/freetdm/docs/Doxygen.conf diff --git a/libs/freetdm/src/general.makefile b/libs/freetdm/general.makefile similarity index 100% rename from libs/freetdm/src/general.makefile rename to libs/freetdm/general.makefile diff --git a/libs/freetdm/src/wanpipe b/libs/freetdm/wanpipe similarity index 91% rename from libs/freetdm/src/wanpipe rename to libs/freetdm/wanpipe index ae554a11c2..4165283537 100644 --- a/libs/freetdm/src/wanpipe +++ b/libs/freetdm/wanpipe @@ -1,5 +1,5 @@ MOD_CFLAGS +=-DZAP_WANPIPE_SUPPORT -OBJS += zap_wanpipe.o +OBJS += $(SRC)/zap_wanpipe.o WANPIPE_INCLUDE=/usr/include/wanpipe WP_CFLAGS =-Wall -Werror -I$(WANPIPE_INCLUDE) -I/usr/local/include -I/usr/src/linux/include -I. -I/usr/include diff --git a/libs/freetdm/src/zt b/libs/freetdm/zt similarity index 55% rename from libs/freetdm/src/zt rename to libs/freetdm/zt index 9e0f14d57c..28934f3b56 100644 --- a/libs/freetdm/src/zt +++ b/libs/freetdm/zt @@ -1,2 +1,2 @@ MOD_CFLAGS +=-DZAP_ZT_SUPPORT -OBJS += zap_zt.o +OBJS += $(SRC)/zap_zt.o