From a0dfd71af5995ea19fd4bffa1dd6a336569a6f6f Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Wed, 31 Mar 2010 15:04:45 +0000 Subject: [PATCH] - splits the exclude_modules in three variables (exclude_core_module, exclude_apps_modules,exclude_dsm_modules). - exclude_dsm_modules is set in apps/dsm/mods/Makefile, the two others are set in Makefile.defs. git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1741 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- Makefile | 12 +++---- Makefile.defs | 52 ++++++++++++++++++++++++------ apps/Makefile | 23 ++++++------- apps/dsm/mods/Makefile | 17 +++++----- apps/dsm/mods/mod_py/Makefile | 2 +- core/Makefile | 24 +------------- getarch.c => core/compat/getarch.c | 0 getos.c => core/compat/getos.c | 0 core/plug-in/Makefile | 13 ++++---- 9 files changed, 77 insertions(+), 66 deletions(-) rename getarch.c => core/compat/getarch.c (100%) rename getos.c => core/compat/getos.c (100%) diff --git a/Makefile b/Makefile index 87b2b831..0a5cb023 100644 --- a/Makefile +++ b/Makefile @@ -8,32 +8,32 @@ all: modules COREPATH=core include Makefile.defs -modules = core apps +subdirs = core apps .PHONY: clean clean: -@rm -f *.so - -@for r in $(modules) "" ; do \ + -@for r in $(subdirs) "" ; do \ if [ -n "$$r" ]; then \ echo "" ; \ - echo "" ; \ + echo "making $$r" ; \ $(MAKE) -C $$r clean ; \ fi ; \ done .PHONY: modules modules: - -@for r in $(modules) "" ; do \ + -@for r in $(subdirs) "" ; do \ if [ -n "$$r" ]; then \ echo "" ; \ - echo "" ; \ + echo "making $$r" ; \ $(MAKE) -C $$r all; \ fi ; \ done .PHONY: install install: - -@for r in $(modules) "" ; do \ + -@for r in $(subdirs) "" ; do \ if [ -n "$$r" ]; then \ echo "" ; \ echo "" ; \ diff --git a/Makefile.defs b/Makefile.defs index e6b6d9c5..8844b3a8 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -45,7 +45,9 @@ CPPFLAGS += -D_DEBUG \ # # exclude some modules from compilation? # e.g. python modules: -#exclude_modules ?= py_sems ivr mailbox pin_collect conf_auth mp3 examples + +#exclude_core_modules = +#exclude_apps_modules = py_sems ivr mailbox pin_collect conf_auth mp3 examples # build in support for monitoring? # @@ -54,8 +56,11 @@ USE_MONITORING=yes LDFLAGS += -lm -OS := $(shell $(CC) $(EXTRA_CFLAGS) -o $(COREPATH)/../getos $(COREPATH)/../getos.c && $(COREPATH)/../getos) -ARCH := $(shell $(CC) $(EXTRA_CFLAGS) -o $(COREPATH)/../getarch $(COREPATH)/../getarch.c && $(COREPATH)/../getarch) +GETOS=$(COREPATH)/compat/getos +GETARCH=$(COREPATH)/compat/getarch + +OS := $(shell $(CC) $(EXTRA_CFLAGS) -o $(GETOS) $(GETOS).c && $(GETOS)) +ARCH := $(shell $(CC) $(EXTRA_CFLAGS) -o $(GETARCH) $(GETARCH).c && $(GETARCH)) ifdef USE_SPANDSP ifneq ($(spandsp_defs), 1) @@ -64,7 +69,7 @@ export spandsp_defs CPPFLAGS += -DUSE_SPANDSP -D__STDC_LIMIT_MACROS endif else -override exclude_modules += g722 +exclude_core_modules += g722 endif ifdef USE_LIBSAMPLERATE @@ -90,7 +95,7 @@ ifeq ($(OS),solaris) # I don't have libspeex installed. # binrpcctrl does some really weird header stuff that doesn't work. - exclude_modules += binrpcctrl ilbc speex + exclude_core_modules += binrpcctrl ilbc speex endif @@ -125,7 +130,7 @@ CPPFLAGS += -DWITH_ZRTP \ -I/usr/local/include/zrtp endif -TARGET = +TARGET= LIB_LDFLAGS = -shared ifeq ($(OS), linux) @@ -157,18 +162,47 @@ ifeq ($(OS), macosx) LDFLAGS += -L/opt/local/lib endif - override exclude_modules += binrpcctrl ivr examples py_sems + exclude_core_modules += binrpcctrl + exclude_app_modules += ivr else - LDFLAGS+= -fPIC -ldl -lsocket -lnsl -lpthread +ifeq ($(OS), solaris) + LDFLAGS+= -fPIC -ldl -lsocket -lnsl -lpthread TARGET=solaris + # These don't build on Solaris because of missing Python, invalid make args, or other. + exclude_app_modules += py_sems py_comp pin_collect mailbox ivr diameter_client conf_auth mp3 cc_acc_xmlrpc xmlrpc2di + +endif +endif +endif +endif +endif +endif + +LDFLAGS += -lstdc++ + +ifeq ($(ARCH),iphone) +LDFLAGS += -lgcc_eh endif + +ifdef USE_SPANDSP +ifdef LIBSPANDSP_STATIC +LDFLAGS += $(LIBSPANDSP_LDIR)libspandsp.a +else +LDFLAGS += -lspandsp endif endif + +ifdef USE_LIBSAMPLERATE +LDFLAGS +=-lsamplerate endif + +ifdef WITH_ZRTP +LDFLAGS +=-lzrtp -lbn endif LIB_LDFLAGS += $(LDFLAGS) + # install path is $(basedir) $(prefix) # example: # creating a bin. archive in /tmp, which unpacks in /usr/local @@ -266,7 +300,7 @@ export USE_SPANDSP LIBSPANDSP_STATIC LIBSPANDSP_LDIR export USE_LIBSAMPLERATE export WITH_ZRTP export USE_MONITORING -export exclude_modules +export exclude_core_modules exclude_app_modules endif # ifeq ($(makefile_defs, 1) mk-install-dirs: $(DESTDIR)$(cfg-target) \ diff --git a/apps/Makefile b/apps/Makefile index 8706aa51..3cd1f927 100644 --- a/apps/Makefile +++ b/apps/Makefile @@ -3,21 +3,18 @@ COREPATH ?= ../core include $(COREPATH)/../Makefile.defs +exclude_app_modules += mp3 examples py_sems xmlrpc2di gateway + ifneq ($(USE_MONITORING), yes) -override exclude_modules = mp3 examples py_sems xmlrpc2di gateway monitoring -else -override exclude_modules = mp3 examples py_sems xmlrpc2di gateway +exclude_app_modules += monitoring endif -modules ?= $(filter-out $(subst ;, ,$(exclude_modules))\ +$(info exclude_app_modules: $(exclude_app_modules)) +app_modules = $(filter-out $(subst ;, ,$(exclude_app_modules))\ $(wildcard Makefile*) CVS CMakeLists.txt, \ $(wildcard *) examples/tutorial/cc_acc ) -#modules = wav gsm ilbc bot echo announcement recorder voicemail dtmf_demo ivr -ifeq ($(OS),solaris) -# These don't build on Solaris because of missing Python, invalid make args, or other. - exclude_modules += py_sems py_comp pin_collect mailbox ivr diameter_client conf_auth mp3 cc_acc_xmlrpc xmlrpc2di -endif +#modules = wav gsm ilbc bot echo announcement recorder voicemail dtmf_demo ivr .PHONY: all all: modules @@ -25,7 +22,7 @@ all: modules .PHONY: clean clean: -@rm -f *.so - -@for r in $(modules) "" ; do \ + -@for r in $(app_modules) "" ; do \ if [ -n "$$r" ]; then \ echo "" ; \ echo "" ; \ @@ -35,7 +32,7 @@ clean: .PHONY: modules modules: - -@for r in $(modules) "" ; do \ + -@for r in $(app_modules) "" ; do \ if [ -n "$$r" ]; then \ echo "" ; \ echo "" ; \ @@ -48,7 +45,7 @@ install: install-bin install-cfg .PHONY: install-bin install-bin: - -@for r in $(modules) "" ; do \ + -@for r in $(app_modules) "" ; do \ if [ -n "$$r" ]; then \ echo "" ; \ echo "" ; \ @@ -58,7 +55,7 @@ install-bin: .PHONY: install-cfg install-cfg: $(DESTDIR)$(cfg-target) - -@for r in $(modules) "" ; do \ + -@for r in $(app_modules) "" ; do \ if [ -n "$$r" ]; then \ echo "" ; \ echo "" ; \ diff --git a/apps/dsm/mods/Makefile b/apps/dsm/mods/Makefile index e8f21cf7..4c25789a 100644 --- a/apps/dsm/mods/Makefile +++ b/apps/dsm/mods/Makefile @@ -4,13 +4,14 @@ COREPATH = $(DSMPATH)/../../core include $(COREPATH)/../Makefile.defs +exclude_dsm_modules = mod_mysql mod_aws + ifneq ($(USE_MONITORING), yes) -override exclude_modules += mod_monitoring mod_mysql mod_aws -else -override exclude_modules += mod_mysql mod_aws +exclude_dsm_modules += mod_monitoring endif -modules = $(filter-out $(subst ;, ,$(exclude_modules))\ +$(info exclude_dsm_modules: $(exclude_dsm_modules)) +dsm_modules = $(filter-out $(subst ;, ,$(exclude_dsm_modules))\ $(wildcard Makefile*) lib CMakeLists.txt, \ $(wildcard *) ) @@ -21,7 +22,7 @@ all: modules .PHONY: clean clean: -@rm -f lib/*.so - -@for r in $(modules) "" ; do \ + -@for r in $(dsm_modules) "" ; do \ if [ -n "$$r" ]; then \ echo "" ; \ echo "" ; \ @@ -31,7 +32,7 @@ clean: .PHONY: modules modules: - -@for r in $(modules) "" ; do \ + -@for r in $(dsm_modules) "" ; do \ if [ -n "$$r" ]; then \ echo "" ; \ echo "" ; \ @@ -44,7 +45,7 @@ install: install-bin install-cfg .PHONY: install-bin install-bin: - -@for r in $(modules) "" ; do \ + -@for r in $(dsm_modules) "" ; do \ if [ -n "$$r" ]; then \ echo "" ; \ echo "" ; \ @@ -54,7 +55,7 @@ install-bin: .PHONY: install-cfg install-cfg: $(DESTDIR)$(cfg-target) - -@for r in $(modules) "" ; do \ + -@for r in $(dsm_modules) "" ; do \ if [ -n "$$r" ]; then \ echo "" ; \ echo "" ; \ diff --git a/apps/dsm/mods/mod_py/Makefile b/apps/dsm/mods/mod_py/Makefile index 210479ab..67bc7798 100644 --- a/apps/dsm/mods/mod_py/Makefile +++ b/apps/dsm/mods/mod_py/Makefile @@ -33,6 +33,6 @@ COREPATH ?=$(DSMPATH)/../../core lib_full_name = $(DSMPATH)/mods/lib/$(lib_name) include $(DSMPATH)/mods/Makefile.dsm_module -ifneq ($(OS),darwin) +ifneq ($(OS),macosx) PYTHON_module_ldflags += -Xlinker --export-dynamic endif \ No newline at end of file diff --git a/core/Makefile b/core/Makefile index 57f762d9..c51c9b41 100644 --- a/core/Makefile +++ b/core/Makefile @@ -19,7 +19,7 @@ all: ../Makefile.defs .PHONY: clean clean: rm -f $(OBJS) $(DEPS) $(NAME) $(NAME).o - rm -f lib/*.so + rm -f lib/*.so compat/getos compat/getarch $(MAKE) -C $(PLUGIN_DIR) clean .PHONY: modules @@ -43,28 +43,6 @@ COREPATH=. include ../Makefile.defs -LDFLAGS += -lstdc++ - -ifeq ($(ARCH),iphone) -LDFLAGS += -lgcc_eh -endif - -ifdef USE_SPANDSP -ifdef LIBSPANDSP_STATIC -LDFLAGS += $(LIBSPANDSP_LDIR)libspandsp.a -else -LDFLAGS += -lspandsp -endif -endif - -ifdef USE_LIBSAMPLERATE -LDFLAGS +=-lsamplerate -endif - -ifdef WITH_ZRTP -LDFLAGS +=-lzrtp -lbn -endif - # implicit rules %.o : %.cpp %.d ../Makefile.defs $(CXX) -c -o $@ $< $(CPPFLAGS) $(CXXFLAGS) diff --git a/getarch.c b/core/compat/getarch.c similarity index 100% rename from getarch.c rename to core/compat/getarch.c diff --git a/getos.c b/core/compat/getos.c similarity index 100% rename from getos.c rename to core/compat/getos.c diff --git a/core/plug-in/Makefile b/core/plug-in/Makefile index c5e3e410..53494019 100644 --- a/core/plug-in/Makefile +++ b/core/plug-in/Makefile @@ -1,9 +1,10 @@ +COREPATH=.. include ../../Makefile.defs -modules = $(filter-out $(subst ;, ,$(exclude_modules)) \ +$(info exclude_core_modules: $(exclude_core_modules)) +core_modules = $(filter-out $(subst ;, ,$(exclude_core_modules)) \ $(wildcard Makefile*) CMakeLists.txt, \ $(wildcard *) ) -#modules = wav gsm ilbc bot echo announcement recorder voicemail dtmf_demo ivr .DEFAULT_GOAL := all .PHONY: all @@ -12,7 +13,7 @@ all: modules .PHONY: clean clean: -@rm -f *.so - -@for r in $(modules) "" ; do \ + -@for r in $(core_modules) "" ; do \ if [ -n "$$r" ]; then \ echo "" ; \ echo "" ; \ @@ -22,7 +23,7 @@ clean: .PHONY: modules modules: - -@for r in $(modules) "" ; do \ + -@for r in $(core_modules) "" ; do \ if [ -n "$$r" ]; then \ echo "" ; \ echo "" ; \ @@ -32,7 +33,7 @@ modules: .PHONY: install install: - -@for r in $(modules) "" ; do \ + -@for r in $(core_modules) "" ; do \ if [ -n "$$r" ]; then \ echo "" ; \ echo "" ; \ @@ -42,7 +43,7 @@ install: .PHONY: install-cfg install-cfg: $(DESTDIR)$(cfg-target) - -@for r in $(modules) "" ; do \ + -@for r in $(core_modules) "" ; do \ if [ -n "$$r" ]; then \ echo "" ; \ echo "" ; \