freeswitch/src/mod/Makefile.am
Michael Jerris c99d8c9b08 add uninstall_mod target to the main makefile
implement uninstall in modmake.rules
add LIBADD_LOCAL var for use in the module makefiles, it both links to the module, and is a dependency like LOCAL_OBJS
fix bug in src/mod/Makefile(.am) that was causing make install to fail on first run for those modules that used the default mod makefile
implement the getlib.sh script in mod_shout Makefile (works.. but still wip)



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4589 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-03-14 14:35:11 +00:00

56 lines
2.2 KiB
Makefile

CONF_MODULES=$(shell grep -v "\#" $(switch_builddir)/modules.conf)
FOUND_MODULES=$(shell find . -type d -name mod_\*)
OUR_MODULES=`if test -z $(MODULES) ; then echo $(CONF_MODULES) ; else echo $(MODULES) ; fi ;`
OUR_CLEAN_MODULES=`if test -z $(MODULES) ; then echo $(CONF_MODULES) $(FOUND_MODULES) ; else echo $(MODULES) ; fi ;`
MOD_NAME=`echo $$i | sed -e 's|^.*/||'`
MOD_DIR=`if test -d $(switch_srcdir)/src/mod/$$i ; then echo $(switch_srcdir)/src/mod/$$i ; else echo $$i ; fi;`
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 $(OUR_MODULES) ; do \
echo making $$i ; \
moddir=$(MOD_DIR); \
echo $(MOD_NAME); \
if test -f $$moddir/Makefile ; then \
cd $$moddir && MODNAME=$(MOD_NAME) BASE=$(switch_builddir) $(MAKE) ; else \
cd $$moddir && MODNAME=$(MOD_NAME) BASE=$(switch_builddir) $(MAKE) -f $(switch_builddir)/build/modmake.rules ; \
fi; \
done
clean:
@for i in $(OUR_CLEAN_MODULES) ; do \
echo making clean $$i ; \
moddir=$(MOD_DIR); \
if test -f $$moddir/Makefile ; then \
cd $$moddir && MODNAME=$(MOD_NAME) BASE=$(switch_builddir) $(MAKE) clean ; else \
cd $$moddir && MODNAME=$(MOD_NAME) BASE=$(switch_builddir) $(MAKE) -f $(switch_builddir)/build/modmake.rules clean ; \
fi; \
done
install:
@echo Installing Modules
@for i in $(OUR_MODULES) ; do \
echo making install $$i ; \
moddir=$(MOD_DIR); \
if test -f $$moddir/Makefile ; then \
cd $$moddir && MODNAME=$(MOD_NAME) BASE=$(switch_builddir) $(MAKE) install ; else \
cd $$moddir && MODNAME=$(MOD_NAME) BASE=$(switch_builddir) $(MAKE) -f $(switch_builddir)/build/modmake.rules install ; \
fi; \
done
@echo done
uninstall:
@echo Uninstalling Modules
@for i in $(OUR_MODULES) ; do \
echo making uninstall $$i ; \
moddir=$(MOD_DIR); \
if test -f $$moddir/Makefile ; then \
cd $$moddir && MODNAME=$(MOD_NAME) BASE=$(switch_builddir) $(MAKE) uninstall ; else \
cd $$moddir && MODNAME=$(MOD_NAME) BASE=$(switch_builddir) $(MAKE) -f $(switch_builddir)/build/modmake.rules uninstall ; \
fi; \
done
@echo done