Makefile.defs
011dfa1d
 
 #version number
 VERSION = 0
 PATCHLEVEL = 10
 SUBLEVEL = 0
a65743e2
 EXTRAVERSION = -rc2
011dfa1d
 
 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
 
5eb6b49c
 # need OS specific for this ?
 GPP ?= g++
 GCC ?= gcc
 
95e5af35
 CXX_FLAGS ?= -Wall -Wno-reorder -fPIC -g \
a867a606
 	  -O2 \
 	  -D_DEBUG \
 	  -D_THREAD_SAFE -D_REENTRANT \
 	  -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"'\
 	  -DOS='"$(OS)"' 	\
 #	  -DSUPPORT_IPV6
 
95e5af35
 C_FLAGS ?= -Wall -fPIC -g \
011dfa1d
 	  -O2 \
 	  -D_DEBUG \
 	  -D_THREAD_SAFE -D_REENTRANT \
 	  -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"'\
 	  -DOS='"$(OS)"' 	\
 #	  -DSUPPORT_IPV6
 
f4d64a3d
 ifeq ($(DEBUG_PLAYOUT), yes)
 CXX_FLAGS +=  -DDEBUG_PLAYOUTBUF
c2d96d60
 endif
 
011dfa1d
 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)
ea56f2ae
 # for install-ser-cfg
 SERPREFIX ?= /opt/ser-sems
 ser-prefix = $(SERPREFIX)
011dfa1d
 
 # 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/
 
ea56f2ae
 ser-cfg-dir = etc/ser/
 
011dfa1d
 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)
ea56f2ae
 ser-cfg-target =$(ser-prefix)/$(ser-cfg-dir)
011dfa1d
 
 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
 
a867a606
 
 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)