2007-03-11 12:58:22 -04:00
|
|
|
@SET_MAKE@
|
|
|
|
|
|
|
|
switch_builddir=@switch_builddir@
|
|
|
|
switch_srcdir=@switch_srcdir@
|
|
|
|
|
|
|
|
CC=@CC@
|
2007-03-12 00:21:54 -04:00
|
|
|
CXX=@CXX@
|
2007-03-11 12:58:22 -04:00
|
|
|
AWK=@AWK@
|
|
|
|
SHELL=@SHELL@
|
|
|
|
INSTALL=@INSTALL@
|
|
|
|
LIBTOOL=$(switch_builddir)/libtool
|
|
|
|
LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
|
2007-03-12 00:21:54 -04:00
|
|
|
CCLD = $(CC)
|
|
|
|
CXXLD = $(CXX)
|
2007-03-11 12:58:22 -04:00
|
|
|
|
|
|
|
LDFLAGS=@SWITCH_AM_LDFLAGS@ @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@
|
|
|
|
|
2007-03-12 00:21:54 -04:00
|
|
|
ALL_CFLAGS = $(LOCAL_CFLAGS) $(MOD_CFLAGS) @SWITCH_AM_CFLAGS@ @CFLAGS@ -D_GNU_SOURCE
|
|
|
|
ALL_CXXFLAGS = $(LOCAL_CFLAGS) $(MOD_CFLAGS) @SWITCH_AM_CXXFLAGS@ @CXXFLAGS@ -D_GNU_SOURC
|
2007-03-11 12:58:22 -04:00
|
|
|
|
2007-03-12 00:21:54 -04:00
|
|
|
COMPILE = $(CC) $(ALL_CFLAGS) $(DEFS)
|
|
|
|
LTCOMPILE = $(LIBTOOL) --mode=compile --tag=CC $(COMPILE)
|
|
|
|
LINK = $(LIBTOOL) --mode=link --tag=CC $(CCLD) $(ALL_CFLAGS) $(LDFLAGS) -o $@
|
2007-03-11 12:58:22 -04:00
|
|
|
|
2007-03-12 00:21:54 -04:00
|
|
|
CXXCOMPILE = $(CXX) $(ALL_CXXFLAGS) $(DEFS)
|
|
|
|
LTCXXCOMPILE = $(LIBTOOL) --mode=compile --tag=CXX $(CXXCOMPILE)
|
|
|
|
CXXLINK = $(LIBTOOL) --mode=link --tag=CXX $(CXXLD) $(ALL_CXXFLAGS) $(LDFLAGS) -o $@
|
2007-03-11 12:58:22 -04:00
|
|
|
|
2007-03-12 00:21:54 -04:00
|
|
|
CURDIR=$(shell pwd)
|
|
|
|
CSOURCEFILE=$(CURDIR)/$(MODNAME).c
|
|
|
|
CXXSOURCEFILE=$(CURDIR)/$(MODNAME).cpp
|
2007-03-13 10:43:40 -04:00
|
|
|
SOURCEFILE=$(shell if test -f $(CSOURCEFILE); then echo $(CSOURCEFILE); else echo $(CXXSOURCEFILE); fi;)
|
2007-03-11 12:58:22 -04:00
|
|
|
|
2007-03-13 10:43:40 -04:00
|
|
|
all: local_depend local_all $(MODNAME).$(DYNAMIC_LIB_EXTEN) Makefile
|
2007-03-12 00:21:54 -04:00
|
|
|
depend: local_depend
|
|
|
|
clean: local_clean mod_clean
|
2007-03-12 22:26:00 -04:00
|
|
|
install: all depend_install local_install mod_install
|
2007-03-12 00:21:54 -04:00
|
|
|
distclean: clean local_distclean
|
|
|
|
extraclean: distclean local_extraclean
|
|
|
|
|
2007-03-13 10:43:40 -04:00
|
|
|
Makefile:
|
2007-03-13 13:46:44 -04:00
|
|
|
if test ! -f $@; then \
|
2007-03-13 12:49:15 -04:00
|
|
|
echo MODNAME=$(MODNAME) > Makefile ; \
|
2007-03-13 13:46:44 -04:00
|
|
|
if ! pwd | grep $(switch_srcdir)/src/mod ; then rulesdir=$(switch_srcdir) ; else rulesdir=../../../.. ; fi ; \
|
|
|
|
echo include $$rulesdir/build/modmake.rules >> Makefile ; \
|
2007-03-13 10:43:40 -04:00
|
|
|
fi ;
|
2007-03-12 00:21:54 -04:00
|
|
|
|
2007-03-13 10:43:40 -04:00
|
|
|
$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).o $(LOCAL_OBJS) $(SOURCEFILE)
|
2007-03-12 14:40:18 -04:00
|
|
|
@if test -f $(CSOURCEFILE); then \
|
|
|
|
echo $(LINK) $(SOLINK) $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS); \
|
|
|
|
$(LINK) $(SOLINK) $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS); \
|
|
|
|
else \
|
|
|
|
echo $(CXXLINK) $(SOLINK) $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS); \
|
|
|
|
$(CXXLINK) $(SOLINK) $(MODNAME).o -o $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(LIBS) $(LOCAL_LDFLAGS) $(LOCAL_OBJS); \
|
|
|
|
fi;
|
2007-03-12 00:21:54 -04:00
|
|
|
|
|
|
|
mod_clean:
|
2007-03-11 12:58:22 -04:00
|
|
|
rm -fr *.$(DYNAMIC_LIB_EXTEN) *.o *~ .libs
|
|
|
|
|
2007-03-12 00:21:54 -04:00
|
|
|
mod_install:
|
2007-03-11 12:58:22 -04:00
|
|
|
$(LTINSTALL) $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(DESTDIR)$(PREFIX)/mod
|
|
|
|
|
2007-03-12 00:21:54 -04:00
|
|
|
# define these in your makefile if you wish
|
|
|
|
local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
|
2007-03-11 12:58:22 -04:00
|
|
|
|
|
|
|
#
|
|
|
|
# Implicit rules for creating outputs from input files
|
|
|
|
#
|
|
|
|
.SUFFIXES:
|
2007-03-12 00:21:54 -04:00
|
|
|
.SUFFIXES: .c .lo .o .cpp
|
2007-03-11 12:58:22 -04:00
|
|
|
|
|
|
|
.c.o:
|
2007-03-12 00:21:54 -04:00
|
|
|
$(COMPILE) -c -o $@ $<
|
2007-03-11 12:58:22 -04:00
|
|
|
|
|
|
|
.c.lo:
|
2007-03-12 00:21:54 -04:00
|
|
|
$(LTCOMPILE) -c -o $@ $<
|
|
|
|
|
|
|
|
.cpp.o:
|
|
|
|
$(CXXCOMPILE) -c -o $@ $<
|
|
|
|
|
|
|
|
.cpp.lo:
|
|
|
|
$(LTCXXCOMPILE) -c -o $@ $<
|
|
|
|
|
2007-03-11 12:58:22 -04:00
|
|
|
|
2007-03-12 00:21:54 -04:00
|
|
|
.PHONY: all depend clean local_all local_depend \
|
|
|
|
install depend_install local_install mod_install \
|
|
|
|
clean local_clean mod_clean distclean \
|
2007-03-12 14:40:18 -04:00
|
|
|
local_distclean extraclean local_extraclean
|