move module make to it's own makefile

remove need for modmake.sh (its use is now fully adressed within src/mod/Makefile.am)
remove need for generic_mod.mk (it uses the generated build/modmake.rules now instead)
add support for building out of tree modules as part of the freeswitch build simply by adding the full path to the module dir to your modules.conf
remove the need for special tragets to build.
make will now do a make through the core AND all the modules.
make install will now install the core and all the modules.
most or all of the old targets are still there, plus the new target "core" that will do more or less what make used to do.
make should now be able to be done without write permissions to the prefix directory (make install of course will still need them) whith the exception of modules that use buildlib.sh to download and install thier dependencies.  This will be fixed in a future revision.
checkversion.sh no longer will clean the modules on a change.  The need for this should be gone with the correct include paths to have the src directory included first.
Some steps in this commit to move us closer to being able to build with non gnu make (gmake).  Still some more work to do in this regard as well.
buildlib.sh no longer exports CFLAGS, just passes them to the confiure.
Move a little closer to supporting install directories in the "automake way" where all the dirs will be acutally determined in configure, and follow the standard install targets in Makefile.am
no longer build the modules twice on make install

Additional fixes still on the way for proper dependency tracking for the module builds, so they don't build every time.

any input on how to reach some of the goals stated above of supporting non gnu make, and more properly handling the install directories is appretiated.  Drop me an e-mail if you are intersted in helping.

Mike




git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4577 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris committed 2007-03-13 02:26:00 +00:00
1 parent 996b330d7d
commit 1481d37fef
11 files changed
+530 -222

No files matched your search

+28 -72
View File
@@ -1,6 +1,6 @@
EXTRA_DIST =
SUBDIRS =
AUTOMAKE_OPTS = gnu foreign
SUBDIRS = . src/mod
AUTOMAKE_OPTS = foreign
NAME=freeswitch
PREFIX=$(prefix)
@@ -98,6 +98,20 @@ freeswitch_SOURCES = src/switch.c\
freeswitch_CFLAGS = $(AM_CFLAGS)
freeswitch_LDADD = ${MOD_LINK}
install-data-local:
@echo Installing $(NAME)
@for x in conf mod db log log/xml_cdr bin scripts htdocs grammar ; do \
$(mkinstalldirs) $(DESTDIR)$(prefix)/$$x ; \
done
@if [ ! -f $(DESTDIR)$(PREFIX)/conf/freeswitch.xml ] ; then \
$(INSTALL) conf/*.xml $(DESTDIR)$(PREFIX)/conf ; \
fi
@if [ -f .libs/$(NAME) ] ; then \
$(INSTALL) .libs/$(NAME) $(DESTDIR)$(PREFIX)/bin/$(NAME) ; \
else \
$(INSTALL) ./$(NAME) $(DESTDIR)$(PREFIX)/bin/$(NAME) ;\
fi
version: Makefile src/include/switch_version.h
MAKE=$(MAKE) ./build/checkversion.sh
@@ -138,82 +152,24 @@ deps: version sqlite apr apr-util pcre srtp resample teletone
core: deps libfreeswitch.la
everything: install
installall: install
sure: clean modwipe uninstall installall
wayclean: clean
modules: libfreeswitch.la
@if [ ! -f $(PWD)/modules.conf ] ; then cp $(PWD)/modules.conf.in $(PWD)/modules.conf ; fi
@echo making modules
@rm -f build/freeswitch.env
@./build/addenv.sh build/freeswitch.env MAKE "$(MAKE)"
@./build/addenv.sh build/freeswitch.env DYLD_LIBRARY_PATH "$(PREFIX)/lib:$DYLD_LIBRARY_PATH"
@./build/addenv.sh build/freeswitch.env LD_LIBRARY_PATH "$(PREFIX)/lib:$LD_LIBRARY_PATH"
@./build/addenv.sh build/freeswitch.env PREFIX "$(PREFIX)"
@./build/addenv.sh build/freeswitch.env BASE "$(switch_srcdir)"
@./build/addenv.sh build/freeswitch.env OSARCH "$(OSARCH)"
@./build/addenv.sh build/freeswitch.env DYNAMIC_LIB_EXTEN "$(DYNAMIC_LIB_EXTEN)"
@./build/addenv.sh build/freeswitch.env SOLINK "$(SOLINK)"
@./build/addenv.sh build/freeswitch.env LDFLAGS "$(AM_LDFLAGS) $(MOD_LINK)"
@./build/addenv.sh build/freeswitch.env CFLAGS "$(AM_CFLAGS)"
@./build/addenv.sh build/freeswitch.env CC "$(CC)"
@./build/addenv.sh build/freeswitch.env CFGARGS "$(AM_CFGARGS)"
@./build/addenv.sh build/freeswitch.env LINK "$(LINK)"
@./build/addenv.sh build/freeswitch.env LTCOMPILE "$(LTCOMPILE)"
@./build/addenv.sh build/freeswitch.env LIBTOOL "$(LIBTOOL)"
@./build/addenv.sh build/freeswitch.env LTINSTALL "$(LTINSTALL)"
@cd src/mod && for i in `cat ../../modules.conf | grep -v \#` ; do echo making $$i ; $(PWD)/build/modmake.sh $(MAKE) $(PWD) $$i || exit 1; done
@rm -f build/freeswitch.env
$(MAKE) -C src/mod
install_mod: libfreeswitch.la
$(MAKE) -C src/mod install
modclean:
@rm -f build/freeswitch.env
@./build/addenv.sh build/freeswitch.env MAKE "$(MAKE)"
@./build/addenv.sh build/freeswitch.env CC "$(CC)"
@./build/addenv.sh build/freeswitch.env DYNAMIC_LIB_EXTEN "$(DYNAMIC_LIB_EXTEN)"
@cd src/mod && for i in `find . -type d -name mod_\*` ; do echo making clean $$i ; $(PWD)/build/modmake.sh $(MAKE) $(PWD) $$i clean || exit 1; done
@rm -f build/freeswitch.env
everything: install install_mod
installall: install install_mod
sure: clean modclean modwipe uninstall installall
wayclean: clean modclean
$(MAKE) -C src/mod clean
modwipe:
rm -f $(PREFIX)/mod/*.${DYNAMIC_LIB_EXTEN}
install_mod: modules
@echo Installing $(NAME)
@for x in conf mod db log log/xml_cdr bin scripts htdocs grammar ; do \
$(mkinstalldirs) $(DESTDIR)$(prefix)/$$x ; \
done
@if [ ! -f $(DESTDIR)$(PREFIX)/conf/freeswitch.xml ] ; then \
$(INSTALL) conf/*.xml $(DESTDIR)$(PREFIX)/conf ; \
fi
@if [ -f .libs/$(NAME) ] ; then \
$(INSTALL) .libs/$(NAME) $(DESTDIR)$(PREFIX)/bin/$(NAME) ; \
else \
$(INSTALL) ./$(NAME) $(DESTDIR)$(PREFIX)/bin/$(NAME) ;\
fi
@echo Installing Modules
@rm -f build/freeswitch.env
@./build/addenv.sh build/freeswitch.env PREFIX "$(PREFIX)"
@./build/addenv.sh build/freeswitch.env MAKE "$(MAKE)"
@./build/addenv.sh build/freeswitch.env DYLD_LIBRARY_PATH "$(PREFIX)/lib:$DYLD_LIBRARY_PATH"
@./build/addenv.sh build/freeswitch.env LD_LIBRARY_PATH "$(PREFIX)/lib:$LD_LIBRARY_PATH"
@./build/addenv.sh build/freeswitch.env DYNAMIC_LIB_EXTEN "$(DYNAMIC_LIB_EXTEN)"
@./build/addenv.sh build/freeswitch.env BASE "$(switch_srcdir)"
@./build/addenv.sh build/freeswitch.env OSARCH "$(OSARCH)"
@./build/addenv.sh build/freeswitch.env SOLINK "$(SOLINK)"
@./build/addenv.sh build/freeswitch.env LDFLAGS "$(AM_LDFLAGS) $(MOD_LINK)"
@./build/addenv.sh build/freeswitch.env CFLAGS "$(AM_CFLAGS)"
@./build/addenv.sh build/freeswitch.env CC "$(CC)"
@./build/addenv.sh build/freeswitch.env LINK "$(LINK)"
@./build/addenv.sh build/freeswitch.env LTCOMPILE "$(LTCOMPILE)"
@./build/addenv.sh build/freeswitch.env LTINSTALL "$(LTINSTALL)"
@./build/addenv.sh build/freeswitch.env LIBTOOL "$(LIBTOOL)"
@cd src/mod && for i in `cat ../../modules.conf | grep -v \#` ; do echo making install $$i ; $(PWD)/build/modmake.sh $(MAKE) $(PWD) $$i install || exit 1; done
@rm -f build/freeswitch.env
@echo done
dox:
cd docs && doxygen $(PWD)/docs/Doxygen.conf