forked from Mirrors/freeswitch
940bf73b72
Eliminate some more gmakeisms in the modules makefiles git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4629 d0543943-73ff-0310-b7d9-9358b9ac24b2
217 lines
7.9 KiB
Plaintext
217 lines
7.9 KiB
Plaintext
@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
|
|
|
|
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=`uname -s`
|
|
DYNAMIC_LIB_EXTEN = @DYNAMIC_LIB_EXTEN@
|
|
SOLINK = @SOLINK@
|
|
|
|
LDFLAGS=@SWITCH_AM_LDFLAGS@ @LDFLAGS@ $(OUR_LDFLAGS)
|
|
|
|
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 $@
|
|
|
|
CSOURCEFILE=$(MODNAME).c
|
|
CXXSOURCEFILE=$(MODNAME).cpp
|
|
TOUCH_TARGET=@if test -f "$@" ; then touch "$@" ; fi ;
|
|
|
|
RECURSE_MODNAME=`pwd | sed -e 's|^.*/||'`
|
|
RECURSE_SOURCEFILE=`if test -f $$modname.cpp; then echo $$modname.cpp; else echo $$modname.c; fi`
|
|
RECURSE_OUR_DEPS=`test -z "$(WANT_CURL)" || if test ! -z "$(LIBCURL_DEPS)"; then echo $(CURLLA); fi`
|
|
RECURSE_OUR_CFLAGS=`test -z "$(WANT_CURL)" || echo $(LIBCURL_CPPFLAGS) ; $(LOCAL_INSERT_CFLAGS) `
|
|
RECURSE_OUR_LDFLAGS=`test -z "$(WANT_CURL)" || echo $(LIBCURL) ; $(LOCAL_INSERT_LDFLAGS) `
|
|
RECURSE_CHECKS=if test -z "$(MODNAME)" || test -z "$(SOURCEFILE)" || test -z "$(OUR_DEPS)" ; \
|
|
then modname=$(RECURSE_MODNAME) ; \
|
|
sourcefile=$(RECURSE_SOURCEFILE) ; \
|
|
ourdefs=$(RECURSE_OUR_DEPS) ; \
|
|
ourcflags=$(RECURSE_OUR_CFLAGS) ; \
|
|
ourldflags=$(RECURSE_OUR_LDFLAGS) ;
|
|
|
|
all: Makefile
|
|
@$(RECURSE_CHECKS) \
|
|
$(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags all-modules || exit 1;\
|
|
fi
|
|
depend: Makefile
|
|
@$(RECURSE_CHECKS) \
|
|
$(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags depend-modules || exit 1;\
|
|
fi
|
|
clean: Makefile
|
|
@$(RECURSE_CHECKS) \
|
|
$(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags clean-modules || exit 1;\
|
|
fi
|
|
install: Makefile
|
|
@$(RECURSE_CHECKS) \
|
|
$(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags install-modules || exit 1;\
|
|
fi
|
|
uninstall: Makefile
|
|
@$(RECURSE_CHECKS) \
|
|
$(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags uninstall-modules || exit 1;\
|
|
fi
|
|
distclean: Makefile
|
|
@$(RECURSE_CHECKS) \
|
|
$(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags distclean-modules || exit 1;\
|
|
fi
|
|
extraclean: Makefile
|
|
@$(RECURSE_CHECKS) \
|
|
$(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags extraclean-modules || exit 1;\
|
|
fi
|
|
|
|
|
|
all-modules: local_depend local_all $(MODNAME).$(DYNAMIC_LIB_EXTEN) Makefile
|
|
depend-modules: local_depend
|
|
clean-modules: local_clean mod_clean
|
|
install-modules: all-modules depend_install local_install mod_install
|
|
uninstall-modules: local_uninstall mod_uninstall
|
|
distclean-modules: clean-modules local_distclean
|
|
extraclean-modules: distclean local_extraclean
|
|
|
|
Makefile:
|
|
@if test ! -f $@; then \
|
|
if ! pwd | grep $(switch_srcdir)/src/mod ; then rulesdir=$(switch_srcdir) ; else rulesdir=../../../.. ; fi ; \
|
|
echo BASE=$$rulesdir > Makefile ; \
|
|
echo "include $(BASE)/build/modmake.rules" >> Makefile ; \
|
|
fi ;
|
|
|
|
$(CURLLA):
|
|
cd $(CURL_DIR) && $(MAKE)
|
|
|
|
$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(LIBS) $(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: $(DESTDIR)$(PREFIX)/mod/$(MODNAME).$(DYNAMIC_LIB_EXTEN)
|
|
|
|
$(DESTDIR)$(PREFIX)/mod/$(MODNAME).$(DYNAMIC_LIB_EXTEN):$(MODNAME).$(DYNAMIC_LIB_EXTEN)
|
|
$(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 $@ $<
|
|
|
|
$(MODNAME).o: $(SOURCEFILE) \
|
|
$(switch_srcdir)/src/include/switch.h $(switch_srcdir)/src/include/switch_am_config.h \
|
|
$(switch_srcdir)/src/include/switch_types.h $(switch_srcdir)/src/include/switch_apr.h \
|
|
$(switch_srcdir)/src/include/switch_core_db.h $(switch_srcdir)/src/include/switch_regex.h \
|
|
$(switch_srcdir)/src/include/switch_core.h $(switch_srcdir)/src/include/switch_loadable_module.h \
|
|
$(switch_srcdir)/src/include/switch_console.h $(switch_srcdir)/src/include/switch_utils.h \
|
|
$(switch_srcdir)/src/include/switch_caller.h $(switch_srcdir)/src/include/switch_config.h \
|
|
$(switch_srcdir)/src/include/switch_frame.h $(switch_srcdir)/src/include/switch_module_interfaces.h \
|
|
$(switch_srcdir)/src/include/switch_channel.h $(switch_srcdir)/src/include/switch_buffer.h \
|
|
$(switch_srcdir)/src/include/switch_event.h $(switch_srcdir)/src/include/switch_resample.h \
|
|
$(switch_srcdir)/src/include/switch_ivr.h $(switch_srcdir)/src/include/switch_rtp.h \
|
|
$(switch_srcdir)/src/include/switch_stun.h $(switch_srcdir)/src/include/switch_log.h \
|
|
$(switch_srcdir)/src/include/switch_xml.h
|
|
|
|
$(switch_srcdir)/src/include/switch.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_am_config.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_types.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_apr.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_core_db.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_regex.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_core.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_loadable_module.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_console.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_utils.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_caller.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_config.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_frame.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_module_interfaces.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_channel.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_buffer.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_event.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_resample.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_ivr.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_rtp.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_stun.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_log.h:
|
|
|
|
$(switch_srcdir)/src/include/switch_xml.h:
|
|
|
|
|
|
.PHONY: all clean depend install distclean extraclean \
|
|
all-modules clean-modules depend-modules install-modules distclean-modules extraclean-modules \
|
|
local_all local_clean local_depend local_install local_distclean local_extraclean \
|
|
mod_clean mod_install mod_uninstall depend_install
|