freeswitch/build/modmake.rules.in
Michael Jerris 4720bef8e0 cleanup a bit
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4572 d0543943-73ff-0310-b7d9-9358b9ac24b2
2007-03-12 18:40:18 +00:00

93 lines
2.7 KiB
Plaintext

@SET_MAKE@
switch_builddir=@switch_builddir@
switch_srcdir=@switch_srcdir@
CC=@CC@
CXX=@CXX@
AWK=@AWK@
SHELL=@SHELL@
INSTALL=@INSTALL@
LIBTOOL=$(switch_builddir)/libtool
LTINSTALL = $(LIBTOOL) --mode=install $(INSTALL)
CCLD = $(CC)
CXXLD = $(CXX)
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@
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
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
#LINK_TYPE=$(shell if test -f $(CSOURCEFILE); then echo "clink"; else echo "cxxlink"; fi;)
all: depend $(MODNAME).$(DYNAMIC_LIB_EXTEN) local_all
depend: local_depend
clean: local_clean mod_clean
install: depend_install local_install mod_install
distclean: clean local_distclean
extraclean: distclean local_extraclean
$(MODNAME).o: depend
$(MODNAME).$(DYNAMIC_LIB_EXTEN): $(MODNAME).o $(LOCAL_OBJS)
@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;
mod_clean:
rm -fr *.$(DYNAMIC_LIB_EXTEN) *.o *~ .libs
mod_install:
$(LTINSTALL) $(MODNAME).$(DYNAMIC_LIB_EXTEN) $(DESTDIR)$(PREFIX)/mod
# define these in your makefile if you wish
local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
#
# 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