diff --git a/Makefile.defs b/Makefile.defs index c66f31c9..f4147f74 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -28,7 +28,15 @@ ifeq ($(ARCH),sparc) endif endif -CPP_FLAGS = -Wall -Wno-reorder -fPIC -g \ +CXX_FLAGS = -Wall -Wno-reorder -fPIC -g \ + -O2 \ + -D_DEBUG \ + -D_THREAD_SAFE -D_REENTRANT \ + -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"'\ + -DOS='"$(OS)"' \ +# -DSUPPORT_IPV6 + +C_FLAGS = -Wall -fPIC -g \ -O2 \ -D_DEBUG \ -D_THREAD_SAFE -D_REENTRANT \ @@ -134,3 +142,24 @@ INSTALL-MODULES = $(INSTALL) -m 755 INSTALL-DOC = $(INSTALL) -m 644 INSTALL-AUDIO = $(INSTALL) -m 644 + +mk-install-dirs: $(cfg-prefix)/$(cfg-dir) $(bin-prefix)/$(bin-dir) \ + $(modules-prefix)/$(modules-dir) \ + $(audio-prefix)/$(audio-dir) \ + $(doc-prefix)/$(doc-dir) + +$(cfg-prefix)/$(cfg-dir): + mkdir -p $(cfg-prefix)/$(cfg-dir) + +$(bin-prefix)/$(bin-dir): + mkdir -p $(bin-prefix)/$(bin-dir) + +$(modules-prefix)/$(modules-dir): + mkdir -p $(modules-prefix)/$(modules-dir) + +$(audio-prefix)/$(audio-dir): + mkdir -p $(audio-prefix)/$(audio-dir) + +$(doc-prefix)/$(doc-dir): + mkdir -p $(doc-prefix)/$(doc-dir) + diff --git a/apps/ivr/Makefile.ivr_application b/apps/ivr/Makefile.ivr_application index 0d29b8d9..2aae771d 100644 --- a/apps/ivr/Makefile.ivr_application +++ b/apps/ivr/Makefile.ivr_application @@ -1,4 +1,5 @@ # generic Makefile for ivr applications +.DEFAULT_GOAL := all include ../../Makefile.defs include ../ivr/Makefile.defs diff --git a/apps/mailbox/imap_mailbox/imap4ext.py b/apps/mailbox/imap_mailbox/imap4ext.py index 22403689..f946b4cc 100644 --- a/apps/mailbox/imap_mailbox/imap4ext.py +++ b/apps/mailbox/imap_mailbox/imap4ext.py @@ -143,7 +143,6 @@ class IMAP4_Mailbox: def uploadMsg(self,msg): - self._login() IMAPCALL(self.imap.append(self.url.path,None,time.gmtime(),msg)) diff --git a/core/Makefile b/core/Makefile index 6b416c27..dcc2691c 100644 --- a/core/Makefile +++ b/core/Makefile @@ -46,20 +46,10 @@ include ../Makefile.defs # implicit rules %.o : %.cpp %.d - g++ -c -o $@ $< $(CPP_FLAGS) + g++ -c -o $@ $< $(CXX_FLAGS) %.d : %.cpp %.h Makefile - g++ -MM $< $(CPP_FLAGS) > $@ - -# md5.o: md5.c md5.d -# $(CC) $(cflags) -c $< -o $@ - -# md5.d: md5.c md5.h Makefile -# $(CC) -MM $< $(cflags) > $@ - -# explicit rules -#$(LIBNAME): $(OBJS) -# g++ -o $(LIBNAME) $(OBJS) $(LIB_LD_FLAGS) + g++ -MM $< $(CXX_FLAGS) > $@ $(NAME): $(NAME).o $(OBJS) g++ -o $(NAME) $(NAME).o $(OBJS) $(LD_FLAGS) @@ -137,28 +127,6 @@ tar: "$(NAME)-$(RELEASE)" ) ; \ rm -rf tmp/_tar1; rm -rf tmp/_tar2 - -mk-install-dirs: $(cfg-prefix)/$(cfg-dir) $(bin-prefix)/$(bin-dir) \ - $(modules-prefix)/$(modules-dir) \ - $(audio-prefix)/$(audio-dir) \ - $(doc-prefix)/$(doc-dir) - -$(cfg-prefix)/$(cfg-dir): - mkdir -p $(cfg-prefix)/$(cfg-dir) - -$(bin-prefix)/$(bin-dir): - mkdir -p $(bin-prefix)/$(bin-dir) - -$(modules-prefix)/$(modules-dir): - mkdir -p $(modules-prefix)/$(modules-dir) - -$(audio-prefix)/$(audio-dir): - mkdir -p $(audio-prefix)/$(audio-dir) - -$(doc-prefix)/$(doc-dir): - mkdir -p $(doc-prefix)/$(doc-dir) - - ifeq '$(NAME)' '$(MAKECMDGOALS)' include $(DEPS) endif diff --git a/core/Makefile.defs b/core/Makefile.defs deleted file mode 100644 index 65ae7702..00000000 --- a/core/Makefile.defs +++ /dev/null @@ -1,156 +0,0 @@ - -#version number -VERSION = 0 -PATCHLEVEL = 10 -SUBLEVEL = 0 -EXTRAVERSION = -rc2 - -RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) - -LD_FLAGS = -lm - -OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]") - -ifeq ($(OS),solaris) - GETARCH=uname -p -else - GETARCH=uname -m -endif - -ARCH := $(shell $(GETARCH) |sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ - -e s/armv4l/arm/ -e "s/Power Macintosh/ppc/" \ - -e "s/cobalt/mips2/" \ - -e s/amd64/x86_64/ ) -# fix sparc -> sparc64 -ifeq ($(ARCH),sparc) - ifeq ($(shell uname -m),sun4u) - ARCH := sparc64 - endif -endif - -CPP_FLAGS = -Wall -Wno-reorder -fPIC -g \ - -O2 \ - -D_DEBUG \ - -D_THREAD_SAFE -D_REENTRANT \ - -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"'\ - -DOS='"$(OS)"' \ -# -DSUPPORT_IPV6 - -TARGET = -ifeq ($(OS), linux) - LD_FLAGS += -ldl -rdynamic -lpthread -else -ifeq ($(OS), freebsd) - LD_FLAGS += -rdynamic -pthread -else -ifeq ($(OS), openbsd) - LD_FLAGS += -rdynamic -pthread -else -ifeq ($(OS), netbsd) - LD_FLAGS += -rdynamic -pthread -else - LD_FLAGS+= -ldl -lsocket -lnsl -lpthread - TARGET=solaris -endif -endif -endif -endif - -LIB_LD_FLAGS = $(LD_FLAGS) -shared - -# install path is $(basedir) $(prefix) -# example: -# creating a bin. archive in /tmp, which unpacks in /usr/local -# basedir=/tmp -# prefix=/usr/local - -DESTDIR ?= /usr/local -PREFIX ?= $(DESTDIR) -LOCALBASE ?= /usr/local -prefix = $(PREFIX) -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 - -# 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) - -# dirs -cfg-dir = etc/sems/ - -bin-dir = sbin/ -modules-dir = lib/sems/plug-in/ -audio-dir = lib/sems/audio/ - -ifeq ($(OS), linux) - doc-dir = share/doc/sems/ - man-dir = share/man/ -else -ifeq ($(OS), freebsd) - doc-dir = share/doc/sems/ - man-dir = man/ -else -ifeq ($(OS), openbsd) - doc-dir = share/doc/sems/ - man-dir = man/ -else -ifeq ($(OS), netbsd) - doc-dir = share/doc/sems - man-dir = man/ -else - doc-dir = doc/sems/ - man-dir = man/ -endif -endif -endif -endif -# target dirs for various stuff -bin-target = $(prefix)/$(bin-dir) -cfg-target = $(prefix)/$(cfg-dir) -modules-target = $(prefix)/$(modules-dir) -audio-target = $(prefix)/$(audio-dir) - -ifeq ($(OS), solaris) -#use GNU versions -INSTALL ?= ginstall -TAR ?= gtar -else -INSTALL ?= install -TAR ?= tar -endif - -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 - -mk-install-dirs: $(cfg-prefix)/$(cfg-dir) $(bin-prefix)/$(bin-dir) \ - $(modules-prefix)/$(modules-dir) \ - $(audio-prefix)/$(audio-dir) \ - $(doc-prefix)/$(doc-dir) - -$(cfg-prefix)/$(cfg-dir): - mkdir -p $(cfg-prefix)/$(cfg-dir) - -$(bin-prefix)/$(bin-dir): - mkdir -p $(bin-prefix)/$(bin-dir) - -$(modules-prefix)/$(modules-dir): - mkdir -p $(modules-prefix)/$(modules-dir) - -$(audio-prefix)/$(audio-dir): - mkdir -p $(audio-prefix)/$(audio-dir) - -$(doc-prefix)/$(doc-dir): - mkdir -p $(doc-prefix)/$(doc-dir) - diff --git a/core/plug-in/Makefile.app_module b/core/plug-in/Makefile.app_module index 2e00022a..965d79c1 100644 --- a/core/plug-in/Makefile.app_module +++ b/core/plug-in/Makefile.app_module @@ -1,8 +1,11 @@ COREPATH ?=../.. +.DEFAULT_GOAL := all + include $(COREPATH)/../Makefile.defs ldflags = $(LIB_LD_FLAGS) $(module_ldflags) -cflags = -I $(COREPATH) $(CPP_FLAGS) $(module_cflags) +cflags = -I $(COREPATH) $(C_FLAGS) $(module_cflags) +cxxflags = -I $(COREPATH) $(CXX_FLAGS) $(module_cflags) app_module_dir = $(COREPATH)/lib @@ -17,7 +20,6 @@ hrds = $(wildcard *.h) objs = $(srcs:.cpp=.o) depends = $(srcs:.cpp=.d) -.DEFAULT_GOAL := all .PHONY: all all: $(extra_target) -@$(MAKE) deps && \ @@ -30,11 +32,11 @@ module_package: $(extra_target) .PHONY: clean -clean: $(extra_clean) - -@rm -f $(objs) $(depends) $(lib_name) +clean: + -@rm -f $(objs) $(depends) $(lib_name) $(extra_clean) .PHONY: deps -deps: $(depends) +deps: $(depends) $(extra_depends) .PHONY: install install: all $(extra_install) @@ -66,10 +68,10 @@ $(plug_in_name)_audio: $(audio-prefix)/$(audio-dir) %.d: %.cpp Makefile $(COREPATH)/plug-in/Makefile.app_module - g++ -MM $< $(cflags) > $@ + g++ -MM $< $(cxxflags) > $@ %.o: %.cpp %.d - g++ $(cflags) -c $< -o $@ + g++ $(cxxflags) -c $< -o $@ $(lib_full_name): $(lib_name) cp $(lib_name) $(lib_full_name) @@ -81,3 +83,6 @@ ifeq ($(lib_full_name),$(MAKECMDGOALS)) include $(depends) endif +ifeq (,$(MAKECMDGOALS)) +include $(depends) +endif diff --git a/core/plug-in/gsm/Makefile b/core/plug-in/gsm/Makefile index 0e4fb89e..5c92f201 100644 --- a/core/plug-in/gsm/Makefile +++ b/core/plug-in/gsm/Makefile @@ -3,7 +3,7 @@ COREPATH =../.. plug_in_name = gsm module_ldflags = -module_cflags = -I gsm-1.0-pl10/inc +module_cflags = -I gsm-1.0-pl10/inc -DHAS_STDLIB_H module_extra_objs = gsm-1.0-pl10/lib/libgsm.a diff --git a/core/plug-in/gsm/gsm-1.0-pl10/Makefile b/core/plug-in/gsm/gsm-1.0-pl10/Makefile index 9afbdda7..2aeb9d6a 100644 --- a/core/plug-in/gsm/gsm-1.0-pl10/Makefile +++ b/core/plug-in/gsm/gsm-1.0-pl10/Makefile @@ -300,7 +300,7 @@ install: toastinstall gsminstall # The basic API: libgsm $(LIBGSM): $(LIB) $(GSM_OBJECTS) - -rm $(RMFLAGS) $(LIBGSM) + -rm -f $(RMFLAGS) $(LIBGSM) $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS) $(RANLIB) $(LIBGSM) diff --git a/core/plug-in/ilbc/Makefile b/core/plug-in/ilbc/Makefile index 0002a4b3..4492f46f 100644 --- a/core/plug-in/ilbc/Makefile +++ b/core/plug-in/ilbc/Makefile @@ -40,4 +40,4 @@ $(ILBC_DIR)/libilbc.a:: .PHONY: clean_ilbclib clean_ilbclib: - cd $(ILBC_DIR); $(MAKE) clean + $(MAKE) -C $(ILBC_DIR) clean diff --git a/core/plug-in/uac_auth/Makefile b/core/plug-in/uac_auth/Makefile index 8b91c4e9..e6ea422a 100644 --- a/core/plug-in/uac_auth/Makefile +++ b/core/plug-in/uac_auth/Makefile @@ -3,19 +3,17 @@ plug_in_name = uac_auth module_extra_objs = md5.o +extra_depends = md5.d +extra_clean = md5.o md5.d + module_ldflags = module_cflags = -#md5.o: md5.c md5.d -# $(CC) $(cflags) -c $< -o $@ -# -#md5.d: md5.c md5.h Makefile -# $(CC) -MM $< $(cflags) > $@ - %.o : %.c %.d $(CC) $(cflags) -c $< -o $@ %.d : %.c %.h Makefile $(CC) -MM $< $(cflags) > $@ -include ../Makefile.app_module + +include ../Makefile.app_module