freeswitch/build/modmake.rules.in

119 lines
3.8 KiB
Plaintext
Raw Normal View History

@SET_MAKE@
switch_builddir=@switch_builddir@
switch_srcdir=@switch_srcdir@
CC=@CC@
CXX=@CXX@
AWK=@AWK@
SHELL=@SHELL@
INSTALL=@INSTALL@
GETLIB=@GETLIB@
LIBTOOL=$(switch_builddir)/libtool
LTINSTALL=$(LIBTOOL) --mode=install $(INSTALL)
LTUNINSTALL=$(LIBTOOL) --mode=uninstall rm -f
CCLD = $(CC)
CXXLD = $(CXX)
LIBCURL_DEPS=@LIBCURL_DEPS@
LIBCURL=@LIBCURL@
LIBCURL_CPPFLAGS=@LIBCURL_CPPFLAGS@
CURL_DIR=$(switch_srcdir)/libs/curl
CURLLA=$(CURL_DIR)/lib/libcurl.la
OUR_CFLAGS=$(shell test -z "$(WANT_CURL)" || echo $(LIBCURL_CPPFLAGS))
OUR_LDFLAGS=$(shell test -z "$(WANT_CURL)" || echo $(LIBCURL))
OUR_DEPS=$(shell test -z "$(WANT_CURL)" || if test ! -z "$(LIBCURL_DEPS)"; then echo $(CURLLA); fi)
LDFLAGS=@SWITCH_AM_LDFLAGS@ @LDFLAGS@ $(OUR_LDFLAGS)
LIBS=$(switch_builddir)/libfreeswitch.la
DEFS=@DEFS@
PREFIX = @prefix@
DYLD_LIBRARY_PATH=$(PREFIX)/lib:$DYLD_LIBRARY_PATH
LD_LIBRARY_PATH=$(PREFIX)/lib:$LD_LIBRARY_PATH
OSARCH=$(shell uname -s)
DYNAMIC_LIB_EXTEN = @DYNAMIC_LIB_EXTEN@
SOLINK = @SOLINK@
ALL_CFLAGS = $(LOCAL_CFLAGS) $(MOD_CFLAGS) @SWITCH_AM_CFLAGS@ @CFLAGS@ -D_GNU_SOURCE $(OUR_CFLAGS)
ALL_CXXFLAGS = $(LOCAL_CFLAGS) $(MOD_CFLAGS) @SWITCH_AM_CXXFLAGS@ @CXXFLAGS@ -D_GNU_SOURC $(OUR_CFLAGS)
COMPILE = $(CC) $(ALL_CFLAGS) $(DEFS)
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(COMPILE)
LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(ALL_CFLAGS) $(LDFLAGS) -o $@
CXXCOMPILE = $(CXX) $(ALL_CXXFLAGS) $(DEFS)
LTCXXCOMPILE = $(LIBTOOL) --mode=compile --tag=CXX $(CXXCOMPILE)
CXXLINK = $(LIBTOOL) --mode=link --tag=CXX $(CXXLD) $(ALL_CXXFLAGS) $(LDFLAGS) -o $@
CURDIR=$(shell pwd)
CSOURCEFILE=$(CURDIR)/$(MODNAME).c
CXXSOURCEFILE=$(CURDIR)/$(MODNAME).cpp
SOURCEFILE=$(shell if test -f $(CSOURCEFILE); then echo $(CSOURCEFILE); else echo $(CXXSOURCEFILE); fi;)
all: local_depend local_all $(MODNAME).$(DYNAMIC_LIB_EXTEN) Makefile
depend: local_depend
clean: local_clean mod_clean
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
2007-03-12 22:26:00 -04:00
install: all depend_install local_install mod_install
uninstall: local_uninstall mod_uninstall
distclean: clean local_distclean
extraclean: distclean local_extraclean
Makefile:
if test ! -f $@; then \
echo MODNAME=$(MODNAME) > Makefile ; \
if ! pwd | grep $(switch_srcdir)/src/mod ; then rulesdir=$(switch_srcdir) ; else rulesdir=../../../.. ; fi ; \
echo include $$rulesdir/build/modmake.rules >> Makefile ; \
fi ;
$(CURLLA):
cd $(CURL_DIR) && $(MAKE)
$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(LOCAL_LIBADD) $(OUR_DEPS) $(LOCAL_OBJS) $(SOURCEFILE) $(MODNAME).o
@if test -f $(CSOURCEFILE); then \
echo $(LINK) $(SOLINK) $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS) $(LOCAL_LIBADD); \
$(LINK) $(SOLINK) $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS) $(LOCAL_LIBADD); \
else \
echo $(CXXLINK) $(SOLINK) $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS) $(LOCAL_LIBADD); \
$(CXXLINK) $(SOLINK) $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS) $(LOCAL_LIBADD); \
fi;
mod_clean:
rm -fr *.$(DYNAMIC_LIB_EXTEN) *.o *~ .libs
mod_install:
$(LTINSTALL) $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(DESTDIR)$(PREFIX)/mod
mod_uninstall:
$(LTUNINSTALL) $(DESTDIR)$(PREFIX)/mod/$(MODNAME).$(DYNAMIC_LIB_EXTEN)
# define these in your makefile if you wish
local_all local_depend local_clean depend_install local_install local_distclean local_extraclean local_uninstall:
#
# Implicit rules for creating outputs from input files
#
.SUFFIXES:
.SUFFIXES: .c .lo .o .cpp
.c.o:
$(COMPILE) -c -o $@ $<
.c.lo:
$(LTCOMPILE) -c -o $@ $<
.cpp.o:
$(CXXCOMPILE) -c -o $@ $<
.cpp.lo:
$(LTCXXCOMPILE) -c -o $@ $<
.PHONY: all depend clean local_all local_depend \
install depend_install local_install mod_install \
clean local_clean mod_clean distclean \
local_distclean extraclean local_extraclean