########################################################-*-mode:Makefile-*-
##                                                                       ##
##  Edinburgh Speech Tools: local configuration file                     ##
##                                                                       ##
###########################################################################
##
##  Specific config file for local installation
##
##  This file will be included by all Makefiles in the system
##  The variables TOP, DIRNAME and FILES will always be set
##  when this file is included
##

## Select one of these compilers

COMPILER=GCC
# COMPILER=SUN_CC

## turn on some of these options to control compilation.
## OPTIMISE=4 turns off DEBUG

OPTIMISE=3
WARN=1
# VERBOSE=1
# DEBUG=1

## options

## AUDIO
## various audio devices are supported directly but you can always
## specify a program to play files in a diesired format.
## NAS is thoroughly recommended, of the following ones only
## one can be supported in any particular compilation as they
## are OS/hardware dependent.

## NCD's network audio system, you will probably have to 
## fix the locations of NAS libraries later in the file
# INCLUDE_NAS=1
## Sun's 16 bit linear audio 
#INCLUDE_SUN16=1
## FreeBSD's 16 bit linear audio 
#INCLUDE_FREEBSD16=1
## Linux's 16 bit linear audio 
#INCLUDE_LINUX16=1
## SGI's 16 bit linear audio
#INCLUDE_IRIX=1
## Windows (95 or NT) mplayer application
#INCLUDE_MPLAYER=1
## Windows (95 or NT) builtin direct audio
#INCLUDE_WIN32AUDIO=1

## descriptions of different compiling environments. 

ifeq ($(COMPILER),GCC)
## GNU gcc (G++) available on most systems
	CC=gcc
	CXX =gcc -fno-implicit-templates

	CFLAGS  = 
	CXXFLAGS  =
	DEBUG_CCFLAGS = -g
	DEBUG_CXXFLAGS =  -g
	WARN_CCFLAGS = -Wall
	WARN_CXXFLAGS =-Wall
	VERBOSE_CCFLAGS =
	VERBOSE_CXXFLAGS = 
	OPTIMISE_CCFLAGS = -O$(OPTIMISE)
	OPTIMISE_CXXFLAGS = -O$(OPTIMISE)

        TEMPLATE_SPECIFIC = -DINSTANTIATE_TEMPLATES
	TEMPLATE_ARGS= 

	## special ways of doing things, blank means default

	MAKE_DEPEND = 
	BUILD_LIB = 
	INDEX_LIB = 

	COMPILERLIBS= -lstdc++
else
ifeq ($(COMPILER),SUN_CC)
## Sun's CC/cc available on Solaris and SunOS
	CC = /opt/SUNWspro/bin/cc
	CXX = /opt/SUNWspro/bin/CC 

	CFLAGS =
	CXXFLAGS = -D__svr4__

	DEBUG_CCFLAGS = -g
	DEBUG_CXXFLAGS =  -g
	WARN_CCFLAGS = +w +w2
	WARN_CXXFLAGS = +w +w2
	VERBOSE_CCFLAGS =
	VERBOSE_CXXFLAGS = -ptv
	OPTIMISE_CCFLAGS = -xO$(OPTIMISE)
	OPTIMISE_CXXFLAGS = -O$(OPTIMISE)

	TEMPLATE_ARGS= $(TEMPLATE_DIRS:%=-pti$(TOP)/%) -ptr$(TOP) 

	## special ways of doing things, blank means default

	MAKE_DEPEND = $(CXX) $(INCLUDES) $(TEMPLATES) -xM1
	BUILD_LIB = $(CXX) $(TEMPLATES) -xar -o
	INDEX_LIB = \#

	COMPILERLIBS=
else
error:
	@echo NO COMPILER SELECTED
	@false
all: error
depend: error
endif
endif

AR = ar
# This is used within CSTR for RCS access, if you wont use RCS leave as is
# this needs to be GNU test (which supports the -nt option)
TEST = /usr/local/GNU/bin/test
INSTALL_PROG = install
# On Solaris (and other SYSV) use true, while others need the real thing
RANLIB = ranlib
# If you are going to have multiple architectures using the same 
# library directory you should set this, it may already be set anyway
# some environments (note uname wont distinguish between sparcs and i386
# in Solaris)
#OSTYPE=`uname`

## Installation directories
prefix=/usr/local
BINDIR=$(prefix)/bin
LIBDIR=$(prefix)/lib
INCDIR=$(prefix)/include
MANDIR=$(prefix)/man

# Solaris needs the following
# SOCKET_LIBS = -lsocket -lnsl -ldl

## NCD's network audio system change it if required
ifdef INCLUDE_NAS
ifneq ($(INCLUDE_NAS),0)
	NADIR = /usr/X11R6
	NAINC = -I$(NADIR)/include
	NALIB = -L$(NADIR)/lib -laudio -L/usr/X11R6/lib -lXau
	AUDIODEFS += -DSUPPORT_NAS
endif
endif
## Sun's 16 linear audio (on later Sun machines)
ifdef INCLUDE_SUN16
ifneq ($(INCLUDE_SUN16),0)
	AUDIODEFS += -DSUPPORT_SUN16
endif
endif
## FreeBSD's 16 linear audio
ifdef INCLUDE_FREEBSD16
ifneq ($(INCLUDE_FREEBSD16),0)
	AUDIODEFS += -DSUPPORT_FREEBSD16
endif
endif
## Linux's 16 linear audio
ifdef INCLUDE_LINUX16
ifneq ($(INCLUDE_LINUX16),0)
	AUDIODEFS += -DSUPPORT_LINUX16
endif
endif
## SGI's 16 bit linear audio
## If you compile in Netaudio and SGI's audio you'll have to be
## careful with the library name, and give full pathnames
ifdef INCLUDE_IRIX
ifneq ($(INCLUDE_IRIX),0)
	SGIALIB = -laudio
	AUDIODEFS += -DSUPPORT_IRIX
endif
endif
## Windows (95 or NT) mplayer application
ifdef INCLUDE_MPLAYER
ifneq ($(INCLUDE_MPLAYER),0)
	AUDIODEFS += -DSUPPORT_MPLAYER
endif
endif
## Windows (95 or NT) direct audio
ifdef INCLUDE_WIN32AUDIO
ifneq ($(INCLUDE_WIN32AUDIO),0)
	AUDIODEFS += -DSUPPORT_WIN32AUDIO
	WIN32ALIB = -lwinmm
endif
endif

## Collect together all audio subsystem vars (defined or not)
AUDIOINC  = $(NAINC)
AUDIOLIBS  = $(NALIB) $(WIN32ALIB) $(SGIALIB) $(SOCKET_LIBS)
AUDIOFLAGS = $(AUDIOINC) $(AUDIODEFS)

## Collect together all file format subsystem vars (defined or not)
FILEFORMATLIBS =
FILEFORMATINC =
FILEFORMATFLAGS = $(FILEFORMATINC) $(FILEFORMATDEFS)

## SunOS seems to need this
#OSLIBS = -ldl
## Older versions of solaris (2.3 2.4) may need these
#OSLIBS = /usr/ucblib/libucb.a

ESTLIB = -L$(TOP)/lib -lestools -leststring

INCLUDES = $(LOCAL_INCLUDES) -I$(TOP)/include $(DEFINES)
TEMPLATES= $(LOCAL_TEMPLATES) $(TEMPLATE_ARGS)
LIBS = $(LOCAL_LIBS) $(COMPILERLIBS) $(DEBUG_LIBS) -lm $(OSLIBS)

