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
2007-03-13 02:26:00 +00:00
parent 996b330d7d
commit 1481d37fef
11 changed files with 530 additions and 222 deletions
+42
View File
@@ -0,0 +1,42 @@
MODULES = `grep -v "\#" $(switch_builddir)/modules.conf`
all:
@if [ ! -f $(switch_builddir)/modules.conf ] ; then cp $(switch_builddir)/modules.conf.in $(switch_builddir)/modules.conf ; fi
@echo making modules
@for i in $(MODULES) ; do \
echo making $$i ; \
modname=`echo $$i | sed "s/^.*\///g"`; \
if test -z $$modname ; then modname=$$i ; fi; \
if test -d $(switch_srcdir)/src/mod/$$i ; then moddir=$(switch_srcdir)/src/mod/$$i ; else moddir=$$i ; fi; \
if test -f $$moddir/Makefile ; then \
cd $$moddir && MODNAME=$$modname BASE=$(switch_builddir) $(MAKE) ; else \
cd $$moddir && MODNAME=$$modname BASE=$(switch_builddir) $(MAKE) -f $(switch_builddir)/build/modmake.rules ; \
fi; \
done
clean:
@for i in `find . -type d -name mod_\*` ; do \
echo making clean $$i ; \
modname=`echo $$i | sed "s/^.*\///g"`; \
if test -z $$modname ; then modname=$$i ; fi; \
if test -d $(switch_srcdir)/src/mod/$$i ; then moddir=$(switch_srcdir)/src/mod/$$i ; else moddir=$$i ; fi; \
if test -f $$moddir/Makefile ; then \
cd $$moddir && MODNAME=$$modname BASE=$(switch_builddir) $(MAKE) clean ; else \
cd $$moddir && MODNAME=$$modname BASE=$(switch_builddir) $(MAKE) -f $(switch_builddir)/build/modmake.rules clean ; \
fi; \
done
install:
@echo Installing Modules
@for i in $(MODULES) ; do \
echo making install $$i ; \
modname=`echo $$i | sed "s/^.*\///g"`; \
if test -z $$modname ; then modname=$$i ; fi; \
if test -d $(switch_srcdir)/src/mod/$$i ; then moddir=$(switch_srcdir)/src/mod/$$i ; else moddir=$$i ; fi; \
if test -f $$moddir/Makefile ; then \
cd $$moddir && MODNAME=$$modname BASE=$(switch_builddir) $(MAKE) install ; else \
cd $$moddir && MODNAME=$$modname BASE=$(switch_builddir) $(MAKE) -f $(switch_builddir)/build/modmake.rules clean ; \
fi; \
done
@echo done
+385
View File
@@ -0,0 +1,385 @@
# Makefile.in generated by automake 1.9.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = src/mod
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = \
$(top_srcdir)/build/config/ax_compiler_vendor.m4 \
$(top_srcdir)/build/config/ax_cflags_warn_all_ansi.m4 \
$(top_srcdir)/build/config/ax_cc_maxopt.m4 \
$(top_srcdir)/build/config/ax_check_compiler_flags.m4 \
$(top_srcdir)/build/config/ac_gcc_archflag.m4 \
$(top_srcdir)/build/config/ac_gcc_x86_cpuid.m4 \
$(top_srcdir)/libs/apr/build/apr_common.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/src/include/switch_private.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CRASHPROT_FALSE = @CRASHPROT_FALSE@
CRASHPROT_TRUE = @CRASHPROT_TRUE@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DYNAMIC_LIB_EXTEN = @DYNAMIC_LIB_EXTEN@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FFLAGS = @FFLAGS@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IS64BITLINUX_FALSE = @IS64BITLINUX_FALSE@
IS64BITLINUX_TRUE = @IS64BITLINUX_TRUE@
ISLINUX_FALSE = @ISLINUX_FALSE@
ISLINUX_TRUE = @ISLINUX_TRUE@
ISMAC_FALSE = @ISMAC_FALSE@
ISMAC_TRUE = @ISMAC_TRUE@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PRTDIAG = @PRTDIAG@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOLINK = @SOLINK@
STRIP = @STRIP@
SWITCH_AM_CFLAGS = @SWITCH_AM_CFLAGS@
SWITCH_AM_CXXFLAGS = @SWITCH_AM_CXXFLAGS@
SWITCH_AM_LDFLAGS = @SWITCH_AM_LDFLAGS@
VERSION = @VERSION@
WANT_DEBUG_FALSE = @WANT_DEBUG_FALSE@
WANT_DEBUG_TRUE = @WANT_DEBUG_TRUE@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
int64_t_fmt = @int64_t_fmt@
int64_value = @int64_value@
int_value = @int_value@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
long_value = @long_value@
mandir = @mandir@
mkdir_p = @mkdir_p@
moddir = @moddir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
short_value = @short_value@
size_t_fmt = @size_t_fmt@
size_t_value = @size_t_value@
ssize_t_fmt = @ssize_t_fmt@
ssize_t_value = @ssize_t_value@
subdirs = @subdirs@
switch_builddir = @switch_builddir@
switch_srcdir = @switch_srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
uint64_t_fmt = @uint64_t_fmt@
voidp_size = @voidp_size@
MODULES = `grep -v "\#" $(switch_builddir)/modules.conf`
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/mod/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu src/mod/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
tags: TAGS
TAGS:
ctags: CTAGS
CTAGS:
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
distclean distclean-generic distclean-libtool distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
uninstall-info-am
all:
@if [ ! -f $(switch_builddir)/modules.conf ] ; then cp $(switch_builddir)/modules.conf.in $(switch_builddir)/modules.conf ; fi
@echo making modules
@for i in $(MODULES) ; do \
echo making $$i ; \
modname=`echo $$i | sed "s/^.*\///g"`; \
if test -z $$modname ; then modname=$$i ; fi; \
if test -d $(switch_srcdir)/src/mod/$$i ; then moddir=$(switch_srcdir)/src/mod/$$i ; else moddir=$$i ; fi; \
if test -f $$moddir/Makefile ; then \
cd $$moddir && MODNAME=$$modname BASE=$(switch_builddir) $(MAKE) ; else \
cd $$moddir && MODNAME=$$modname BASE=$(switch_builddir) $(MAKE) -f $(switch_builddir)/build/modmake.rules ; \
fi; \
done
clean:
@for i in `find . -type d -name mod_\*` ; do \
echo making clean $$i ; \
modname=`echo $$i | sed "s/^.*\///g"`; \
if test -z $$modname ; then modname=$$i ; fi; \
if test -d $(switch_srcdir)/src/mod/$$i ; then moddir=$(switch_srcdir)/src/mod/$$i ; else moddir=$$i ; fi; \
if test -f $$moddir/Makefile ; then \
cd $$moddir && MODNAME=$$modname BASE=$(switch_builddir) $(MAKE) clean ; else \
cd $$moddir && MODNAME=$$modname BASE=$(switch_builddir) $(MAKE) -f $(switch_builddir)/build/modmake.rules clean ; \
fi; \
done
install:
@echo Installing Modules
@for i in $(MODULES) ; do \
echo making install $$i ; \
modname=`echo $$i | sed "s/^.*\///g"`; \
if test -z $$modname ; then modname=$$i ; fi; \
if test -d $(switch_srcdir)/src/mod/$$i ; then moddir=$(switch_srcdir)/src/mod/$$i ; else moddir=$$i ; fi; \
if test -f $$moddir/Makefile ; then \
cd $$moddir && MODNAME=$$modname BASE=$(switch_builddir) $(MAKE) install ; else \
cd $$moddir && MODNAME=$$modname BASE=$(switch_builddir) $(MAKE) -f $(switch_builddir)/build/modmake.rules clean ; \
fi; \
done
@echo done
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT: