Author: derek Date: Sun Mar 30 18:02:56 2008 New Revision: 400 Removed: sofaswitch/trunk/Makefile.in sofaswitch/trunk/configure.ac sofaswitch/trunk/install-sh sofaswitch/trunk/sofa_inc.mak.in Modified: sofaswitch/trunk/sofa/Makefile sofaswitch/trunk/sofa/sofa_inc.mak.in sofaswitch/trunk/voip/Makefile Log: Get it to build voip,am,mcu etc. Modified: sofaswitch/trunk/sofa/Makefile ============================================================================== --- sofaswitch/trunk/sofa/Makefile (original) +++ sofaswitch/trunk/sofa/Makefile Sun Mar 30 18:02:56 2008 @@ -1,10 +1,9 @@ # # Makefile # -# Make file for Sofa Switch library +# Make file for SofaSwitch # -# Copyright (c) 2000 Equivalence pty. Ltd. -# Copyright (c) 2006 Indranet Technologies Ltd. +# Copyright (c) 2001 Equivalence Pty. Ltd. # # The contents of this file are subject to the Mozilla Public License # Version 1.0 (the "License"); you may not use this file except in @@ -16,30 +15,39 @@ # the License for the specific language governing rights and limitations # under the License. # -# The Original Code is the Sofa Switch Library. +# The Original Code is Open Phone Abstraction Library. # # The Initial Developer of the Original Code is Equivalence Pty. Ltd. # # Contributor(s): ______________________________________. -# Shamlessly stolen and modified from the OPAL project by Derek J Smithies -# -# -# # +# $Revision: 19747 $ +# $Author: rjongbloed $ +# $Date: 2008-03-14 16:19:22 +1300 (Fri, 14 Mar 2008) $ # +export SOFADIR=/users/derek/sofa/sofaswitch/sofa INSTALL=/usr/bin/install -c +OS_NAME=$(shell uname -s) +ifeq ($(OS_NAME),SunOS) + override SHELL=/usr/bin/bash +endif default :: optshared all :: bothdepend both +update: + svn update + $(MAKE) all + + SUBDIRS := LIBRARY_MAKEFILE:=1 -include $(SOFADIR)/../sofa_inc.mak +include $(SOFADIR)/sofa_inc.mak PREFIX=/usr/local/ exec_prefix = ${PREFIX} @@ -53,9 +61,6 @@ endif SOFA_OBJDIR = $(SOFA_LIBDIR)/$(PT_OBJBASE) -ifdef NOTRACE -SOFA_OBJDIR += n -endif OBJDIR = $(SOFA_OBJDIR) LIBDIR = $(SOFA_LIBDIR) @@ -72,9 +77,11 @@ VPATH_CXX := $(SOFA_SRCDIR) -SOURCES := $(SOFA_SRCDIR)/messages.cxx $(SOFA_SRCDIR)/messlist.cxx - +######################################## +# Source files for library +SOURCES := $(SOFA_SRCDIR)/messages.cxx \ + $(SOFA_SRCDIR)/messlist.cxx # # Files to be cleaned during make clean @@ -85,177 +92,44 @@ #################################################### -include $(PWLIBDIR)/make/common.mak +include /home/derek/opalvoip/ptlib/make/common.mak -#################################################### -# replace lib.mak +LIB_FILENAME=$(SOFA_FILE) +SYSLIBS += -L$(PT_LIBDIR) -l$(PTLIB_BASE)$(LIB_TYPE) -ifneq ($(OSTYPE),Darwin) - LIBNAME_MAJ = $(SOFA_FILE).$(MAJOR_VERSION) - LIBNAME_MIN = $(LIBNAME_MAJ).$(MINOR_VERSION) - ifeq ($(BUILD_TYPE),.) - LIBNAME_PAT = $(LIBNAME_MIN).$(BUILD_NUMBER) - else - LIBNAME_PAT = $(LIBNAME_MIN)-$(BUILD_TYPE)$(BUILD_NUMBER) - endif -else - LIBNAME_MAJ = $(subst .$(LIB_SUFFIX),.$(MAJOR_VERSION).$(LIB_SUFFIX),$(SOFA_FILE)) - LIBNAME_MIN = $(subst .$(LIB_SUFFIX),.$(MAJOR_VERSION).$(MINOR_VERSION).$(LIB_SUFFIX),$(SOFA_FILE)) - ifeq ($(BUILD_TYPE),.) - LIBNAME_PAT = $(subst .$(LIB_SUFFIX),.$(MAJOR_VERSION).$(MINOR_VERSION).$(BUILD_NUMBER).$(LIB_SUFFIX),$(SOFA_FILE)) - else - LIBNAME_PAT = $(subst .$(LIB_SUFFIX),.$(MAJOR_VERSION).$(MINOR_VERSION)-$(BUILD_TYPE)$(BUILD_NUMBER).$(LIB_SUFFIX),$(SOFA_FILE)) - endif -endif - -LIB_SONAME = $(LIBNAME_MAJ) +include /home/derek/opalvoip/ptlib/make/lib.mak -CLEAN_FILES += $(LIBDIR)/$(LIBNAME_PAT) $(LIBDIR)/$(SOFA_FILE) $(LIBDIR)/$(LIBNAME_MAJ) $(LIBDIR)/$(LIBNAME_MIN) - -ifneq ($(P_SHAREDLIB),1) - STATIC_LIB_FILE = $(LIBDIR)/$(SOFA_FILE) -else - STATIC_LIB_FILE = $(LIBDIR)/$(subst .$(LIB_SUFFIX),_s.$(STATICLIBEXT),$(SOFA_FILE)) -endif - -$(LIBDIR)/$(SOFA_FILE) : $(TARGETLIB) - -ifeq ($(P_SHAREDLIB),1) - - ifeq ($(OSTYPE),beos) - # BeOS requires different options when building shared libraries - # Also, when building a shared library x that references symbols in libraries y, - # the y libraries need to be added to the linker command - LDSOOPTS = -nostdlib -nostart - EXTLIBS = -lstdc++.r4 - SYSLIBS += -L$(PW_LIBDIR) -l$(PTLIB_BASE)$(LIB_TYPE) - else - ifeq ($(OSTYPE),Darwin) - LDSOOPTS = -dynamiclib - SYSLIBS += -l$(PTLIB_BASE)$(LIB_TYPE) - else - LDSOOPTS = -shared - endif - endif - - ENDLDLIBS := $(SYSLIBS) $(ENDLDLIBS) - - ifeq ($(OSTYPE),rtems) - EXTLIBS = -lstdc++ - endif - - ifneq ($(OSTYPE), QNX) - ifneq (,$(findstring $(OSTYPE),FreeBSD OpenBSDs)) - ifdef P_PTHREADS - EXTLIBS += -pthread - endif - else - ifdef P_PTHREADS - EXTLIBS += -lpthread - endif - endif - endif - - # Solaris loader doesn't grok -soname (sees it as -s -oname) - # We could use -Wl,-h,$(LIB_BASENAME).1 but then we find that the arglist - # to gcc is 2900+ bytes long and it will barf. I fix this by invoking ld - # directly and passing it the equivalent arguments...jpd@louisiana.edu - ifeq ($(OSTYPE),solaris) - LDSOOPTS = -Bdynamic -G -h $(LIB_SONAME) - LD = $(CPLUS) - else - ifeq ($(OSTYPE),mingw) - LDSOOPTS += -Wl,--kill-at - else - ifneq ($(OSTYPE),Darwin) - LDSOOPTS += -Wl,-soname,$(LIB_SONAME) - endif - endif - LD = $(CPLUS) - endif - - $(LIBDIR)/$(SOFA_FILE): $(LIBDIR)/$(LIBNAME_PAT) - cd $(LIBDIR) ; rm -f $(SOFA_FILE) ; ln -sf $(LIBNAME_PAT) $(SOFA_FILE) - cd $(LIBDIR) ; rm -f $(LIBNAME_MAJ) ; ln -sf $(LIBNAME_PAT) $(LIBNAME_MAJ) - cd $(LIBDIR) ; rm -f $(LIBNAME_MIN) ; ln -sf $(LIBNAME_PAT) $(LIBNAME_MIN) - - $(LIBDIR)/$(LIBNAME_PAT): $(STATIC_LIB_FILE) - @echo EXTLIBS = $(EXTLIBS) - @echo SYSLIBS = $(SYSLIBS) - @if [ ! -d $(LIBDIR) ] ; then mkdir $(LIBDIR) ; fi - $(LD) $(LDSOOPTS) -o $(LIBDIR)/$(LIBNAME_PAT) $(LDFLAGS) $(EXTLIBS) $(OBJS) $(ENDLDLIBS) - -endif # P_SHAREDLIB - -$(STATIC_LIB_FILE): $(OBJS) - @if [ ! -d $(LIBDIR) ] ; then mkdir $(LIBDIR) ; fi - $(ARCHIVE) $(STATIC_LIB_FILE) $(OBJS) -ifeq ($(P_USE_RANLIB),1) - $(RANLIB) $(STATIC_LIB_FILE) -endif #################################################### notrace:: $(MAKE) NOTRACE=1 opt + ############################################################################### #### Subdirectories -$(STANDARD_TARGETS) :: - set -e; $(foreach dir,$(SUBDIRS),$(MAKE) -C $(dir) $@;) +$(subst tagbuild,,$(STANDARD_TARGETS)) :: + @set -e; $(foreach dir,$(SUBDIRS),if test -e $(dir) ; then $(MAKE) -C $(dir) $@; fi ;) + + +$(STANDARD_TARGETS) :: Makefile + +Makefile: Makefile.in configure + @echo + @echo "*******************************************************" + @echo Makefile is not up to date, is a ./configure necessary? + @echo "*******************************************************" + @false #### Install targets -install: +install :: mkdir -p $(DESTDIR)${exec_prefix}/lib - ( for dir in $(DESTDIR)${exec_prefix}/lib \ - $(DESTDIR)$(PREFIX)/include/opal/asn \ - $(DESTDIR)$(PREFIX)/include/opal/codec \ - $(DESTDIR)$(PREFIX)/include/opal/h323 \ - $(DESTDIR)$(PREFIX)/include/opal/iax2 \ - $(DESTDIR)$(PREFIX)/include/opal/lids \ - $(DESTDIR)$(PREFIX)/include/opal/opal \ - $(DESTDIR)$(PREFIX)/include/opal/rtp \ - $(DESTDIR)$(PREFIX)/include/opal/sip \ - $(DESTDIR)$(PREFIX)/include/opal/t120 \ - $(DESTDIR)$(PREFIX)/include/opal/t38 \ - $(DESTDIR)$(PREFIX)/share/opal ;\ - do mkdir -p $$dir ; chmod 755 $$dir ; \ - done) - $(INSTALL) -m 755 lib/$(LIBNAME_PAT) $(DESTDIR)${exec_prefix}/lib - ln -snf $(LIBNAME_PAT) \ - $(DESTDIR)${exec_prefix}/lib/$(SOFA_FILE).$(MAJOR_VERSION).$(MINOR_VERSION) - ln -snf $(LIBNAME_PAT) \ - $(DESTDIR)${exec_prefix}/lib/$(SOFA_FILE).$(MAJOR_VERSION) - ln -snf $(LIBNAME_PAT) \ - $(DESTDIR)${exec_prefix}/lib/$(SOFA_FILE) - ln -snf $(LIBNAME_PAT) \ - $(DESTDIR)${exec_prefix}/lib/libsofa.so - $(INSTALL) -m 644 opal_inc.mak $(DESTDIR)$(PREFIX)/share/sofa - -uninstall: - rm -rf $(DESTDIR)$(PREFIX)/include/sofa \ - $(DESTDIR)$(PREFIX)/share/sofa - rm -f $(DESTDIR)${exec_prefix}/lib/$(SOFA_FILE) \ - $(DESTDIR)${exec_prefix}/lib/libsofa.so \ - $(DESTDIR)${exec_prefix}/lib/$(SOFA_FILE).$(MAJOR_VERSION).$(MINOR_VERSION) \ - $(DESTDIR)${exec_prefix}/lib/$(SOFA_FILE).$(MAJOR_VERSION) \ - $(DESTDIR)${exec_prefix}/lib/$(LIBNAME_PAT) -docs: - doxygen docs.cfg - - -distclean: - @find . -name \*~ | xargs rm -f - @find . -name core\* | xargs rm -f - @find . -name obj\* | xargs rm -fr - @find . -name html | xargs rm -fr - @find . -name log\* | xargs rm -fr - @find . -name lib | xargs rm -fr - @echo " " - @echo "removing all editor backup files, core files, obj files, and doc files" - @echo " " +docs: FORCE + doxygen sofa_cfg.dxy +FORCE: + # End of file ################################################################# Modified: sofaswitch/trunk/sofa/sofa_inc.mak.in ============================================================================== --- sofaswitch/trunk/sofa/sofa_inc.mak.in (original) +++ sofaswitch/trunk/sofa/sofa_inc.mak.in Sun Mar 30 18:02:56 2008 @@ -37,8 +37,10 @@ ifdef NOTRACE OBJDIR_SUFFIX := n endif +ifndef OPAL_ENABLED include $(PTLIBDIR)/make/ptlib.mak endif +endif SOFA_SRCDIR = $(SOFADIR)/src SOFA_INCDIR = $(SOFADIR)/include Modified: sofaswitch/trunk/voip/Makefile ============================================================================== --- sofaswitch/trunk/voip/Makefile (original) +++ sofaswitch/trunk/voip/Makefile Sun Mar 30 18:02:56 2008 @@ -70,7 +70,7 @@ include $(OPALDIR)/opal_inc.mak endif -OPALENABLED=TRUE +OPAL_ENABLED=TRUE ifndef SOFADIR @@ -85,15 +85,6 @@ abort now. endif - - - - - - - - - ################################################## distclean: