refactor build

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@157 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale 2007-05-26 04:44:41 +00:00
parent ae45a51151
commit 0c40cb9016
5 changed files with 63 additions and 50 deletions

View File

@ -29,42 +29,43 @@
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # 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 \ HEADERS=$(SRC)/isdn/include/Q931.h \
hashtable_itr.o \ $(SRC)/include/openzap.h
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
PWD=$(shell pwd) 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) CFLAGS=$(ZAP_CFLAGS) $(INCS)
MYLIB=libopenzap.a 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) include general.makefile $(ZAP_MODS)
@ -74,31 +75,31 @@ $(MYLIB): $(OBJS) $(HEADERS)
ar rcs $(MYLIB) $(OBJS) ar rcs $(MYLIB) $(OBJS)
ranlib $(MYLIB) ranlib $(MYLIB)
testapp: testapp.c $(MYLIB) testapp: $(SRC)/testapp.c $(MYLIB)
$(CC) $(INCS) -L. testapp.c -o testapp -lopenzap -lm -lpthread $(CC) $(INCS) -L. $(SRC)/testapp.c -o testapp -lopenzap -lm -lpthread
testisdn: testisdn.c $(MYLIB) testisdn: $(SRC)/testisdn.c $(MYLIB)
$(CC) $(INCS) -L. testisdn.c -o testisdn -lopenzap -lm -lpthread $(CC) $(INCS) -L. $(SRC)/testisdn.c -o testisdn -lopenzap -lm -lpthread
testanalog: testanalog.c $(MYLIB) testanalog: $(SRC)/testanalog.c $(MYLIB)
$(CC) $(INCS) -L. testanalog.c -o testanalog -lopenzap -lm -lpthread $(CC) $(INCS) -L. $(SRC)/testanalog.c -o testanalog -lopenzap -lm -lpthread
priserver.o: priserver.c priserver.o: $(SRC)/priserver.c
$(CC) $(INCS) $(TMP) -c priserver.c -o priserver.o $(CC) $(INCS) $(TMP) -c $(SRC)/priserver.c -o $(SRC)/priserver.o
sangoma_pri.o: sangoma_pri.c $(SRC)/sangoma_pri.o: $(SRC)/sangoma_pri.c
$(CC) $(INCS) $(TMP) -c sangoma_pri.c -o sangoma_pri.o $(CC) $(INCS) $(TMP) -c $(SRC)/sangoma_pri.c -o $(SRC)/sangoma_pri.o
priserver: $(MYLIB) priserver.o sangoma_pri.o priserver: $(MYLIB) $(SRC)/priserver.o $(SRC)/sangoma_pri.o
$(CC) sangoma_pri.o priserver.o -L. -o priserver -lopenzap -lm -lpthread ../../libpri-1.2.4/libpri.a $(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 $@ $(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 $@ $(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 $@ $(CC) $(CFLAGS) $(ZAP_CFLAGS) $(ZT_CFLAGS) -c $< -o $@
%.o: %.c %.o: %.c
@ -106,6 +107,18 @@ zap_zt.o: zap_zt.c
dox: dox:
cd docs && doxygen $(PWD)/docs/Doxygen.conf 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

View File

@ -1,5 +1,5 @@
MOD_CFLAGS +=-DZAP_WANPIPE_SUPPORT MOD_CFLAGS +=-DZAP_WANPIPE_SUPPORT
OBJS += zap_wanpipe.o OBJS += $(SRC)/zap_wanpipe.o
WANPIPE_INCLUDE=/usr/include/wanpipe 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 WP_CFLAGS =-Wall -Werror -I$(WANPIPE_INCLUDE) -I/usr/local/include -I/usr/src/linux/include -I. -I/usr/include

View File

@ -1,2 +1,2 @@
MOD_CFLAGS +=-DZAP_ZT_SUPPORT MOD_CFLAGS +=-DZAP_ZT_SUPPORT
OBJS += zap_zt.o OBJS += $(SRC)/zap_zt.o