remove gmakeisms from sofia, portaudio and cepstral makefiles. simplify the module template makefiles

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4635 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2007-03-18 01:52:23 +00:00
parent 8a90afdb4b
commit d59122379c
4 changed files with 20 additions and 49 deletions

View File

@ -53,42 +53,28 @@ RECURSE_SOURCEFILE=`if test -f $$modname.cpp; then echo $$modname.cpp; else echo
RECURSE_OUR_DEPS=`test -z "$(WANT_CURL)" || if test ! -z "$(LIBCURL_DEPS)"; then echo $(CURLLA); 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_CFLAGS=`test -z "$(WANT_CURL)" || echo $(LIBCURL_CPPFLAGS) ; $(LOCAL_INSERT_CFLAGS) `
RECURSE_OUR_LDFLAGS=`test -z "$(WANT_CURL)" || echo $(LIBCURL) ; $(LOCAL_INSERT_LDFLAGS) ` 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)" ; \ RECURSE_MAKE=modname="$(RECURSE_MODNAME)" ; \
then modname=$(RECURSE_MODNAME) ; \ sourcefile="$(RECURSE_SOURCEFILE)" ; \
sourcefile=$(RECURSE_SOURCEFILE) ; \ osarch=`uname -s` ; \
ourdefs=$(RECURSE_OUR_DEPS) ; \ ourdefs="$(RECURSE_OUR_DEPS)" ; \
ourcflags=$(RECURSE_OUR_CFLAGS) ; \ ourcflags="$(RECURSE_OUR_CFLAGS)" ; \
ourldflags=$(RECURSE_OUR_LDFLAGS) ; ourldflags="$(RECURSE_OUR_LDFLAGS)" ; \
$(MAKE) MODNAME="$$modname" SOURCEFILE="$$sourcefile" OUR_DEPS="$$ourdefs" OUR_CFLAGS="$$ourcflags" OUR_LDFLAGS="$$ourldflags"
all: Makefile all: Makefile
@$(RECURSE_CHECKS) \ @$(RECURSE_MAKE) all-modules || exit 1
$(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags all-modules || exit 1;\
fi
depend: Makefile depend: Makefile
@$(RECURSE_CHECKS) \ @$(RECURSE_MAKE) depend-modules || exit 1
$(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags depend-modules || exit 1;\
fi
clean: Makefile clean: Makefile
@$(RECURSE_CHECKS) \ @$(RECURSE_MAKE) clean-modules || exit 1
$(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags clean-modules || exit 1;\
fi
install: Makefile install: Makefile
@$(RECURSE_CHECKS) \ @$(RECURSE_MAKE) install-modules || exit 1
$(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags install-modules || exit 1;\
fi
uninstall: Makefile uninstall: Makefile
@$(RECURSE_CHECKS) \ @$(RECURSE_MAKE) uninstall-modules || exit 1
$(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags uninstall-modules || exit 1;\
fi
distclean: Makefile distclean: Makefile
@$(RECURSE_CHECKS) \ @$(RECURSE_MAKE) distclean-modules || exit 1
$(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags distclean-modules || exit 1;\
fi
extraclean: Makefile extraclean: Makefile
@$(RECURSE_CHECKS) \ @$(RECURSE_MAKE) extraclean-modules || exit 1
$(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 all-modules: local_depend local_all $(MODNAME).$(DYNAMIC_LIB_EXTEN) Makefile
depend-modules: local_depend depend-modules: local_depend

View File

@ -1,15 +1,6 @@
# define these targets in your makefile if you wish LOCAL_INSERT_LDFLAGS=if test $$osarch = "Darwin" ; then echo "-framework swift" ; else echo "-L/opt/swift/lib -lswift -lceplex_us -lceplang_en -lm" ; fi ;
# local_all local_depend local_clean depend_install local_install local_distclean local_extraclean:
OSARCH=$(shell uname -s)
# and define these variables to impact your build
LOCAL_INSERT_CFLAGS=test $$osarch = "Darwin" || echo "-I/opt/swift/include";
ifeq ($(OSARCH),Darwin)
LOCAL_LDFLAGS += -framework swift
else
LOCAL_LDFLAGS += -L/opt/swift/lib -lswift -lceplex_us -lceplang_en -lm
LOCAL_CFLAGS += -I/opt/swift/include
endif
LOCAL_OBJS=
include ../../../../build/modmake.rules include ../../../../build/modmake.rules

View File

@ -1,14 +1,12 @@
BASE=../../../.. BASE=../../../..
OSARCH=$(shell uname -s)
PA_DIR=$(BASE)/libs/portaudio PA_DIR=$(BASE)/libs/portaudio
PALA=$(PA_DIR)/lib/libportaudio.la PALA=$(PA_DIR)/lib/libportaudio.la
LOCAL_CFLAGS=-I. -I$(PA_DIR)/include LOCAL_CFLAGS=-I. -I$(PA_DIR)/include
LOCAL_LDFLAGS=
ifeq ($(OSARCH),Darwin) LOCAL_INSERT_LDFLAGS=if test $$osarch = "Darwin" ; then echo "-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon" ; fi ;
LOCAL_LDFLAGS += -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon
endif
LOCAL_LIBADD=$(PALA) LOCAL_LIBADD=$(PALA)
LOCAL_OBJS=pablio.o pa_ringbuffer.o LOCAL_OBJS=pablio.o pa_ringbuffer.o

View File

@ -1,7 +1,5 @@
BASE=../../../.. BASE=../../../..
OS_ARCH := $(subst /,_,$(shell uname -s | sed /\ /s//_/))
SOFIA_DIR=$(BASE)/libs/sofia-sip SOFIA_DIR=$(BASE)/libs/sofia-sip
SOFIAUA_DIR=$(SOFIA_DIR)/libsofia-sip-ua SOFIAUA_DIR=$(SOFIA_DIR)/libsofia-sip-ua
@ -19,9 +17,7 @@ SOFIALA=$(SOFIAUA_DIR)/libsofia-sip-ua.la
LOCAL_LIBADD=$(SOFIALA) LOCAL_LIBADD=$(SOFIALA)
ifeq ($(OS_ARCH),Darwin) LOCAL_INSERT_LDFLAGS=if test $$osarch = "Darwin" ; then echo "-framework CoreFoundation -framework SystemConfiguration" ; fi ;
LOCAL_LDFLAGS +=-framework CoreFoundation -framework SystemConfiguration
endif
include $(BASE)/build/modmake.rules include $(BASE)/build/modmake.rules