From f19bb3be8a43f50d3a5aa83dee4d0847f12fe5ac Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Tue, 9 Dec 2008 18:23:20 +0000 Subject: [PATCH] added copy of Makefile.app_module with differing install target, to overcome build warnings git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1196 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- apps/dsm/mods/Makefile.dsm_module | 117 ++++++++++++++++++++++++++++++ apps/dsm/mods/mod_dlg/Makefile | 10 +-- apps/dsm/mods/mod_sys/Makefile | 10 +-- apps/dsm/mods/mod_uri/Makefile | 10 +-- 4 files changed, 120 insertions(+), 27 deletions(-) create mode 100644 apps/dsm/mods/Makefile.dsm_module diff --git a/apps/dsm/mods/Makefile.dsm_module b/apps/dsm/mods/Makefile.dsm_module new file mode 100644 index 00000000..b8a28106 --- /dev/null +++ b/apps/dsm/mods/Makefile.dsm_module @@ -0,0 +1,117 @@ +COREPATH ?=../../../core +.DEFAULT_GOAL := all + +include $(COREPATH)/../Makefile.defs + +LIB_LDFLAGS += $(module_ldflags) +CPPFLAGS += -I $(COREPATH) +CFLAGS += -I $(COREPATH) +CFLAGS += $(module_cflags) +CPPFLAGS += $(module_cflags) +CXXFLAGS += $(module_cflags) + +app_module_dir = $(COREPATH)/lib + +lib_name = $(plug_in_name).so +lib_full_name ?= $(app_module_dir)/$(lib_name) + +module_conf_files = $(wildcard etc/*.conf) +AUDIO_FILES=$(notdir $(wildcard wav/*.wav)) +EXTRA_LIB_DIR?=lib/ +EXTRA_LIB_FILES=$(notdir $(wildcard $(EXTRA_LIB_DIR)*)) + +srcs = $(wildcard *.cpp) +hrds = $(wildcard *.h) +objs = $(srcs:.cpp=.o) +depends = $(srcs:.cpp=.d) + +.PHONY: all +all: $(extra_target) + -@$(MAKE) deps && \ + $(MAKE) $(lib_full_name) + +.PHONY: module_package +module_package: $(extra_target) + -@$(MAKE) deps && \ + $(MAKE) $(lib_name) + + +.PHONY: clean +clean: $(extra_clean) + -@rm -f $(objs) $(depends) $(lib_name) + +.PHONY: deps +deps: $(depends) $(extra_depends) + +.PHONY: install +install: all $(extra_install) + 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/; \ + fi + +.PHONY: install-cfg +install-cfg: + mkdir -p $(DESTDIR)$(cfg-target)etc + -@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; \ + done + +$(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 \ + 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; \ + 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 \ + 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; \ + fi ; \ + done + +%.d: %.cpp Makefile $(COREPATH)/plug-in/Makefile.app_module $(COREPATH)/../Makefile.defs + $(CXX) -MM $< $(CXXFLAGS) $(CPPFLAGS) > $@ + +%.d: %.c Makefile $(COREPATH)/plug-in/Makefile.app_module $(COREPATH)/../Makefile.defs + $(CC) -MM $< $(CFLAGS) $(CPPFLAGS) > $@ + +%.o: %.cpp %.d $(COREPATH)/../Makefile.defs + $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $< -o $@ + +%.o: %.c %.d $(COREPATH)/../Makefile.defs + $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ + + +$(lib_full_name): $(lib_name) + cp $(lib_name) $(lib_full_name) + +$(lib_name): $(objs) $(module_extra_objs) Makefile + $(LD) -o $(lib_name) $(objs) $(module_extra_objs) $(LIB_LDFLAGS) + +ifeq ($(lib_full_name),$(MAKECMDGOALS)) +include $(depends) +endif + +ifeq (,$(MAKECMDGOALS)) +include $(depends) +endif diff --git a/apps/dsm/mods/mod_dlg/Makefile b/apps/dsm/mods/mod_dlg/Makefile index dd40fb1c..d1f08a10 100644 --- a/apps/dsm/mods/mod_dlg/Makefile +++ b/apps/dsm/mods/mod_dlg/Makefile @@ -7,12 +7,4 @@ module_cflags = -DMOD_NAME=\"$(plug_in_name)\" -I$(DSMPATH) COREPATH ?=$(DSMPATH)/../../core lib_full_name = $(DSMPATH)/mods/lib/$(lib_name) -include $(COREPATH)/plug-in/Makefile.app_module - -.PHONY: install -install: all $(extra_install) - 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/; \ - fi +include $(DSMPATH)/mods/Makefile.dsm_module diff --git a/apps/dsm/mods/mod_sys/Makefile b/apps/dsm/mods/mod_sys/Makefile index bdf0a949..8695dbd8 100644 --- a/apps/dsm/mods/mod_sys/Makefile +++ b/apps/dsm/mods/mod_sys/Makefile @@ -7,12 +7,4 @@ module_cflags = -DMOD_NAME=\"$(plug_in_name)\" -I$(DSMPATH) COREPATH ?=$(DSMPATH)/../../core lib_full_name = $(DSMPATH)/mods/lib/$(lib_name) -include $(COREPATH)/plug-in/Makefile.app_module - -.PHONY: install -install: all $(extra_install) - 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/; \ - fi +include $(DSMPATH)/mods/Makefile.dsm_module diff --git a/apps/dsm/mods/mod_uri/Makefile b/apps/dsm/mods/mod_uri/Makefile index 8ea9e9c0..6b5f6799 100644 --- a/apps/dsm/mods/mod_uri/Makefile +++ b/apps/dsm/mods/mod_uri/Makefile @@ -7,12 +7,4 @@ module_cflags = -DMOD_NAME=\"$(plug_in_name)\" -I$(DSMPATH) COREPATH ?=$(DSMPATH)/../../core lib_full_name = $(DSMPATH)/mods/lib/$(lib_name) -include $(COREPATH)/plug-in/Makefile.app_module - -.PHONY: install -install: all $(extra_install) - 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/; \ - fi +include $(DSMPATH)/mods/Makefile.dsm_module