From d934a136f057e8da8890b72e6ca9215b7b00760e Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 3 Jan 2006 22:36:56 +0000 Subject: [PATCH] put mods in subdirs git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@269 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- Makefile.am | 5 ++- Makefile.in | 5 ++- generic_mod.mk | 10 +++-- modmake.sh | 3 +- modules.conf | 39 +++++++++---------- src/mod/codecs/mod_codec_g729/Makefile | 10 +++-- src/mod/codecs/mod_codec_gsm/Makefile | 2 + src/mod/codecs/mod_g711codec/Makefile | 11 ++++-- src/mod/codecs/mod_speexcodec/Makefile | 10 +++-- src/mod/endpoints/mod_exosip/Makefile | 10 +++-- src/mod/endpoints/mod_iaxchan/Makefile | 10 +++-- src/mod/endpoints/mod_opalchan/Makefile | 10 +++-- src/mod/endpoints/mod_portaudio/Makefile | 10 +++-- .../event_handlers/mod_xmpp_event/Makefile | 10 +++-- src/mod/formats/mod_sndfile/Makefile | 12 ++++-- 15 files changed, 92 insertions(+), 65 deletions(-) diff --git a/Makefile.am b/Makefile.am index 9cc72d04b3..60d246cb87 100644 --- a/Makefile.am +++ b/Makefile.am @@ -115,7 +115,8 @@ modules: $(NAME) modclean: @cd src/mod && for i in `find . -type d -name mod_\*` ; do echo making clean $$i ; SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CC="$(CC)" MOD="$$i" $(PWD)/modmake.sh $(PWD) $$i clean || exit 1; done - +modwipe: + rm -f $(PREFIX)/mod/*.so install_mod: modules @echo Installing $(NAME) @@ -123,7 +124,7 @@ install_mod: modules @/bin/cp -p ./$(NAME) $(PREFIX)/bin @ln -sf $(PREFIX)/bin/$(NAME) /usr/bin @echo Installing Modules - @/bin/cp -f src/mod/*/mod_*.so $(PREFIX)/mod >/dev/null 2<&1 || echo No modules to copy. + @cd src/mod && for i in `cat ../../modules.conf | grep -v \#` ; do echo making clean $$i ; PREFIX=$(PREFIX) MOD="$$i" $(PWD)/modmake.sh $(PWD) $$i install || exit 1; done @echo done dox: diff --git a/Makefile.in b/Makefile.in index 9915991e80..d0f515f6b7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -978,13 +978,16 @@ modules: $(NAME) modclean: @cd src/mod && for i in `find . -type d -name mod_\*` ; do echo making clean $$i ; SOLINK="$(SOLINK)" CFLAGS="$(CFLAGS)" CC="$(CC)" MOD="$$i" $(PWD)/modmake.sh $(PWD) $$i clean || exit 1; done +modwipe: + rm -f $(PREFIX)/mod/*.so + install_mod: modules @echo Installing $(NAME) @mkdir -p $(PREFIX) $(PREFIX)/conf $(PREFIX)/mod $(PREFIX)/db $(PREFIX)/bin @/bin/cp -p ./$(NAME) $(PREFIX)/bin @ln -sf $(PREFIX)/bin/$(NAME) /usr/bin @echo Installing Modules - @/bin/cp -f src/mod/*/mod_*.so $(PREFIX)/mod >/dev/null 2<&1 || echo No modules to copy. + @cd src/mod && for i in `cat ../../modules.conf | grep -v \#` ; do echo making clean $$i ; PREFIX=$(PREFIX) MOD="$$i" $(PWD)/modmake.sh $(PWD) $$i install || exit 1; done @echo done dox: diff --git a/generic_mod.mk b/generic_mod.mk index ce56d3ef02..e1527cb63b 100644 --- a/generic_mod.mk +++ b/generic_mod.mk @@ -1,9 +1,11 @@ -all: $(MOD).so +all: $(MODNAME).so -$(MOD).so: $(MOD).c - $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o - $(CC) $(SOLINK) $(MOD).o -o $(MOD).so $(LDFLAGS) +$(MODNAME).so: $(MODNAME).c + $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o + $(CC) $(SOLINK) $(MODNAME).o -o $(MODNAME).so $(LDFLAGS) clean: rm -fr *.so *.o *~ +install: + cp -f $(MODNAME).so $(PREFIX)/mod diff --git a/modmake.sh b/modmake.sh index d2bf4b284d..5fdb099cd9 100755 --- a/modmake.sh +++ b/modmake.sh @@ -18,7 +18,6 @@ fi if [ -f $mod/Makefile ] ; then MODNAME=$end $make -C $mod $@ else - echo "XX $make -f $pwd/generic_mod.mk -C $mod $@" - MODNAME=$end $make -f $pwd/generic_mod.mk -C $end $@ + MODNAME=$end $make -f $pwd/generic_mod.mk -C $mod $@ fi diff --git a/modules.conf b/modules.conf index 4c7349980d..fbfa61505e 100644 --- a/modules.conf +++ b/modules.conf @@ -1,20 +1,19 @@ -# list the modules to build -mod_bridgecall -mod_dialplan_demo -mod_softtimer -mod_woomerachan -mod_playback -#mod_wanchan -mod_speexcodec -mod_exosip -mod_g711codec -mod_rawaudio -mod_iaxchan -#mod_opalchan -#mod_codec_g729 -mod_event_test -#mod_portaudio -mod_xmpp_event -mod_sndfile -codec/mod_codec_gsm - +applications/mod_bridgecall +applications/mod_playback +#applications/mod_skel +codecs/mod_codec_g729 +codecs/mod_codec_gsm +codecs/mod_g711codec +codecs/mod_rawaudio +codecs/mod_speexcodec +dialplans/mod_dialplan_demo +endpoints/mod_exosip +endpoints/mod_iaxchan +#endpoints/mod_opalchan +endpoints/mod_portaudio +#endpoints/mod_wanchan +endpoints/mod_woomerachan +#event_handlers/mod_event_test +event_handlers/mod_xmpp_event +formats/mod_sndfile +timers/mod_softtimer diff --git a/src/mod/codecs/mod_codec_g729/Makefile b/src/mod/codecs/mod_codec_g729/Makefile index 6657b4c1fa..fbc86d50d8 100644 --- a/src/mod/codecs/mod_codec_g729/Makefile +++ b/src/mod/codecs/mod_codec_g729/Makefile @@ -1,12 +1,14 @@ CFLAGS += -I/usr/local/include/libg729 LDFLAGS +=-lg729 -all: $(MOD).so +all: $(MODNAME).so -$(MOD).so: $(MOD).c - $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o - $(CC) $(SOLINK) $(MOD).o -o $(MOD).so $(LDFLAGS) -lspeex +$(MODNAME).so: $(MODNAME).c + $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o + $(CC) $(SOLINK) $(MODNAME).o -o $(MODNAME).so $(LDFLAGS) -lspeex clean: rm -fr *.so *.o *~ +install: + cp -f $(MODNAME).so $(PREFIX)/mod diff --git a/src/mod/codecs/mod_codec_gsm/Makefile b/src/mod/codecs/mod_codec_gsm/Makefile index 83bfb0a9f2..cec9e27ff6 100644 --- a/src/mod/codecs/mod_codec_gsm/Makefile +++ b/src/mod/codecs/mod_codec_gsm/Makefile @@ -12,3 +12,5 @@ $(MODNAME).so: $(MODNAME).c clean: rm -fr *.so *.o *~ +install: + cp -f $(MODNAME).so $(PREFIX)/mod diff --git a/src/mod/codecs/mod_g711codec/Makefile b/src/mod/codecs/mod_g711codec/Makefile index 60ab1c465c..a1f8ffce7b 100644 --- a/src/mod/codecs/mod_g711codec/Makefile +++ b/src/mod/codecs/mod_g711codec/Makefile @@ -1,15 +1,18 @@ -all: $(MOD).so +all: $(MODNAME).so g711.o: g711.c g711.h $(CC) -c -O2 -pthread -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE g711.c -o g711.o -$(MOD).so: $(MOD).c g711.o - $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o - $(CC) $(SOLINK) g711.o $(MOD).o -o $(MOD).so $(LDFLAGS) +$(MODNAME).so: $(MODNAME).c g711.o + $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o + $(CC) $(SOLINK) g711.o $(MODNAME).o -o $(MODNAME).so $(LDFLAGS) clean: rm -fr *.so *.o *~ +install: + cp -f $(MODNAME).so $(PREFIX)/mod + diff --git a/src/mod/codecs/mod_speexcodec/Makefile b/src/mod/codecs/mod_speexcodec/Makefile index 396db30128..0ef7857bb1 100644 --- a/src/mod/codecs/mod_speexcodec/Makefile +++ b/src/mod/codecs/mod_speexcodec/Makefile @@ -1,12 +1,14 @@ -all: depends $(MOD).so +all: depends $(MODNAME).so depends: $(BASE)/buildlib.sh $(BASE) install speex-1.1.11.1.tar.gz --prefix=$(PREFIX) -$(MOD).so: $(MOD).c - $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o - $(CC) $(SOLINK) $(MOD).o -o $(MOD).so $(LDFLAGS) -lspeex +$(MODNAME).so: $(MODNAME).c + $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o + $(CC) $(SOLINK) $(MODNAME).o -o $(MODNAME).so $(LDFLAGS) -lspeex clean: rm -fr *.so *.o *~ +install: + cp -f $(MODNAME).so $(PREFIX)/mod diff --git a/src/mod/endpoints/mod_exosip/Makefile b/src/mod/endpoints/mod_exosip/Makefile index 5e8906382f..668de917eb 100644 --- a/src/mod/endpoints/mod_exosip/Makefile +++ b/src/mod/endpoints/mod_exosip/Makefile @@ -7,7 +7,7 @@ else LINKER=$(CC) endif -all: depends $(MOD).so +all: depends $(MODNAME).so depends: $(BASE)/buildlib.sh $(BASE) install jthread-1.1.2.tar.gz --prefix=$(PREFIX) @@ -17,10 +17,12 @@ depends: $(BASE)/buildlib.sh $(BASE) install libeXosip2-2.2.2.tar.gz --disable-josua --prefix=$(PREFIX) -$(MOD).so: $(MOD).c - $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o - $(LINKER) $(SOLINK) -o $(MOD).so $(MOD).o $(LDFLAGS) +$(MODNAME).so: $(MODNAME).c + $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o + $(LINKER) $(SOLINK) -o $(MODNAME).so $(MODNAME).o $(LDFLAGS) clean: rm -fr *.so *.o *~ +install: + cp -f $(MODNAME).so $(PREFIX)/mod diff --git a/src/mod/endpoints/mod_iaxchan/Makefile b/src/mod/endpoints/mod_iaxchan/Makefile index 6e4f38205a..198ef34357 100644 --- a/src/mod/endpoints/mod_iaxchan/Makefile +++ b/src/mod/endpoints/mod_iaxchan/Makefile @@ -1,15 +1,17 @@ LDFLAGS += -liax -L/usr/local/lib -all: depends $(MOD).so +all: depends $(MODNAME).so depends: $(BASE)/buildlib.sh $(BASE) install iax --enable-newjb --prefix=$(PREFIX) -$(MOD).so: $(MOD).c - $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o - $(CC) $(SOLINK) -o $(MOD).so $(MOD).o $(LDFLAGS) +$(MODNAME).so: $(MODNAME).c + $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o + $(CC) $(SOLINK) -o $(MODNAME).so $(MODNAME).o $(LDFLAGS) clean: rm -fr *.so *.o *~ +install: + cp -f $(MODNAME).so $(PREFIX)/mod diff --git a/src/mod/endpoints/mod_opalchan/Makefile b/src/mod/endpoints/mod_opalchan/Makefile index 709a5b7bc5..ccade4f3b5 100644 --- a/src/mod/endpoints/mod_opalchan/Makefile +++ b/src/mod/endpoints/mod_opalchan/Makefile @@ -1,12 +1,14 @@ #CFLAGS += -I/usr/src/common/src LDFLAGS += -liax -all: $(MOD).so +all: $(MODNAME).so -$(MOD).so: $(MOD).c - $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o - $(CC) $(SOLINK) -o $(MOD).so $(MOD).o $(LDFLAGS) +$(MODNAME).so: $(MODNAME).c + $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o + $(CC) $(SOLINK) -o $(MODNAME).so $(MODNAME).o $(LDFLAGS) clean: rm -fr *.so *.o *~ +install: + cp -f $(MODNAME).so $(PREFIX)/mod diff --git a/src/mod/endpoints/mod_portaudio/Makefile b/src/mod/endpoints/mod_portaudio/Makefile index 0d78e0b06a..367b72a997 100644 --- a/src/mod/endpoints/mod_portaudio/Makefile +++ b/src/mod/endpoints/mod_portaudio/Makefile @@ -1,19 +1,21 @@ LDFLAGS += -lportaudio -L/usr/local/lib MYOBJS = pablio.o ringbuffer.o -all: depends $(MOD).so +all: depends $(MODNAME).so depends: $(BASE)/buildlib.sh $(BASE) install portaudio.tar.gz --prefix=$(PREFIX) %.o: %.c $(CC) -fPIC $(CFLAGS) -c -o $@ $< -$(MOD).so: $(MOD).c $(MYOBJS) - $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o - $(CC) $(SOLINK) -o $(MOD).so $(MOD).o $(MYOBJS) $(LDFLAGS) +$(MODNAME).so: $(MODNAME).c $(MYOBJS) + $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o + $(CC) $(SOLINK) -o $(MODNAME).so $(MODNAME).o $(MYOBJS) $(LDFLAGS) clean: rm -fr *.so *.o *~ +install: + cp -f $(MODNAME).so $(PREFIX)/mod diff --git a/src/mod/event_handlers/mod_xmpp_event/Makefile b/src/mod/event_handlers/mod_xmpp_event/Makefile index e99f9650eb..0815fd5659 100644 --- a/src/mod/event_handlers/mod_xmpp_event/Makefile +++ b/src/mod/event_handlers/mod_xmpp_event/Makefile @@ -1,14 +1,16 @@ LDFLAGS += -liksemel -L/usr/local/lib -all: depends $(MOD).so +all: depends $(MODNAME).so depends: $(BASE)/buildlib.sh $(BASE) install iksemel-1.2.tar.gz --prefix=$(PREFIX) -$(MOD).so: $(MOD).c - $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o - $(CC) $(SOLINK) -o $(MOD).so $(MOD).o $(LDFLAGS) +$(MODNAME).so: $(MODNAME).c + $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o + $(CC) $(SOLINK) -o $(MODNAME).so $(MODNAME).o $(LDFLAGS) clean: rm -fr *.so *.o *~ +install: + cp -f $(MODNAME).so $(PREFIX)/mod diff --git a/src/mod/formats/mod_sndfile/Makefile b/src/mod/formats/mod_sndfile/Makefile index 1056e8fdd8..08e686aec7 100644 --- a/src/mod/formats/mod_sndfile/Makefile +++ b/src/mod/formats/mod_sndfile/Makefile @@ -1,15 +1,19 @@ LDFLAGS += -lsndfile -L/usr/local/lib -all: depends $(MOD).so +all: depends $(MODNAME).so depends: $(BASE)/buildlib.sh $(BASE) install libsndfile-1.0.12.tar.gz --prefix=$(PREFIX) -$(MOD).so: $(MOD).c - $(CC) $(CFLAGS) -fPIC -c $(MOD).c -o $(MOD).o - $(CC) $(SOLINK) -o $(MOD).so $(MOD).o $(LDFLAGS) +$(MODNAME).so: $(MODNAME).c + $(CC) $(CFLAGS) -fPIC -c $(MODNAME).c -o $(MODNAME).o + $(CC) $(SOLINK) -o $(MODNAME).so $(MODNAME).o $(LDFLAGS) clean: rm -fr *.so *.o *~ +install: + cp -f $(MODNAME).so $(PREFIX)/mod + +