diff --git a/build/modmake.rules.in b/build/modmake.rules.in index fe87d3321d..f164e1ed8f 100644 --- a/build/modmake.rules.in +++ b/build/modmake.rules.in @@ -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_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) ; +RECURSE_MAKE=modname="$(RECURSE_MODNAME)" ; \ + sourcefile="$(RECURSE_SOURCEFILE)" ; \ + osarch=`uname -s` ; \ + ourdefs="$(RECURSE_OUR_DEPS)" ; \ + ourcflags="$(RECURSE_OUR_CFLAGS)" ; \ + ourldflags="$(RECURSE_OUR_LDFLAGS)" ; \ + $(MAKE) MODNAME="$$modname" SOURCEFILE="$$sourcefile" OUR_DEPS="$$ourdefs" OUR_CFLAGS="$$ourcflags" OUR_LDFLAGS="$$ourldflags" all: Makefile - @$(RECURSE_CHECKS) \ - $(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags all-modules || exit 1;\ - fi + @$(RECURSE_MAKE) all-modules || exit 1 depend: Makefile - @$(RECURSE_CHECKS) \ - $(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags depend-modules || exit 1;\ - fi + @$(RECURSE_MAKE) depend-modules || exit 1 clean: Makefile - @$(RECURSE_CHECKS) \ - $(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags clean-modules || exit 1;\ - fi + @$(RECURSE_MAKE) clean-modules || exit 1 install: Makefile - @$(RECURSE_CHECKS) \ - $(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags install-modules || exit 1;\ - fi + @$(RECURSE_MAKE) install-modules || exit 1 uninstall: Makefile - @$(RECURSE_CHECKS) \ - $(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags uninstall-modules || exit 1;\ - fi + @$(RECURSE_MAKE) uninstall-modules || exit 1 distclean: Makefile - @$(RECURSE_CHECKS) \ - $(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags distclean-modules || exit 1;\ - fi + @$(RECURSE_MAKE) distclean-modules || exit 1 extraclean: Makefile - @$(RECURSE_CHECKS) \ - $(MAKE) MODNAME=$$modname SOURCEFILE=$$sourcefile OUR_DEPS=$$ourdefs OUR_CFLAGS=$$ourcflags OUR_LDFLAGS=$$our_ldflags extraclean-modules || exit 1;\ - fi - + @$(RECURSE_MAKE) extraclean-modules || exit 1 all-modules: local_depend local_all $(MODNAME).$(DYNAMIC_LIB_EXTEN) Makefile depend-modules: local_depend diff --git a/src/mod/asr_tts/mod_cepstral/Makefile b/src/mod/asr_tts/mod_cepstral/Makefile index c96e2b3996..3871e0e709 100644 --- a/src/mod/asr_tts/mod_cepstral/Makefile +++ b/src/mod/asr_tts/mod_cepstral/Makefile @@ -1,15 +1,6 @@ -# define these targets in your makefile if you wish -# 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_LDFLAGS=if test $$osarch = "Darwin" ; then echo "-framework swift" ; else echo "-L/opt/swift/lib -lswift -lceplex_us -lceplang_en -lm" ; fi ; +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 diff --git a/src/mod/endpoints/mod_portaudio/Makefile b/src/mod/endpoints/mod_portaudio/Makefile index d878c49ca1..18752c669e 100644 --- a/src/mod/endpoints/mod_portaudio/Makefile +++ b/src/mod/endpoints/mod_portaudio/Makefile @@ -1,14 +1,12 @@ BASE=../../../.. -OSARCH=$(shell uname -s) PA_DIR=$(BASE)/libs/portaudio PALA=$(PA_DIR)/lib/libportaudio.la LOCAL_CFLAGS=-I. -I$(PA_DIR)/include -LOCAL_LDFLAGS= -ifeq ($(OSARCH),Darwin) -LOCAL_LDFLAGS += -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -endif + +LOCAL_INSERT_LDFLAGS=if test $$osarch = "Darwin" ; then echo "-framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon" ; fi ; + LOCAL_LIBADD=$(PALA) LOCAL_OBJS=pablio.o pa_ringbuffer.o diff --git a/src/mod/endpoints/mod_sofia/Makefile b/src/mod/endpoints/mod_sofia/Makefile index 0c94dcbf6f..233d726a4f 100644 --- a/src/mod/endpoints/mod_sofia/Makefile +++ b/src/mod/endpoints/mod_sofia/Makefile @@ -1,7 +1,5 @@ BASE=../../../.. -OS_ARCH := $(subst /,_,$(shell uname -s | sed /\ /s//_/)) - SOFIA_DIR=$(BASE)/libs/sofia-sip SOFIAUA_DIR=$(SOFIA_DIR)/libsofia-sip-ua @@ -19,9 +17,7 @@ SOFIALA=$(SOFIAUA_DIR)/libsofia-sip-ua.la LOCAL_LIBADD=$(SOFIALA) -ifeq ($(OS_ARCH),Darwin) - LOCAL_LDFLAGS +=-framework CoreFoundation -framework SystemConfiguration -endif +LOCAL_INSERT_LDFLAGS=if test $$osarch = "Darwin" ; then echo "-framework CoreFoundation -framework SystemConfiguration" ; fi ; include $(BASE)/build/modmake.rules