From efbb87f805fcf4325060c9dbfd6c92c01537886b Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 23 Nov 2016 13:39:44 +0100 Subject: [PATCH] TT#6850 Fix build system * Make all the C++ code build again. Due to the build system not failing on compilation/link errors, parts of the code base has suffered bit rot. * Build the library as shared. Otherwise we are trying to link a static library built as PIE into a shared library. * Fix module exclusion logic. Several of the modules cannot be compiled because they miss Makefiles, others require additional dependencies or similar. So encode this in the build system so that people building do not have to figure this out, even if they pass an explicit list of modules to include or exclude. * Revamp the build system. - Make errors fatal, so that they do not get ignored anymore. - Use sane make variables that a shell will accept as valid, otherwise the exports do not work at all. - Do not use system paths when we should use in-tree ones. Change-Id: I795783e0f1bd655cdbb2de0329c389e2bb2e2f07 --- debian/patches/build-fix-bit-rot.patch | 125 ++ debian/patches/build-fix-excludes.patch | 68 + debian/patches/build-fix-pie.patch | 18 + debian/patches/build-system-revamp.patch | 1491 ++++++++++++++++++++++ debian/patches/series | 4 + debian/rules | 6 +- 6 files changed, 1709 insertions(+), 3 deletions(-) create mode 100644 debian/patches/build-fix-bit-rot.patch create mode 100644 debian/patches/build-fix-excludes.patch create mode 100644 debian/patches/build-fix-pie.patch create mode 100644 debian/patches/build-system-revamp.patch diff --git a/debian/patches/build-fix-bit-rot.patch b/debian/patches/build-fix-bit-rot.patch new file mode 100644 index 00000000..01c24393 --- /dev/null +++ b/debian/patches/build-fix-bit-rot.patch @@ -0,0 +1,125 @@ +Description: Make the code build again + Due to the build system not failing on compilation/link errors, parts of + the code base has suffered bit rot. +Author: Guillem Jover + +--- + +--- ngcp-sems-1.6.0.orig/apps/examples/b2b_connect/b2b_connect.cpp ++++ ngcp-sems-1.6.0/apps/examples/b2b_connect/b2b_connect.cpp +@@ -251,10 +251,11 @@ inline UACAuthCred* b2b_connectCalleeSes + return &credentials; + } + +-void b2b_connectCalleeSession::onSipReply(const AmSipReply& reply, ++void b2b_connectCalleeSession::onSipReply(const AmSipRequest& req, ++ const AmSipReply& reply, + AmSipDialog::Status old_dlg_status) { + +- AmB2ABCalleeSession::onSipReply(reply, old_dlg_status); ++ AmB2ABCalleeSession::onSipReply(req, reply, old_dlg_status); + + if ((old_dlg_status < AmSipDialog::Connected) && + (dlg->getStatus() == AmSipDialog::Disconnected)) { +--- ngcp-sems-1.6.0.orig/apps/examples/b2b_connect/b2b_connect.h ++++ ngcp-sems-1.6.0/apps/examples/b2b_connect/b2b_connect.h +@@ -84,7 +84,7 @@ class b2b_connectCalleeSession + AmSipRequest invite_req; + + protected: +- void onSipReply(const AmSipReply& reply, AmSipDialog::Status old_dlg_status); ++ void onSipReply(const AmSipRequest& req, const AmSipReply& reply, AmSipDialog::Status old_dlg_status); + + public: + b2b_connectCalleeSession(const string& other_tag, +--- ngcp-sems-1.6.0.orig/apps/examples/cacheannounce/CacheAnnounce.cpp ++++ ngcp-sems-1.6.0/apps/examples/cacheannounce/CacheAnnounce.cpp +@@ -120,7 +120,7 @@ void CacheAnnounceDialog::process(AmEven + + AmAudioEvent* audio_event = dynamic_cast(event); + if(audio_event && (audio_event->event_id == AmAudioEvent::cleared)){ +- dlg.bye(); ++ dlg->bye(); + setStopped(); + return; + } +--- ngcp-sems-1.6.0.orig/apps/examples/jukecall/Jukecall.cpp ++++ ngcp-sems-1.6.0/apps/examples/jukecall/Jukecall.cpp +@@ -128,10 +128,10 @@ void JukecallSession::process(AmEvent* e + switch(state) { + case JC_initial_announcement: { + state = JC_connect; +- string callee = "sip:" + dlg->user.substr(3) + "@" + dlg->domain; ++ string callee = "sip:" + dlg->getUser().substr(3) + "@" + dlg->getDomain(); + DBG("-------------------------- connecting %s ------------------------\n", callee.c_str()); + connectCallee(callee, callee, +- dlg->remote_party, dlg->remote_uri); ++ dlg->getRemoteParty(), dlg->getRemoteUri()); + + return; + +--- ngcp-sems-1.6.0.orig/apps/examples/pinauthconference/PinAuthConference.cpp ++++ ngcp-sems-1.6.0/apps/examples/pinauthconference/PinAuthConference.cpp +@@ -123,7 +123,7 @@ void PinAuthConferenceDialog::connectCon + changeCallgroup(conf_id); + + // get a channel from the status +- channel.reset(AmConferenceStatus::getChannel(conf_id,getLocalTag())); ++ channel.reset(AmConferenceStatus::getChannel(conf_id,getLocalTag(),RTPStream()->getSampleRate())); + + // clear the playlist + play_list.flush(); +--- ngcp-sems-1.6.0.orig/apps/examples/simple_conference/SimpleConference.cpp ++++ ngcp-sems-1.6.0/apps/examples/simple_conference/SimpleConference.cpp +@@ -66,13 +66,13 @@ SimpleConferenceDialog::SimpleConference + SimpleConferenceDialog::~SimpleConferenceDialog() + { + // clean playlist items +- play_list.close(false); ++ play_list.flush(); + } + + void SimpleConferenceDialog::onSessionStart() + { + // set the conference id ('conference room') to user part of ruri +- conf_id = dlg->user; ++ conf_id = dlg->getUser(); + + // open the beep file + BeepSound.reset(new AmAudioFile()); +@@ -81,7 +81,7 @@ void SimpleConferenceDialog::onSessionSt + } + + // get a channel from the status +- channel.reset(AmConferenceStatus::getChannel(conf_id,getLocalTag())); ++ channel.reset(AmConferenceStatus::getChannel(conf_id,getLocalTag(),RTPStream()->getSampleRate())); + + // add the channel to our playlist + play_list.addToPlaylist(new AmPlaylistItem(channel.get(), +@@ -100,7 +100,7 @@ void SimpleConferenceDialog::onSessionSt + + void SimpleConferenceDialog::onBye(const AmSipRequest& req) + { +- play_list.close(); ++ play_list.flush(); + setInOut(NULL,NULL); + channel.reset(NULL); + setStopped(); +--- ngcp-sems-1.6.0.orig/apps/examples/urlcatcher/UrlCatcher.cpp ++++ ngcp-sems-1.6.0/apps/examples/urlcatcher/UrlCatcher.cpp +@@ -63,8 +63,14 @@ int UrlCatcherFactory::onLoad() + AmSession* UrlCatcherFactory::onInvite(const AmSipRequest& req, const string& app_name, + const map& app_params) + { ++ const AmMimeBody* body = req.body.hasContentType(SIP_APPLICATION_SDP); ++ if (!body) { ++ ERROR("Missing MIME body\n"); ++ throw AmSession::Exception(404, "Not Found Here (Missing MIME body)"); ++ } ++ + AmSdp sdp; +- if (sdp.parse(req.body.c_str())) { ++ if (sdp.parse((const char *)body->getPayload())) { + ERROR("SDP parsing error\n"); + throw AmSession::Exception(404, "Not Found Here (SDP parse error)"); + } diff --git a/debian/patches/build-fix-excludes.patch b/debian/patches/build-fix-excludes.patch new file mode 100644 index 00000000..cf49644a --- /dev/null +++ b/debian/patches/build-fix-excludes.patch @@ -0,0 +1,68 @@ +Description: Fix module exclusion logic + Several of the modules cannot be compiled because they miss Makefiles, + others require additional dependencies or similar. So encode this in the + build system so that people building do not have to figure this out, even + if they pass an explicit list of modules to include or exclude. +Author: Guillem Jover + +--- + +--- ngcp-sems-1.6.0.orig/apps/Makefile ++++ ngcp-sems-1.6.0/apps/Makefile +@@ -1,7 +1,7 @@ + COREPATH ?= ../core + .DEFAULT_GOAL := all + +-local_exclude_app_modules=$(exclude_app_modules) ++local_exclude_app_modules=confpin early_dbprompt mobile_push py_sems gateway twit + + include $(COREPATH)/../Makefile.defs + +@@ -12,28 +12,22 @@ include $(COREPATH)/../Makefile.defs + # make $(app_modules) + # else + # if exclude_app_modules is set +-# make * - $(exclude_app_modules) ++# make * - $(exclude_app_modules) + local excludes + # else + # make * - Makefile.defs:exclude_app_modules + local excludes + # + +-ifneq ($(app_modules),) +- app_modules = $(app_modules) +-else +- ifneq ($(local_exclude_app_modules),) +- exclude_app_modules = $(local_exclude_app_modules) +- else +- exclude_app_modules += mp3 examples py_sems gateway jsonrpc twit db_reg_agent +- +- ifneq ($(USE_MONITORING), yes) +- exclude_app_modules += monitoring +- endif ++ifeq ($(app_modules),) ++ exclude_modules = $(exclude_app_modules) ++ exclude_modules += $(local_exclude_app_modules) + ++ ifneq ($(USE_MONITORING), yes) ++ exclude_modules += monitoring + endif + + $(info local_exclude_app_modules: $(local_exclude_app_modules)) + $(info exclude_app_modules: $(exclude_app_modules)) +- app_modules = $(filter-out $(subst ;, ,$(exclude_app_modules))\ ++ app_modules = $(filter-out $(subst ;, ,$(exclude_modules)) \ + $(wildcard Makefile*) CVS CMakeLists.txt, \ + $(wildcard *) examples/tutorial/cc_acc ) + +--- ngcp-sems-1.6.0.orig/apps/examples/Makefile ++++ ngcp-sems-1.6.0/apps/examples/Makefile +@@ -3,7 +3,7 @@ COREPATH ?= ../../core + + include $(COREPATH)/../Makefile.defs + +-exclude_modules ?= ++exclude_modules = ivr_examples + modules = $(filter-out $(subst ;, ,$(exclude_modules)) \ + $(wildcard Makefile*) $(wildcard Readme*) CVS, \ + $(wildcard *) ) + diff --git a/debian/patches/build-fix-pie.patch b/debian/patches/build-fix-pie.patch new file mode 100644 index 00000000..df5de055 --- /dev/null +++ b/debian/patches/build-fix-pie.patch @@ -0,0 +1,18 @@ +Description: Build the library as shared + Otherwise we are trying to link a static library built as PIE into a + shared library. +Author: Guillem Jover + +--- + +--- ngcp-sems-1.6.0.orig/apps/rtmp/librtmp/Makefile ++++ ngcp-sems-1.6.0/apps/rtmp/librtmp/Makefile +@@ -30,7 +30,7 @@ SO_posix=so.0 + SO_mingw=dll + SO_EXT=$(SO_$(SYS)) + +-SHARED=no ++SHARED=yes + SODEF_yes=-fPIC + SOLIB_yes=librtmp.$(SO_EXT) + SOINST_yes=install_$(SO_EXT) diff --git a/debian/patches/build-system-revamp.patch b/debian/patches/build-system-revamp.patch new file mode 100644 index 00000000..af52d561 --- /dev/null +++ b/debian/patches/build-system-revamp.patch @@ -0,0 +1,1491 @@ +Description: Revamp the build system + - Make errors fatal, so that they do not get ignored anymore. + - Use sane make variables that a shell will accept as valid, otherwise + the exports do not work at all. + - Do not use system paths when we should use in-tree ones. +Author: Guillem Jover + +--- + +--- + Makefile | 13 +-- + Makefile.defs | 124 +++++++++++++++--------------- + apps/Makefile | 16 ++- + apps/diameter_client/lib_dbase/Makefile | 2 + apps/dsm/Makefile | 6 - + apps/dsm/mods/Makefile | 16 ++- + apps/dsm/mods/Makefile.dsm_module | 53 ++++++------ + apps/examples/Makefile | 16 ++- + apps/examples/out_of_tree/Makefile | 4 + apps/examples/tutorial/Makefile | 16 ++- + apps/ivr/Makefile | 6 - + apps/ivr/Makefile.ivr_application | 34 ++++---- + apps/monitoring/Makefile | 2 + apps/monitoring/tools/Makefile | 9 +- + apps/msg_storage/Makefile | 2 + apps/py_sems/Makefile | 8 - + apps/py_sems/Makefile.defs | 2 + apps/py_sems/Makefile.py_sems_application | 17 ++-- + apps/rtmp/flash_phone/Makefile | 8 + + apps/rtmp/librtmp/Makefile | 2 + apps/sbc/Makefile | 8 - + apps/sbc/call_control/Makefile | 14 ++- + apps/sbc/tools/Makefile | 9 +- + apps/voicemail/Makefile | 12 +- + apps/webconference/Makefile | 2 + apps/webconference/tools/Makefile | 9 +- + core/Makefile | 72 ++++++++--------- + core/plug-in/Makefile | 16 ++- + core/plug-in/Makefile.app_module | 53 ++++++------ + core/plug-in/Makefile.audio_module | 6 - + core/plug-in/gsm/gsm-1.0-pl10/Makefile | 56 ++++++------- + core/plug-in/ilbc/iLBC_rfc3951/Makefile | 2 + core/plug-in/stats/Makefile | 6 - + core/resample/Makefile | 4 + core/sip/Makefile | 4 + core/tests/Makefile | 18 ++-- + pkg/rpm/sems.spec | 20 ++-- + tools/Makefile | 15 +-- + 38 files changed, 363 insertions(+), 319 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -12,8 +12,9 @@ subdirs = core apps tools + + .PHONY: clean + clean: +- -@rm -f *.so +- -@for r in $(subdirs) doc "" ; do \ ++ @rm -f *.so ++ @set -e; \ ++ for r in $(subdirs) doc "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "making $$r" ; \ +@@ -23,7 +24,8 @@ clean: + + .PHONY: modules + modules: +- -@for r in $(subdirs) "" ; do \ ++ @set -e; \ ++ for r in $(subdirs) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "making $$r" ; \ +@@ -33,7 +35,8 @@ modules: + + .PHONY: install + install: +- -@for r in $(subdirs) "" ; do \ ++ @set -e; \ ++ for r in $(subdirs) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +@@ -43,7 +46,7 @@ install: + @echo "" + @echo "*** install complete. Run SEMS with " + @echo "*** " +- @echo "*** $(bin-target)$(NAME) -f $(cfg-target)sems.conf" ++ @echo "*** $(bin_target)$(NAME) -f $(cfg_target)sems.conf" + + + .PHONY: dist +--- a/Makefile.defs ++++ b/Makefile.defs +@@ -261,55 +261,55 @@ BASEDIR ?= + basedir = $(BASEDIR) + + # Redhat users should use sems.redhat instead of sems +-# the file will be to $(bin-prefix)/$(bin-dir)/sems copied. +-start-script = sems.redhat ++# the file will be to $(bin_prefix)/$(bin_dir)/sems copied. ++start_script = sems.redhat + + # install prefixes for various stuff +-cfg-prefix = $(basedir)$(prefix) +-bin-prefix = $(basedir)$(prefix) +-modules-prefix = $(basedir)$(prefix) +-doc-prefix = $(basedir)$(prefix) +-audio-prefix = $(basedir)$(prefix) +-lib-prefix = $(basedir)$(prefix) ++cfg_prefix = $(basedir)$(prefix) ++bin_prefix = $(basedir)$(prefix) ++modules_prefix = $(basedir)$(prefix) ++doc_prefix = $(basedir)$(prefix) ++audio_prefix = $(basedir)$(prefix) ++lib_prefix = $(basedir)$(prefix) + + # dirs +-cfg-dir = etc/$(APP_NAME)/ ++cfg_dir = etc/$(APP_NAME)/ + +-bin-dir = sbin/ +-modules-dir = lib/$(APP_NAME)/plug-in/ +-audio-dir = lib/$(APP_NAME)/audio/ +-lib-dir = lib/$(APP_NAME)/ ++bin_dir = sbin/ ++modules_dir = lib/$(APP_NAME)/plug-in/ ++audio_dir = lib/$(APP_NAME)/audio/ ++lib_dir = lib/$(APP_NAME)/ + + ifeq ($(OS), linux) +- doc-dir = share/doc/$(APP_NAME)/ +- man-dir = share/man/ ++ doc_dir = share/doc/$(APP_NAME)/ ++ man_dir = share/man/ + else + ifeq ($(OS), freebsd) +- doc-dir = share/doc/$(APP_NAME)/ +- man-dir = man/ ++ doc_dir = share/doc/$(APP_NAME)/ ++ man_dir = man/ + else + ifeq ($(OS), openbsd) +- doc-dir = share/doc/$(APP_NAME)/ +- man-dir = man/ ++ doc_dir = share/doc/$(APP_NAME)/ ++ man_dir = man/ + else + ifeq ($(OS), netbsd) +- doc-dir = share/doc/$(APP_NAME) +- man-dir = man/ ++ doc_dir = share/doc/$(APP_NAME) ++ man_dir = man/ + else +- doc-dir = doc/$(APP_NAME)/ +- man-dir = man/ ++ doc_dir = doc/$(APP_NAME)/ ++ man_dir = man/ + endif + endif + endif + endif + + # target dirs for various stuff +-bin-target = $(prefix)/$(bin-dir) +-cfg-target ?= $(prefix)/$(cfg-dir) +-app-cfg-target = $(cfg-target)etc/ +-modules-target = $(prefix)/$(modules-dir) +-audio-target = $(prefix)/$(audio-dir) +-lib-target = $(prefix)/$(lib-dir) ++bin_target = $(prefix)/$(bin_dir) ++cfg_target ?= $(prefix)/$(cfg_dir) ++app_cfg_target = $(cfg_target)etc/ ++modules_target = $(prefix)/$(modules_dir) ++audio_target = $(prefix)/$(audio_dir) ++lib_target = $(prefix)/$(lib_dir) + + ifeq ($(OS), solaris) + #use GNU versions +@@ -320,24 +320,24 @@ INSTALL ?= install + TAR ?= tar + endif + +-INSTALL-TOUCH = touch # used to create the file first (good to ++INSTALL_TOUCH = touch # used to create the file first (good to + # make solaris install work) +-INSTALL-CFG = $(INSTALL) -m 644 +-INSTALL-BIN = $(INSTALL) -m 755 +-INSTALL-MODULES = $(INSTALL) -m 755 +-INSTALL-DOC = $(INSTALL) -m 644 +-INSTALL-AUDIO = $(INSTALL) -m 644 ++INSTALL_CFG = $(INSTALL) -m 644 ++INSTALL_BIN = $(INSTALL) -m 755 ++INSTALL_MODULES = $(INSTALL) -m 755 ++INSTALL_DOC = $(INSTALL) -m 644 ++INSTALL_AUDIO = $(INSTALL) -m 644 + + #export stuff to sub-makes + export REL_VERSION RELEASE OS ARCH + export CPPFLAGS CXXFLAGS LDFLAGS CFLAGS LIB_LDFLAGS + export CXX CC LD +-export DESTDIR PREFIX prefix basedir ser-prefix +-export start-script +-export cfg-prefix bin-prefix modules-prefix doc-prefix audio-prefix lib-prefix +-export cfg-dir bin-dir modules-dir audio-dir lib-dir doc-dir man-dir +-export bin-target cfg-target app-cfg-target modules-target audio-target lib-target +-export INSTALL TAR INSTALL-TOUCH INSTALL-CFG INSTALL-BIN INSTALL-MODULES INSTALL-DOC INSTALL-AUDIO ++export DESTDIR PREFIX prefix basedir ser_prefix ++export start_script ++export cfg_prefix bin_prefix modules_prefix doc_prefix audio_prefix lib_prefix ++export cfg_dir bin_dir modules_dir audio_dir lib_dir doc_dir man_dir ++export bin_target cfg_target app_cfg_target modules_target audio_target lib_target ++export INSTALL TAR INSTALL_TOUCH INSTALL_CFG INSTALL_BIN INSTALL_MODULES INSTALL_DOC INSTALL_AUDIO + export APP_NAME + + export USE_SPANDSP LIBSPANDSP_STATIC LIBSPANDSP_LDIR +@@ -347,27 +347,27 @@ export USE_MONITORING + export exclude_core_modules exclude_app_modules + endif # ifeq ($(makefile_defs, 1) + +-mk-install-dirs: $(DESTDIR)$(cfg-target) \ +- $(DESTDIR)$(app-cfg-target) \ +- $(DESTDIR)$(bin-prefix)/$(bin-dir) \ +- $(DESTDIR)$(modules-prefix)/$(modules-dir) \ +- $(DESTDIR)$(audio-prefix)/$(audio-dir) \ +- $(DESTDIR)$(doc-prefix)/$(doc-dir) +- +-$(DESTDIR)$(cfg-target): +- mkdir -p $(DESTDIR)$(cfg-target) +- +-$(DESTDIR)$(app-cfg-target): +- mkdir -p $(DESTDIR)$(app-cfg-target) +- +-$(DESTDIR)$(bin-prefix)/$(bin-dir): +- mkdir -p $(DESTDIR)$(bin-prefix)/$(bin-dir) ++mk-install-dirs: $(DESTDIR)$(cfg_target) \ ++ $(DESTDIR)$(app_cfg_target) \ ++ $(DESTDIR)$(bin_prefix)/$(bin_dir) \ ++ $(DESTDIR)$(modules_prefix)/$(modules_dir) \ ++ $(DESTDIR)$(audio_prefix)/$(audio_dir) \ ++ $(DESTDIR)$(doc_prefix)/$(doc_dir) ++ ++$(DESTDIR)$(cfg_target): ++ mkdir -p $(DESTDIR)$(cfg_target) ++ ++$(DESTDIR)$(app_cfg_target): ++ mkdir -p $(DESTDIR)$(app_cfg_target) ++ ++$(DESTDIR)$(bin_prefix)/$(bin_dir): ++ mkdir -p $(DESTDIR)$(bin_prefix)/$(bin_dir) + +-$(DESTDIR)$(modules-prefix)/$(modules-dir): +- mkdir -p $(DESTDIR)$(modules-prefix)/$(modules-dir) ++$(DESTDIR)$(modules_prefix)/$(modules_dir): ++ mkdir -p $(DESTDIR)$(modules_prefix)/$(modules_dir) + +-$(DESTDIR)$(audio-prefix)/$(audio-dir): +- mkdir -p $(DESTDIR)$(audio-prefix)/$(audio-dir) ++$(DESTDIR)$(audio_prefix)/$(audio_dir): ++ mkdir -p $(DESTDIR)$(audio_prefix)/$(audio_dir) + +-$(DESTDIR)$(doc-prefix)/$(doc-dir): +- mkdir -p $(DESTDIR)$(doc-prefix)/$(doc-dir) ++$(DESTDIR)$(doc_prefix)/$(doc_dir): ++ mkdir -p $(DESTDIR)$(doc_prefix)/$(doc_dir) +--- a/apps/Makefile ++++ b/apps/Makefile +@@ -41,8 +41,9 @@ all: modules + + .PHONY: clean + clean: +- -@rm -f *.so +- -@for r in $(app_modules) "" ; do \ ++ @rm -f *.so ++ @set -e; \ ++ for r in $(app_modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "Cleaning $$r" ; \ +@@ -53,7 +54,8 @@ clean: + + .PHONY: modules + modules: +- -@for r in $(app_modules) "" ; do \ ++ @set -e; \ ++ for r in $(app_modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "Making $$r" ; \ +@@ -67,7 +69,8 @@ install: install-bin + + .PHONY: install-bin + install-bin: +- -@for r in $(app_modules) "" ; do \ ++ @set -e; \ ++ for r in $(app_modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "Installing $$r binaries" ; \ +@@ -77,8 +80,9 @@ install-bin: + done + + .PHONY: install-cfg +-install-cfg: $(DESTDIR)$(cfg-target) +- -@for r in $(app_modules) "" ; do \ ++install-cfg: $(DESTDIR)$(cfg_target) ++ @set -e; \ ++ for r in $(app_modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "Installing $$r configuration" ; \ +--- a/apps/diameter_client/lib_dbase/Makefile ++++ b/apps/diameter_client/lib_dbase/Makefile +@@ -25,7 +25,7 @@ RANLIB = ranlib + + .PHONY: clean + clean: +- -@rm -f $(objs) $(depends) $(lib_name) ++ @rm -f $(objs) $(depends) $(lib_name) + + -include $(depends) + +--- a/apps/dsm/Makefile ++++ b/apps/dsm/Makefile +@@ -12,10 +12,10 @@ COREPATH ?=../../core + include $(COREPATH)/plug-in/Makefile.app_module + + make_dsm_mods: +- -@$(MAKE) -C mods ++ @$(MAKE) -C mods + + install_dsm_mods: +- -@$(MAKE) -C mods/ install ++ @$(MAKE) -C mods/ install + + clean_dsm_mods: +- -@$(MAKE) -C mods/ clean ++ @$(MAKE) -C mods/ clean +--- a/apps/dsm/mods/Makefile ++++ b/apps/dsm/mods/Makefile +@@ -25,8 +25,9 @@ all: modules + + .PHONY: clean + clean: +- -@rm -f lib/*.so +- -@for r in $(dsm_modules) "" ; do \ ++ @rm -f lib/*.so ++ @set -e; \ ++ for r in $(dsm_modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +@@ -36,7 +37,8 @@ clean: + + .PHONY: modules + modules: +- -@for r in $(dsm_modules) "" ; do \ ++ @set -e; \ ++ for r in $(dsm_modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +@@ -49,7 +51,8 @@ install: install-bin + + .PHONY: install-bin + install-bin: +- -@for r in $(dsm_modules) "" ; do \ ++ @set -e; \ ++ for r in $(dsm_modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +@@ -58,8 +61,9 @@ install-bin: + done + + .PHONY: install-cfg +-install-cfg: $(DESTDIR)$(cfg-target) +- -@for r in $(dsm_modules) "" ; do \ ++install-cfg: $(DESTDIR)$(cfg_target) ++ @set -e; \ ++ for r in $(dsm_modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +--- a/apps/dsm/mods/Makefile.dsm_module ++++ b/apps/dsm/mods/Makefile.dsm_module +@@ -33,51 +33,54 @@ module_package: $(extra_target) $(lib_na + + .PHONY: clean + clean: $(extra_clean) +- -@rm -f $(objs) $(depends) $(lib_name) ++ @rm -f $(objs) $(depends) $(lib_name) + + .PHONY: install + install: all $(extra_install) +- mkdir -p $(DESTDIR)$(lib-prefix)/$(lib-dir)/dsm ++ mkdir -p $(DESTDIR)$(lib_prefix)/$(lib_dir)/dsm + if [ -f "$(lib_name)" ]; then \ +- $(INSTALL-TOUCH) $(DESTDIR)$(lib-prefix)/$(lib-dir)/dsm/; \ +- $(INSTALL-MODULES) $(lib_name) $(DESTDIR)$(lib-prefix)/$(lib-dir)/dsm/; \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(lib_prefix)/$(lib_dir)/dsm/; \ ++ $(INSTALL_MODULES) $(lib_name) $(DESTDIR)$(lib_prefix)/$(lib_dir)/dsm/; \ + fi + + .PHONY: install-cfg + install-cfg: +- mkdir -p $(DESTDIR)$(cfg-target) +- -@for r in $(module_conf_files); do \ ++ mkdir -p $(DESTDIR)$(cfg_target) ++ @set -e; \ ++ for r in $(module_conf_files); do \ + echo installing $$r ; \ +- $(INSTALL-TOUCH) $(DESTDIR)$(cfg-target)$$r ; \ +- sed -e "s#/usr/.*lib/sems/audio/#$(audio-target)#g" \ +- -e "s#/usr/.*lib/sems/plug-in/#$(modules-target)#g" \ +- -e "s#/usr/.*lib/sems/ivr/#$(lib-target)ivr/#g" \ +- -e "s#/usr/.*lib/sems/dsm/#$(lib-target)dsm/#g" \ +- -e "s#/usr/.*lib/sems/py_sems/#$(lib-target)py_sems/#g" \ +- -e "s#/usr/.*etc/sems/#$(cfg-target)#g" \ +- < $$r > $(DESTDIR)$(cfg-target)$$r; \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(cfg_target)$$r ; \ ++ sed -e "s#/usr/.*lib/sems/audio/#$(audio_target)#g" \ ++ -e "s#/usr/.*lib/sems/plug-in/#$(modules_target)#g" \ ++ -e "s#/usr/.*lib/sems/ivr/#$(lib_target)ivr/#g" \ ++ -e "s#/usr/.*lib/sems/dsm/#$(lib_target)dsm/#g" \ ++ -e "s#/usr/.*lib/sems/py_sems/#$(lib_target)py_sems/#g" \ ++ -e "s#/usr/.*etc/sems/#$(cfg_target)#g" \ ++ < $$r > $(DESTDIR)$(cfg_target)$$r; \ + done + +-$(DESTDIR)(audio-prefix)/$(audio-dir): +- mkdir -p $(DESTDIR)$(audio-prefix)/$(audio-dir) ++$(DESTDIR)$(audio_prefix)/$(audio_dir): ++ mkdir -p $(DESTDIR)$(audio_prefix)/$(audio_dir) + + .PHONY: $(plug_in_name)_audio +-$(plug_in_name)_audio: $(DESTDIR)$(audio-prefix)/$(audio-dir) +- mkdir -p $(DESTDIR)$(audio-prefix)/$(audio-dir)$(plug_in_name) +- -@for f in $(AUDIO_FILES) ; do \ ++$(plug_in_name)_audio: $(DESTDIR)$(audio_prefix)/$(audio_dir) ++ mkdir -p $(DESTDIR)$(audio_prefix)/$(audio_dir)$(plug_in_name) ++ @set -e; \ ++ for f in $(AUDIO_FILES) ; do \ + if [ -n "wav/$$f" ]; then \ +- $(INSTALL-TOUCH) $(DESTDIR)$(audio-prefix)/$(audio-dir)$(plug_in_name)/$$f; \ +- $(INSTALL-AUDIO) wav/$$f $(DESTDIR)$(audio-prefix)/$(audio-dir)$(plug_in_name)/$$f; \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(audio_prefix)/$(audio_dir)$(plug_in_name)/$$f; \ ++ $(INSTALL_AUDIO) wav/$$f $(DESTDIR)$(audio_prefix)/$(audio_dir)$(plug_in_name)/$$f; \ + fi ; \ + done + + .PHONY: $(plug_in_name)_lib + $(plug_in_name)_lib: +- mkdir -p $(DESTDIR)$(lib-prefix)/$(lib-dir)/$(plug_in_name) +- -@for f in $(EXTRA_LIB_FILES) ; do \ ++ mkdir -p $(DESTDIR)$(lib_prefix)/$(lib_dir)/$(plug_in_name) ++ @set -e; \ ++ for f in $(EXTRA_LIB_FILES) ; do \ + if [ -n "$(EXTRA_LIB_DIR)/$$f" ]; then \ +- $(INSTALL-TOUCH) $(DESTDIR)$(lib-prefix)/$(lib-dir)/$(plug_in_name)/$$f; \ +- $(INSTALL-AUDIO) $(EXTRA_LIB_DIR)$$f $(DESTDIR)$(lib-prefix)/$(lib-dir)/$(plug_in_name)/$$f; \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(lib_prefix)/$(lib_dir)/$(plug_in_name)/$$f; \ ++ $(INSTALL_AUDIO) $(EXTRA_LIB_DIR)$$f $(DESTDIR)$(lib_prefix)/$(lib_dir)/$(plug_in_name)/$$f; \ + fi ; \ + done + +--- a/apps/examples/Makefile ++++ b/apps/examples/Makefile +@@ -13,8 +13,9 @@ all: modules + + .PHONY: clean + clean: +- -@rm -f *.so +- -@for r in $(modules) "" ; do \ ++ @rm -f *.so ++ @set -e; \ ++ for r in $(modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +@@ -24,7 +25,8 @@ clean: + + .PHONY: modules + modules: +- -@for r in $(modules) "" ; do \ ++ @set -e; \ ++ for r in $(modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +@@ -37,7 +39,8 @@ install: install-bin + + .PHONY: install-bin + install-bin: +- -@for r in $(modules) "" ; do \ ++ @set -e; \ ++ for r in $(modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +@@ -46,8 +49,9 @@ install-bin: + done + + .PHONY: install-cfg +-install-cfg: $(DESTDIR)$(cfg-target) +- -@for r in $(modules) "" ; do \ ++install-cfg: $(DESTDIR)$(cfg_target) ++ @set -e; \ ++ for r in $(modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +--- a/apps/examples/out_of_tree/Makefile ++++ b/apps/examples/out_of_tree/Makefile +@@ -3,8 +3,8 @@ plug_in_name = myapp + module_ldflags = + module_cflags = + +-COREPATH ?=/usr/include/sems +-DEFSPATH ?=/usr/include/sems ++COREPATH ?=$(CURDIR)/../../../core ++DEFSPATH ?=$(COREPATH)/.. + app_module_dir=. + + include $(COREPATH)/plug-in/Makefile.app_module +--- a/apps/examples/tutorial/Makefile ++++ b/apps/examples/tutorial/Makefile +@@ -13,8 +13,9 @@ all: modules + + .PHONY: clean + clean: +- -@rm -f *.so +- -@for r in $(modules) "" ; do \ ++ @rm -f *.so ++ @set -e; \ ++ for r in $(modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +@@ -24,7 +25,8 @@ clean: + + .PHONY: modules + modules: +- -@for r in $(modules) "" ; do \ ++ @set -e; \ ++ for r in $(modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +@@ -37,7 +39,8 @@ install: install-bin + + .PHONY: install-bin + install-bin: +- -@for r in $(modules) "" ; do \ ++ @set -e; \ ++ for r in $(modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +@@ -46,8 +49,9 @@ install-bin: + done + + .PHONY: install-cfg +-install-cfg: $(DESTDIR)$(cfg-target) +- -@for r in $(modules) "" ; do \ ++install-cfg: $(DESTDIR)$(cfg_target) ++ @set -e; \ ++ for r in $(modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +--- a/apps/ivr/Makefile ++++ b/apps/ivr/Makefile +@@ -91,12 +91,12 @@ endif + endif + + .PHONY: install_python_files +-install_python_files: $(DESTDIR)$(modules-prefix)/$(modules-dir) ++install_python_files: $(DESTDIR)$(modules_prefix)/$(modules_dir) + echo "Installing Python object files..." + for f in $(py_obj) ; do \ + if [ -n "py/$$f" ]; then \ +- $(INSTALL-TOUCH) $(DESTDIR)$(modules-prefix)/$(modules-dir)/$$f; \ +- $(INSTALL-MODULES) py/$$f $(DESTDIR)$(modules-prefix)/$(modules-dir)/$$f; \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(modules_prefix)/$(modules_dir)/$$f; \ ++ $(INSTALL_MODULES) py/$$f $(DESTDIR)$(modules_prefix)/$(modules_dir)/$$f; \ + fi ; \ + done + +--- a/apps/ivr/Makefile.ivr_application ++++ b/apps/ivr/Makefile.ivr_application +@@ -10,9 +10,9 @@ include $(COREPATH)/../Makefile.defs + include $(IVRPATH)/Makefile.defs + + # +-ivr-modules-dir?=lib/$(APP_NAME)/ivr ++ivr_modules_dir?=lib/$(APP_NAME)/ivr + +-LIB_INSTALLDIR?=$(modules-prefix)/$(ivr-modules-dir) ++LIB_INSTALLDIR?=$(modules_prefix)/$(ivr_modules_dir) + TARBALL_PREFIX=sems-app-${NAME} + TARBALL="${TARBALL_PREFIX}-${VERSION}.tar.gz" + +@@ -50,26 +50,28 @@ endif + + .PHONY: install-cfg + install-cfg: +- mkdir -p $(DESTDIR)$(app-cfg-target) +- -@for r in $(module_conf_files); do \ ++ mkdir -p $(DESTDIR)$(app_cfg_target) ++ @set -e; \ ++ for r in $(module_conf_files); do \ + echo installing $$r ; \ +- $(INSTALL-TOUCH) $(DESTDIR)$(app-cfg-target)$$r ; \ +- sed -e "s#/usr/.*lib/sems/audio/#$(audio-target)#g" \ +- -e "s#/usr/.*lib/sems/plug-in/#$(modules-target)#g" \ +- -e "s#/usr/.*etc/sems/#$(app-cfg-target)#g" \ +- < etc/$$r > $(DESTDIR)$(app-cfg-target)$$r; \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(app_cfg_target)$$r ; \ ++ sed -e "s#/usr/.*lib/sems/audio/#$(audio_target)#g" \ ++ -e "s#/usr/.*lib/sems/plug-in/#$(modules_target)#g" \ ++ -e "s#/usr/.*etc/sems/#$(app_cfg_target)#g" \ ++ < etc/$$r > $(DESTDIR)$(app_cfg_target)$$r; \ + done + +-$(DESTDIR)(audio-prefix)/$(audio-dir): +- mkdir -p $(DESTDIR)$(audio-prefix)/$(audio-dir) ++$(DESTDIR)$(audio_prefix)/$(audio_dir): ++ mkdir -p $(DESTDIR)$(audio_prefix)/$(audio_dir) + + .PHONY: $(NAME)_audio +-$(NAME)_audio: $(DESTDIR)$(audio-prefix)/$(audio-dir) +- mkdir -p $(DESTDIR)$(audio-prefix)/$(audio-dir)$(NAME) +- -@for f in $(AUDIO_FILES) ; do \ ++$(NAME)_audio: $(DESTDIR)$(audio_prefix)/$(audio_dir) ++ mkdir -p $(DESTDIR)$(audio_prefix)/$(audio_dir)$(NAME) ++ @set -e; \ ++ for f in $(AUDIO_FILES) ; do \ + if [ -n "wav/$$f" ]; then \ +- $(INSTALL-TOUCH) $(DESTDIR)$(audio-prefix)/$(audio-dir)$(NAME)/$$f; \ +- $(INSTALL-AUDIO) wav/$$f $(DESTDIR)$(audio-prefix)/$(audio-dir)$(NAME)/$$f; \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(audio_prefix)/$(audio_dir)$(NAME)/$$f; \ ++ $(INSTALL_AUDIO) wav/$$f $(DESTDIR)$(audio_prefix)/$(audio_dir)$(NAME)/$$f; \ + fi ; \ + done + +--- a/apps/monitoring/Makefile ++++ b/apps/monitoring/Makefile +@@ -9,4 +9,4 @@ COREPATH ?=../../core + include $(COREPATH)/plug-in/Makefile.app_module + + install_tools: +- -@$(MAKE) -C tools/ install ++ @$(MAKE) -C tools/ install +--- a/apps/monitoring/tools/Makefile ++++ b/apps/monitoring/tools/Makefile +@@ -6,12 +6,13 @@ monitoring_scripts = $(wildcard sems-*) + all: install_tools + install: install_tools + +-install_tools: $(DESTDIR)$(bin-prefix)/$(bin-dir) +- -@for r in $(monitoring_scripts) ; do \ ++install_tools: $(DESTDIR)$(bin_prefix)/$(bin_dir) ++ @set -e; \ ++ for r in $(monitoring_scripts) ; do \ + x=`echo $$r | sed s/sems-/$(APP_NAME)-/g` ; \ + echo "installing $$r -> $$x" ; \ +- $(INSTALL-TOUCH) $(DESTDIR)$(bin-prefix)/$(bin-dir)/$$x ; \ +- $(INSTALL-BIN) $$r $(DESTDIR)$(bin-prefix)/$(bin-dir)/$$x ; \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(bin_prefix)/$(bin_dir)/$$x ; \ ++ $(INSTALL_BIN) $$r $(DESTDIR)$(bin_prefix)/$(bin_dir)/$$x ; \ + done + + +--- a/apps/msg_storage/Makefile ++++ b/apps/msg_storage/Makefile +@@ -9,4 +9,4 @@ COREPATH ?=../../core + include $(COREPATH)/plug-in/Makefile.app_module + + spooldir: +- -mkdir -p $(DESTDIR)/var/spool/voicebox ++ mkdir -p $(DESTDIR)/var/spool/voicebox +--- a/apps/py_sems/Makefile ++++ b/apps/py_sems/Makefile +@@ -85,17 +85,17 @@ endif + endif + + .PHONY: install_python_files +-install_python_files: $(DESTDIR)$(modules-prefix)/$(modules-dir) ++install_python_files: $(DESTDIR)$(modules_prefix)/$(modules_dir) + echo "Installing Python object files..." + for f in $(py_obj) ; do \ + if [ -n "py/$$f" ]; then \ +- $(INSTALL-TOUCH) $(DESTDIR)$(modules-prefix)/$(modules-dir)/$$f; \ +- $(INSTALL-MODULES) py/$$f $(DESTDIR)$(modules-prefix)/$(modules-dir)/$$f; \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(modules_prefix)/$(modules_dir)/$$f; \ ++ $(INSTALL_MODULES) py/$$f $(DESTDIR)$(modules_prefix)/$(modules_dir)/$$f; \ + fi ; \ + done + + echo "Installing py_sems script path..." +- $(INSTALL-MODULES) -d $(DESTDIR)$(modules-prefix)/$(py-sems-modules-dir) ++ $(INSTALL_MODULES) -d $(DESTDIR)$(modules_prefix)/$(py_sems_modules_dir) + + .PHONY: clean_py_sems_lib + clean_py_sems_lib: +--- a/apps/py_sems/Makefile.defs ++++ b/apps/py_sems/Makefile.defs +@@ -15,4 +15,4 @@ PYTHON_DIR = $(shell $(PY_EXE) ./python_ + PYTHON_LIBDIR = $(shell $(PY_EXE) ./python_lib.py) + + # +-py-sems-modules-dir?=lib/$(APP_NAME)/py_sems ++py_sems_modules_dir?=lib/$(APP_NAME)/py_sems +--- a/apps/py_sems/Makefile.py_sems_application ++++ b/apps/py_sems/Makefile.py_sems_application +@@ -7,7 +7,7 @@ PYSEMSPATH ?= ../py_sems + include $(COREPATH)/../Makefile.defs + include $(PYSEMSPATH)/Makefile.defs + +-LIB_INSTALLDIR?=$(modules-prefix)/$(py-sems-modules-dir) ++LIB_INSTALLDIR?=$(modules_prefix)/$(py_sems_modules_dir) + TARBALL_PREFIX=sems-app-${NAME} + TARBALL="${TARBALL_PREFIX}-${VERSION}.tar.gz" + +@@ -42,14 +42,15 @@ install: all + + .PHONY: install-cfg + install-cfg: +- mkdir -p $(cfg-target) +- -@for r in $(module_conf_files); do \ ++ mkdir -p $(cfg_target) ++ @set -e; \ ++ for r in $(module_conf_files); do \ + echo installing $$r ; \ +- $(INSTALL-TOUCH) $(cfg-target)$$r ; \ +- sed -e "s#/usr/.*lib/sems/audio/#$(audio-target)#g" \ +- -e "s#/usr/.*lib/sems/plug-in/#$(modules-target)#g" \ +- -e "s#/usr/.*etc/sems/#$(cfg-target)#g" \ +- < etc/$$r > $(DESTDIR)$(cfg-target)$$r; \ ++ $(INSTALL_TOUCH) $(cfg_target)$$r ; \ ++ sed -e "s#/usr/.*lib/sems/audio/#$(audio_target)#g" \ ++ -e "s#/usr/.*lib/sems/plug-in/#$(modules_target)#g" \ ++ -e "s#/usr/.*etc/sems/#$(cfg_target)#g" \ ++ < etc/$$r > $(DESTDIR)$(cfg_target)$$r; \ + done + + +--- a/apps/rtmp/flash_phone/Makefile ++++ b/apps/rtmp/flash_phone/Makefile +@@ -21,10 +21,14 @@ MXMLC_OPTS= \ + APP=sono + SOURCES= $(APP).mxml $(wildcard *.as) + +-all: $(APP).swf ++ifneq ($(wildcard $(FLEX_SDK)),) ++TARGET=$(APP).swf ++endif ++ ++all: $(TARGET) + + clean: +- rm *.swf ++ rm -f *.swf + + %.swf: $(SOURCES) Makefile + $(MXMLC) $(MXMLC_OPTS) $< +--- a/apps/rtmp/librtmp/Makefile ++++ b/apps/rtmp/librtmp/Makefile +@@ -78,7 +78,7 @@ librtmp.pc: librtmp.pc.in Makefile + install: install_base $(SO_INST) + + install_base: librtmp.a librtmp.pc +- -mkdir -p $(INCDIR) $(LIBDIR)/pkgconfig $(MANDIR)/man3 ++ mkdir -p $(INCDIR) $(LIBDIR)/pkgconfig $(MANDIR)/man3 + cp amf.h http.h log.h rtmp.h $(INCDIR) + cp librtmp.a $(LIBDIR) + cp librtmp.pc $(LIBDIR)/pkgconfig +--- a/apps/sbc/Makefile ++++ b/apps/sbc/Makefile +@@ -11,15 +11,15 @@ COREPATH ?= ../../core + include $(COREPATH)/plug-in/Makefile.app_module + + install_tools: +- -@$(MAKE) -C tools/ install ++ @$(MAKE) -C tools/ install + + make_call_control_mods: +- -@$(MAKE) -C call_control ++ @$(MAKE) -C call_control + + install_call_control_mods: +- -@$(MAKE) -C call_control/ install ++ @$(MAKE) -C call_control/ install + + clean_call_control_mods: +- -@$(MAKE) -C call_control/ clean ++ @$(MAKE) -C call_control/ clean + + +--- a/apps/sbc/call_control/Makefile ++++ b/apps/sbc/call_control/Makefile +@@ -16,7 +16,8 @@ all: modules + + .PHONY: clean + clean: +- -@for r in $(cc_modules) "" ; do \ ++ @set -e; \ ++ for r in $(cc_modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +@@ -26,7 +27,8 @@ clean: + + .PHONY: modules + modules: +- -@for r in $(cc_modules) "" ; do \ ++ @set -e; \ ++ for r in $(cc_modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +@@ -39,7 +41,8 @@ install: install-bin install-cfg + + .PHONY: install-bin + install-bin: +- -@for r in $(cc_modules) "" ; do \ ++ @set -e; \ ++ for r in $(cc_modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +@@ -48,8 +51,9 @@ install-bin: + done + + .PHONY: install-cfg +-install-cfg: $(DESTDIR)$(cfg-target) +- -@for r in $(dsm_modules) "" ; do \ ++install-cfg: $(DESTDIR)$(cfg_target) ++ @set -e; \ ++ for r in $(dsm_modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +--- a/apps/sbc/tools/Makefile ++++ b/apps/sbc/tools/Makefile +@@ -8,12 +8,13 @@ sbc_scripts = $(wildcard sems-sbc-*) + all: install_tools + install: install_tools + +-install_tools: $(DESTDIR)$(bin-prefix)/$(bin-dir) +- -@for r in $(sbc_scripts) ; do \ ++install_tools: $(DESTDIR)$(bin_prefix)/$(bin_dir) ++ @set -e; \ ++ for r in $(sbc_scripts) ; do \ + x=`echo $$r | sed s/sems-/$(APP_NAME)-/g` ; \ + echo "installing $$r -> $$x" ; \ +- $(INSTALL-TOUCH) $(DESTDIR)$(bin-prefix)/$(bin-dir)/$$x ; \ +- $(INSTALL-BIN) $$r $(DESTDIR)$(bin-prefix)/$(bin-dir)/$$x ; \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(bin_prefix)/$(bin_dir)/$$x ; \ ++ $(INSTALL_BIN) $$r $(DESTDIR)$(bin_prefix)/$(bin_dir)/$$x ; \ + done + + +--- a/apps/voicemail/Makefile ++++ b/apps/voicemail/Makefile +@@ -21,12 +21,12 @@ extra_install = install_email_template $ + vm_module: all + + .PHONY: install_email_template +-install_email_template: $(DESTDIR)$(app-cfg-target) +- $(INSTALL-TOUCH) $(DESTDIR)$(app-cfg-target)default.template.sample +- $(INSTALL-CFG) default.template.sample $(DESTDIR)$(app-cfg-target) +- if [ ! -f $(DESTDIR)$(app-cfg-target)default.template ]; then \ +- cp -f $(DESTDIR)$(app-cfg-target)default.template.sample \ +- $(DESTDIR)$(app-cfg-target)default.template; \ ++install_email_template: $(DESTDIR)$(app_cfg_target) ++ $(INSTALL_TOUCH) $(DESTDIR)$(app_cfg_target)default.template.sample ++ $(INSTALL_CFG) default.template.sample $(DESTDIR)$(app_cfg_target) ++ if [ ! -f $(DESTDIR)$(app_cfg_target)default.template ]; then \ ++ cp -f $(DESTDIR)$(app_cfg_target)default.template.sample \ ++ $(DESTDIR)$(app_cfg_target)default.template; \ + fi + + +--- a/apps/webconference/Makefile ++++ b/apps/webconference/Makefile +@@ -9,4 +9,4 @@ COREPATH ?=../../core + include $(COREPATH)/plug-in/Makefile.app_module + + install_tools: +- -@$(MAKE) -C tools/ install ++ @$(MAKE) -C tools/ install +--- a/apps/webconference/tools/Makefile ++++ b/apps/webconference/tools/Makefile +@@ -7,12 +7,13 @@ wc_scripts = $(wildcard sems-webconferen + all: install_tools + install: install_tools + +-install_tools: $(DESTDIR)$(bin-prefix)/$(bin-dir) +- -@for r in $(wc_scripts) ; do \ ++install_tools: $(DESTDIR)$(bin_prefix)/$(bin_dir) ++ @set -e; \ ++ for r in $(wc_scripts) ; do \ + x=`echo $$r | sed s/sems-/$(APP_NAME)-/g` ; \ + echo "installing $$r -> $$x" ; \ +- $(INSTALL-TOUCH) $(DESTDIR)$(bin-prefix)/$(bin-dir)/$$x ; \ +- $(INSTALL-BIN) $$r $(DESTDIR)$(bin-prefix)/$(bin-dir)/$$x ; \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(bin_prefix)/$(bin_dir)/$$x ; \ ++ $(INSTALL_BIN) $$r $(DESTDIR)$(bin_prefix)/$(bin_dir)/$$x ; \ + done + + +--- a/core/Makefile ++++ b/core/Makefile +@@ -20,29 +20,29 @@ all: ../Makefile.defs $(NAME) modules + + .PHONY: clean + clean: +- -@rm -f $(OBJS) $(DEPS) $(NAME) +- -@rm -f lib/*.so compat/getos compat/getarch +- -@$(MAKE) -C $(SIP_STACK_DIR) clean +- -@$(MAKE) -C $(RESAMPLE_DIR) clean +- -@$(MAKE) -C $(PLUGIN_DIR) clean ++ @rm -f $(OBJS) $(DEPS) $(NAME) ++ @rm -f lib/*.so compat/getos compat/getarch ++ @$(MAKE) -C $(SIP_STACK_DIR) clean ++ @$(MAKE) -C $(RESAMPLE_DIR) clean ++ @$(MAKE) -C $(PLUGIN_DIR) clean + + .PHONY: sip_stack + sip_stack: +- -@echo "" +- -@echo "making SIP stack" +- -@cd $(SIP_STACK_DIR); $(MAKE) all ++ @echo "" ++ @echo "making SIP stack" ++ @cd $(SIP_STACK_DIR); $(MAKE) all + + .PHONY: modules + modules: +- -@echo "" +- -@echo "making core modules" +- -@cd $(PLUGIN_DIR); $(MAKE) modules ++ @echo "" ++ @echo "making core modules" ++ @cd $(PLUGIN_DIR); $(MAKE) modules + + .PHONY: test + test: +- -@echo "" +- -@echo "making tests" +- -@cd $(TEST_DIR); $(MAKE) ++ @echo "" ++ @echo "making tests" ++ @cd $(TEST_DIR); $(MAKE) + + .PHONY: core + core: $(OBJS) ../Makefile.defs +@@ -78,9 +78,9 @@ OBJS += $(RESAMPLE_DIR)/libresample.a + + .PHONY: resample_lib + resample_lib: +- -@echo "" +- -@echo "making internal resampler" +- -@cd $(RESAMPLE_DIR); $(MAKE) all ++ @echo "" ++ @echo "making internal resampler" ++ @cd $(RESAMPLE_DIR); $(MAKE) all + + else + +@@ -110,8 +110,8 @@ endif + $(CXX) -MMD -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS) + + $(NAME): sip_stack resample_lib core ../Makefile.defs +- -@echo "" +- -@echo "making $(NAME) executable" ++ @echo "" ++ @echo "making $(NAME) executable" + $(LD) -o $(NAME) $(OBJS) $(LDFLAGS) $(EXTRA_LDFLAGS) + + +@@ -122,34 +122,34 @@ install: all mk-install-dirs \ + + + # note: on solaris 8 sed: ? or \(...\)* (a.s.o) do not work +-install-cfg: $(DESTDIR)$(cfg-target) $(DESTDIR)$(app-cfg-target) +- sed -e "s#/usr/.*lib/sems/audio/#$(audio-target)#g" \ +- -e "s#/usr/.*lib/sems/plug-in/#$(modules-target)#g" \ +- -e "s#/usr/.*etc/sems/#$(cfg-target)#g" \ +- < etc/sems.conf.sample > $(DESTDIR)$(cfg-target)sems.conf.default +- chmod 644 $(DESTDIR)$(cfg-target)sems.conf.default +- if [ ! -f $(DESTDIR)$(cfg-target)sems.conf ]; then \ +- cp -f $(DESTDIR)$(cfg-target)sems.conf.default \ +- $(DESTDIR)$(cfg-target)sems.conf; \ ++install-cfg: $(DESTDIR)$(cfg_target) $(DESTDIR)$(app_cfg_target) ++ sed -e "s#/usr/.*lib/sems/audio/#$(audio_target)#g" \ ++ -e "s#/usr/.*lib/sems/plug-in/#$(modules_target)#g" \ ++ -e "s#/usr/.*etc/sems/#$(cfg_target)#g" \ ++ < etc/sems.conf.sample > $(DESTDIR)$(cfg_target)sems.conf.default ++ chmod 644 $(DESTDIR)$(cfg_target)sems.conf.default ++ if [ ! -f $(DESTDIR)$(cfg_target)sems.conf ]; then \ ++ cp -f $(DESTDIR)$(cfg_target)sems.conf.default \ ++ $(DESTDIR)$(cfg_target)sems.conf; \ + fi + +- $(INSTALL-CFG) etc/app_mapping.conf.sample $(DESTDIR)$(app-cfg-target)app_mapping.conf ++ $(INSTALL_CFG) etc/app_mapping.conf.sample $(DESTDIR)$(app_cfg_target)app_mapping.conf + +-install-bin: $(DESTDIR)$(bin-prefix)/$(bin-dir) +- $(INSTALL-TOUCH) $(DESTDIR)$(bin-prefix)/$(bin-dir)$(NAME) +- $(INSTALL-BIN) $(NAME) $(DESTDIR)$(bin-prefix)/$(bin-dir) ++install-bin: $(DESTDIR)$(bin_prefix)/$(bin_dir) ++ $(INSTALL_TOUCH) $(DESTDIR)$(bin_prefix)/$(bin_dir)$(NAME) ++ $(INSTALL_BIN) $(NAME) $(DESTDIR)$(bin_prefix)/$(bin_dir) + +-install-modules: $(PLUGIN_DIR) $(DESTDIR)$(modules-prefix)/$(modules-dir) ++install-modules: $(PLUGIN_DIR) $(DESTDIR)$(modules_prefix)/$(modules_dir) + $(MAKE) -C $(PLUGIN_DIR) install + + install-modules-cfg: $(PLUGIN_DIR) + $(MAKE) -C $(PLUGIN_DIR) install-cfg + +-install-audio: $(DESTDIR)$(audio-prefix)/$(audio-dir) ++install-audio: $(DESTDIR)$(audio_prefix)/$(audio_dir) + for f in $(AUDIO_FILES) ; do \ + if [ -n "wav/$$f" ]; then \ +- $(INSTALL-TOUCH) $(DESTDIR)$(audio-prefix)/$(audio-dir)$$f; \ +- $(INSTALL-AUDIO) wav/$$f $(DESTDIR)$(audio-prefix)/$(audio-dir)$$f; \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(audio_prefix)/$(audio_dir)$$f; \ ++ $(INSTALL_AUDIO) wav/$$f $(DESTDIR)$(audio_prefix)/$(audio_dir)$$f; \ + fi ; \ + done + +--- a/core/plug-in/Makefile ++++ b/core/plug-in/Makefile +@@ -12,8 +12,9 @@ all: modules + + .PHONY: clean + clean: +- -@rm -f *.so +- -@for r in $(core_modules) "" ; do \ ++ @rm -f *.so ++ @set -e; \ ++ for r in $(core_modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +@@ -23,7 +24,8 @@ clean: + + .PHONY: modules + modules: +- -@for r in $(core_modules) "" ; do \ ++ @set -e; \ ++ for r in $(core_modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +@@ -33,7 +35,8 @@ modules: + + .PHONY: install + install: +- -@for r in $(core_modules) "" ; do \ ++ @set -e; \ ++ for r in $(core_modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +@@ -42,8 +45,9 @@ install: + done + + .PHONY: install-cfg +-install-cfg: $(DESTDIR)$(cfg-target) +- -@for r in $(core_modules) "" ; do \ ++install-cfg: $(DESTDIR)$(cfg_target) ++ @set -e; \ ++ for r in $(core_modules) "" ; do \ + if [ -n "$$r" ]; then \ + echo "" ; \ + echo "" ; \ +--- a/core/plug-in/Makefile.app_module ++++ b/core/plug-in/Makefile.app_module +@@ -34,49 +34,52 @@ module_package: $(extra_target) $(lib_na + + .PHONY: clean + clean: $(extra_clean) +- -@rm -f $(objs) $(depends) $(lib_name) ++ @rm -f $(objs) $(depends) $(lib_name) + + .PHONY: install +-install: all $(extra_install) $(DESTDIR)$(modules-prefix)/$(modules-dir) ++install: all $(extra_install) $(DESTDIR)$(modules_prefix)/$(modules_dir) + if [ -f "$(lib_name)" ]; then \ +- $(INSTALL-TOUCH) $(DESTDIR)$(modules-prefix)/$(modules-dir)/$(lib_name) ; \ +- $(INSTALL-MODULES) $(lib_name) $(DESTDIR)$(modules-prefix)/$(modules-dir); \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(modules_prefix)/$(modules_dir)/$(lib_name) ; \ ++ $(INSTALL_MODULES) $(lib_name) $(DESTDIR)$(modules_prefix)/$(modules_dir); \ + fi + + .PHONY: install-cfg +-install-cfg: $(DESTDIR)$(app-cfg-target) +- -@for r in $(module_conf_files); do \ ++install-cfg: $(DESTDIR)$(app_cfg_target) ++ @set -e; \ ++ for r in $(module_conf_files); do \ + echo installing $$r ; \ +- $(INSTALL-TOUCH) $(DESTDIR)$(app-cfg-target)$$r ; \ +- sed -e "s#/usr/.*lib/sems/audio/#$(audio-target)#g" \ +- -e "s#/usr/.*lib/sems/plug-in/#$(modules-target)#g" \ +- -e "s#/usr/.*lib/sems/ivr/#$(lib-target)ivr/#g" \ +- -e "s#/usr/.*lib/sems/dsm/#$(lib-target)dsm/#g" \ +- -e "s#/usr/.*lib/sems/py_sems/#$(lib-target)py_sems/#g" \ +- -e "s#/usr/.*etc/sems#$(app-cfg-target)#g" \ +- < etc/$$r > $(DESTDIR)$(app-cfg-target)$$r; \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(app_cfg_target)$$r ; \ ++ sed -e "s#/usr/.*lib/sems/audio/#$(audio_target)#g" \ ++ -e "s#/usr/.*lib/sems/plug-in/#$(modules_target)#g" \ ++ -e "s#/usr/.*lib/sems/ivr/#$(lib_target)ivr/#g" \ ++ -e "s#/usr/.*lib/sems/dsm/#$(lib_target)dsm/#g" \ ++ -e "s#/usr/.*lib/sems/py_sems/#$(lib_target)py_sems/#g" \ ++ -e "s#/usr/.*etc/sems#$(app_cfg_target)#g" \ ++ < etc/$$r > $(DESTDIR)$(app_cfg_target)$$r; \ + done + +-$(DESTDIR)(audio-prefix)/$(audio-dir): +- mkdir -p $(DESTDIR)$(audio-prefix)/$(audio-dir) ++$(DESTDIR)$(audio_prefix)/$(audio_dir): ++ mkdir -p $(DESTDIR)$(audio_prefix)/$(audio_dir) + + .PHONY: $(plug_in_name)_audio +-$(plug_in_name)_audio: $(DESTDIR)$(audio-prefix)/$(audio-dir) +- mkdir -p $(DESTDIR)$(audio-prefix)/$(audio-dir)$(plug_in_name) +- -@for f in $(AUDIO_FILES) ; do \ ++$(plug_in_name)_audio: $(DESTDIR)$(audio_prefix)/$(audio_dir) ++ mkdir -p $(DESTDIR)$(audio_prefix)/$(audio_dir)$(plug_in_name) ++ @set -e; \ ++ for f in $(AUDIO_FILES) ; do \ + if [ -n "wav/$$f" ]; then \ +- $(INSTALL-TOUCH) $(DESTDIR)$(audio-prefix)/$(audio-dir)$(plug_in_name)/$$f; \ +- $(INSTALL-AUDIO) wav/$$f $(DESTDIR)$(audio-prefix)/$(audio-dir)$(plug_in_name)/$$f; \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(audio_prefix)/$(audio_dir)$(plug_in_name)/$$f; \ ++ $(INSTALL_AUDIO) wav/$$f $(DESTDIR)$(audio_prefix)/$(audio_dir)$(plug_in_name)/$$f; \ + fi ; \ + done + + .PHONY: $(plug_in_name)_lib + $(plug_in_name)_lib: +- mkdir -p $(DESTDIR)$(lib-prefix)/$(lib-dir)/$(plug_in_name) +- -@for f in $(EXTRA_LIB_FILES) ; do \ ++ mkdir -p $(DESTDIR)$(lib_prefix)/$(lib_dir)/$(plug_in_name) ++ @set -e; \ ++ for f in $(EXTRA_LIB_FILES) ; do \ + if [ -n "$(EXTRA_LIB_DIR)/$$f" ]; then \ +- $(INSTALL-TOUCH) $(DESTDIR)$(lib-prefix)/$(lib-dir)/$(plug_in_name)/$$f; \ +- $(INSTALL-AUDIO) $(EXTRA_LIB_DIR)$$f $(DESTDIR)$(lib-prefix)/$(lib-dir)/$(plug_in_name)/$$f; \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(lib_prefix)/$(lib_dir)/$(plug_in_name)/$$f; \ ++ $(INSTALL_AUDIO) $(EXTRA_LIB_DIR)$$f $(DESTDIR)$(lib_prefix)/$(lib_dir)/$(plug_in_name)/$$f; \ + fi ; \ + done + +--- a/core/plug-in/Makefile.audio_module ++++ b/core/plug-in/Makefile.audio_module +@@ -32,9 +32,9 @@ clean: $(extra_clean) + + .PHONY: install + install: $(lib_name) $(extra_install) +- mkdir -p $(DESTDIR)$(modules-prefix)/$(modules-dir) +- $(INSTALL-TOUCH) $(DESTDIR)$(modules-prefix)/$(modules-dir)/$(lib_name) ; \ +- $(INSTALL-MODULES) $(lib_name) $(DESTDIR)$(modules-prefix)/$(modules-dir) ++ mkdir -p $(DESTDIR)$(modules_prefix)/$(modules_dir) ++ $(INSTALL_TOUCH) $(DESTDIR)$(modules_prefix)/$(modules_dir)/$(lib_name) ; \ ++ $(INSTALL_MODULES) $(lib_name) $(DESTDIR)$(modules_prefix)/$(modules_dir) + + .PHONY: install-cfg + install-cfg : $(extra_install_cfg) +--- a/core/plug-in/gsm/gsm-1.0-pl10/Makefile ++++ b/core/plug-in/gsm/gsm-1.0-pl10/Makefile +@@ -276,32 +276,32 @@ TOAST_INSTALL_TARGETS = \ + + .c.o: + $(CC) $(CFLAGS) $? +- @-mv `$(BASENAME) $@` $@ > /dev/null 2>&1 ++ @mv `$(BASENAME) $@` $@ > /dev/null 2>&1 + + # Target rules + + all: $(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST) +- @-echo $(ROOT): Done. ++ @echo $(ROOT): Done. + + tst: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result +- @-echo tst: Done. ++ @echo tst: Done. + + addtst: $(ADDTST)/add $(ADDTST)/add_test.dta + $(ADDTST)/add < $(ADDTST)/add_test.dta > /dev/null +- @-echo addtst: Done. ++ @echo addtst: Done. + + misc: $(TLS)/sweet $(TLS)/bitter $(TLS)/sour $(TLS)/ginger \ + $(TST)/lin2txt $(TST)/cod2txt $(TST)/gsm2cod +- @-echo misc: Done. ++ @echo misc: Done. + + install: toastinstall gsminstall +- @-echo install: Done. ++ @echo install: Done. + + + # The basic API: libgsm + + $(LIBGSM): $(LIB) $(GSM_OBJECTS) +- -rm -f $(RMFLAGS) $(LIBGSM) ++ rm -f $(RMFLAGS) $(LIBGSM) + $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS) + $(RANLIB) $(LIBGSM) + +@@ -312,11 +312,11 @@ $(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBG + $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB) + + $(UNTOAST): $(BIN) $(TOAST) +- -rm $(RMFLAGS) $(UNTOAST) ++ rm -f $(RMFLAGS) $(UNTOAST) + $(LN) $(TOAST) $(UNTOAST) + + $(TCAT): $(BIN) $(TOAST) +- -rm $(RMFLAGS) $(TCAT) ++ rm -f $(RMFLAGS) $(TCAT) + $(LN) $(TOAST) $(TCAT) + + +@@ -332,70 +332,70 @@ $(LIB): + # Installation + + gsminstall: +- -if [ x"$(GSM_INSTALL_ROOT)" != x ] ; then \ +- make $(GSM_INSTALL_TARGETS) ; \ ++ if [ x"$(GSM_INSTALL_ROOT)" != x ] ; then \ ++ $(MAKE) $(GSM_INSTALL_TARGETS) ; \ + fi + + toastinstall: +- -if [ x"$(TOAST_INSTALL_ROOT)" != x ]; then \ +- make $(TOAST_INSTALL_TARGETS); \ ++ if [ x"$(TOAST_INSTALL_ROOT)" != x ]; then \ ++ $(MAKE) $(TOAST_INSTALL_TARGETS); \ + fi + + gsmuninstall: +- -if [ x"$(GSM_INSTALL_ROOT)" != x ] ; then \ ++ if [ x"$(GSM_INSTALL_ROOT)" != x ] ; then \ + rm $(RMFLAGS) $(GSM_INSTALL_TARGETS) ; \ + fi + + toastuninstall: +- -if [ x"$(TOAST_INSTALL_ROOT)" != x ] ; then \ ++ if [ x"$(TOAST_INSTALL_ROOT)" != x ] ; then \ + rm $(RMFLAGS) $(TOAST_INSTALL_TARGETS); \ + fi + + $(TOAST_INSTALL_BIN)/toast: $(TOAST) +- -rm $@ ++ rm -f $@ + cp $(TOAST) $@ + chmod 755 $@ + + $(TOAST_INSTALL_BIN)/untoast: $(TOAST_INSTALL_BIN)/toast +- -rm $@ ++ rm -f $@ + ln $? $@ + + $(TOAST_INSTALL_BIN)/tcat: $(TOAST_INSTALL_BIN)/toast +- -rm $@ ++ rm -f $@ + ln $? $@ + + $(TOAST_INSTALL_MAN)/toast.1: $(MAN)/toast.1 +- -rm $@ ++ rm -f $@ + cp $? $@ + chmod 444 $@ + + $(GSM_INSTALL_MAN)/gsm.3: $(MAN)/gsm.3 +- -rm $@ ++ rm -f $@ + cp $? $@ + chmod 444 $@ + + $(GSM_INSTALL_MAN)/gsm_option.3: $(MAN)/gsm_option.3 +- -rm $@ ++ rm -f $@ + cp $? $@ + chmod 444 $@ + + $(GSM_INSTALL_MAN)/gsm_explode.3: $(MAN)/gsm_explode.3 +- -rm $@ ++ rm -f $@ + cp $? $@ + chmod 444 $@ + + $(GSM_INSTALL_MAN)/gsm_print.3: $(MAN)/gsm_print.3 +- -rm $@ ++ rm -f $@ + cp $? $@ + chmod 444 $@ + + $(GSM_INSTALL_INC)/gsm.h: $(INC)/gsm.h +- -rm $@ ++ rm -f $@ + cp $? $@ + chmod 444 $@ + + $(GSM_INSTALL_LIB)/libgsm.a: $(LIBGSM) +- -rm $@ ++ rm -f $@ + cp $? $@ + chmod 444 $@ + +@@ -414,17 +414,17 @@ gsm-1.0.tar.Z: $(STUFF) $(SOURCES) $(HEA + # Clean + + uninstall: toastuninstall gsmuninstall +- @-echo uninstall: Done. ++ @echo uninstall: Done. + + semi-clean: +- -@rm -Rf $(RMFLAGS) */*.o \ ++ @rm -Rf $(RMFLAGS) */*.o \ + $(TST)/lin2cod $(TST)/lin2txt \ + $(TST)/cod2lin $(TST)/cod2txt \ + $(TST)/gsm2cod \ + $(TST)/*.*.* + + clean: semi-clean +- -@rm -Rf $(RMFLAGS) $(LIBGSM) $(ADDTST)/add \ ++ @rm -Rf $(RMFLAGS) $(LIBGSM) $(ADDTST)/add \ + $(TOAST) $(TCAT) $(UNTOAST) \ + $(ROOT)/gsm-1.0.tar.Z + +--- a/core/plug-in/ilbc/iLBC_rfc3951/Makefile ++++ b/core/plug-in/ilbc/iLBC_rfc3951/Makefile +@@ -16,7 +16,7 @@ RANLIB = ranlib + + .PHONY: clean + clean: +- -@rm -f $(objs) $(depends) $(lib_name) ++ @rm -f $(objs) $(depends) $(lib_name) + + -include $(depends) + +--- a/core/plug-in/stats/Makefile ++++ b/core/plug-in/stats/Makefile +@@ -19,9 +19,9 @@ include ../Makefile.app_module + $(QUERY_STATS_NAME): query_stats.o Makefile + $(LD) -o $(QUERY_STATS_NAME) query_stats.o $(LDFLAGS) $(EXTRA_LDFLAGS) + +-install_query_stats: $(QUERY_STATS_NAME) $(DESTDIR)$(bin-prefix)/$(bin-dir) +- $(INSTALL-TOUCH) $(DESTDIR)$(bin-prefix)/$(bin-dir)$(QUERY_STATS_DEST_NAME) +- $(INSTALL-BIN) $(QUERY_STATS_NAME) $(DESTDIR)$(bin-prefix)/$(bin-dir)/$(QUERY_STATS_DEST_NAME) ++install_query_stats: $(QUERY_STATS_NAME) $(DESTDIR)$(bin_prefix)/$(bin_dir) ++ $(INSTALL_TOUCH) $(DESTDIR)$(bin_prefix)/$(bin_dir)$(QUERY_STATS_DEST_NAME) ++ $(INSTALL_BIN) $(QUERY_STATS_NAME) $(DESTDIR)$(bin_prefix)/$(bin_dir)/$(QUERY_STATS_DEST_NAME) + + clean_query_stats: + rm -f $(QUERY_STATS_NAME) query_stats.o query_stats.d +--- a/core/resample/Makefile ++++ b/core/resample/Makefile +@@ -24,6 +24,6 @@ CPPFLAGS += -I$(COREPATH) + $(CXX) -MMD -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS) + + $(LIBNAME): $(OBJS) $(COREPATH)/../Makefile.defs +- -@echo "" +- -@echo "making $(LIBNAME)" ++ @echo "" ++ @echo "making $(LIBNAME)" + $(AR) rvs $(LIBNAME) $(OBJS) +--- a/core/sip/Makefile ++++ b/core/sip/Makefile +@@ -48,8 +48,8 @@ endif + $(CXX) -MMD -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS) + + $(LIBNAME): $(OBJS) $(COREPATH)/../Makefile.defs +- -@echo "" +- -@echo "making $(LIBNAME)" ++ @echo "" ++ @echo "making $(LIBNAME)" + $(AR) rvs $(LIBNAME) $(OBJS) + + -include $(DEPS) +--- a/core/tests/Makefile ++++ b/core/tests/Makefile +@@ -29,21 +29,21 @@ EXTRA_LDFLAGS += -lresolv -levent -leven + + .PHONY: all + all: ../../Makefile.defs sip_stack libresample +- -@$(MAKE) core_deps && $(MAKE) sbc_deps && $(MAKE) deps && \ ++ @$(MAKE) core_deps && $(MAKE) sbc_deps && $(MAKE) deps && \ + $(MAKE) $(NAME) && \ + ./$(NAME) + + .PHONY: sip_stack + sip_stack: +- -@echo "" +- -@echo "making SIP stack" +- -@cd $(SIP_STACK_DIR); $(MAKE) all ++ @echo "" ++ @echo "making SIP stack" ++ @cd $(SIP_STACK_DIR); $(MAKE) all + + .PHONY: libresample + libresample: +- -@echo "" +- -@echo "making libresample" +- -@cd $(RESAMPLE_DIR); $(MAKE) all ++ @echo "" ++ @echo "making libresample" ++ @cd $(RESAMPLE_DIR); $(MAKE) all + + SIP_STACK: sip_stack + +@@ -83,8 +83,8 @@ include ../../Makefile.defs + $(CXX) -MM $< $(CPPFLAGS) $(CXXFLAGS) > $@ + + $(NAME): $(OBJS) $(CORE_OBJS) $(SBC_OBJS) $(AUTH_OBJS) $(SIP_STACK) $(LIBRESAMPLE) ../../Makefile.defs +- -@echo "" +- -@echo "making $(NAME)" ++ @echo "" ++ @echo "making $(NAME)" + $(LD) -o $(NAME) $(OBJS) $(CORE_OBJS) $(SBC_OBJS) $(SIP_STACK) $(LIBRESAMPLE) $(LDFLAGS) $(EXTRA_LDFLAGS) $(AUTH_OBJS) + + ifeq '$(NAME)' '$(MAKECMDGOALS)' +--- a/pkg/rpm/sems.spec ++++ b/pkg/rpm/sems.spec +@@ -112,16 +112,16 @@ make install TTS="y" exclude_modules="ex + DESTDIR=$RPM_BUILD_ROOT \ + basedir= \ + prefix=%{_prefix} \ +- modules-prefix= \ +- modules-dir=%{_libdir}/sems/plug-in \ +- modules-target=%{_libdir}/sems/plug-in \ +- ivr-modules-dir=%{_libdir}/sems/ivr \ +- cfg-prefix= \ +- cfg-target=%{_sysconfdir}/sems/ \ +- doc-prefix= \ +- doc-dir=%{_docdir}/sems/ \ +- audio-prefix= \ +- audio-dir=%{_libdir}/sems/audio/ ++ modules_prefix= \ ++ modules_dir=%{_libdir}/sems/plug-in \ ++ modules_target=%{_libdir}/sems/plug-in \ ++ ivr_modules_dir=%{_libdir}/sems/ivr \ ++ cfg_prefix= \ ++ cfg_target=%{_sysconfdir}/sems/ \ ++ doc_prefix= \ ++ doc_dir=%{_docdir}/sems/ \ ++ audio_prefix= \ ++ audio_dir=%{_libdir}/sems/audio/ + + install -D -p -m755 pkg/rpm/sems.init $RPM_BUILD_ROOT/%{_sysconfdir}/init.d/sems + +--- a/tools/Makefile ++++ b/tools/Makefile +@@ -3,18 +3,19 @@ all: make_tools + COREPATH ?= ../core + include $(COREPATH)/../Makefile.defs + +-sems-tools = sems-logfile-callextract ++sems_tools = sems-logfile-callextract + +-install: $(sems-tools) install_tools ++install: $(sems_tools) install_tools + +-make_tools: $(sems-tools) ++make_tools: $(sems_tools) + +-install_tools: $(DESTDIR)$(bin-prefix)/$(bin-dir) +- -@for r in $(sems-tools) ; do \ ++install_tools: $(DESTDIR)$(bin_prefix)/$(bin_dir) ++ @set -e; \ ++ for r in $(sems_tools) ; do \ + x=`echo $$r | sed s/sems-/$(APP_NAME)-/g` ; \ + echo "installing $$r -> $$x" ; \ +- $(INSTALL-TOUCH) $(DESTDIR)$(bin-prefix)/$(bin-dir)/$$x ; \ +- $(INSTALL-BIN) $$r $(DESTDIR)$(bin-prefix)/$(bin-dir)/$$x ; \ ++ $(INSTALL_TOUCH) $(DESTDIR)$(bin_prefix)/$(bin_dir)/$$x ; \ ++ $(INSTALL_BIN) $$r $(DESTDIR)$(bin_prefix)/$(bin_dir)/$$x ; \ + done + + sems-logfile-callextract: logfile-splitter.o diff --git a/debian/patches/series b/debian/patches/series index afc70aa5..e7723507 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -19,3 +19,7 @@ sipwise/MT-20649-add-vsc-for-block-in-clir sipwise/MT-20649-change-config-validation sipwise/MT-20649-use-macros sipwise/0002-b-f-dsm-mod_conference-set-callgroup-to-conference-c.patch +build-fix-bit-rot.patch +build-fix-pie.patch +build-fix-excludes.patch +build-system-revamp.patch diff --git a/debian/rules b/debian/rules index a3ffcc5c..0bfb4ea9 100644 --- a/debian/rules +++ b/debian/rules @@ -23,7 +23,7 @@ export SYSTEM_SAMPLECLOCK_RATE=48000LL override_dh_auto_build: $(MAKE) \ - cfg-target=/etc/$(APP_NAME)/ prefix=/usr \ + cfg_target=/etc/$(APP_NAME)/ prefix=/usr \ exclude_app_modules="$(EXCLUDED_MODULES)" \ exclude_dsm_modules="$(EXCLUDED_DSM_MODULES)" \ DESTDIR=$(CURDIR)/debian/$(APP_NAME) @@ -32,14 +32,14 @@ override_dh_auto_install: $(MAKE) -C core/ install \ DESTDIR=$(CURDIR)/debian/$(APP_NAME) \ prefix=/usr \ - cfg-target=/etc/$(APP_NAME)/ + cfg_target=/etc/$(APP_NAME)/ $(MAKE) -C apps/ install \ exclude_app_modules="$(EXCLUDED_MODULES) $(PYTHON_MODULES)" \ exclude_dsm_modules="$(EXCLUDED_DSM_PY_MODULES)" \ DESTDIR=$(CURDIR)/debian/$(APP_NAME) \ prefix=/usr \ - cfg-target=/etc/$(APP_NAME)/ + cfg_target=/etc/$(APP_NAME)/ dh_python2 /usr/lib/$(APP_NAME)