# $Source: /usr/local/SimSoft/Sfx3D/src/Makelin.def,v $
# $Revision: 1.2 $
# $Author: baum $
# $Date: 2001/11/29 15:18:09 $
#
# Login name of the user who locked the revision
# $Locker:  $
# Tag name used to checkout the file
# $Name:  $
# State assigned to revision
# $State: Exp $
#
#
# $Log: Makelin.def,v $
# Revision 1.2  2001/11/29 15:18:09  baum
# -Realzeitsteuerung eingebaut
# -Handsteuerung eingebaut
#

##########################################
# Project directories
#
# TMPDIR = location where object files 
#          should be stored during build
# ROOT   = top of source tree
# STDDIR = Borland-Compiler-Dir
# 
# GLDIR  = OpenGL-Install-Dir
#
##########################################

TMPDIR	= ./

ROOT	= $(HOME)/Sfx3D/

SOFTSHOPDIR = $(HOME)/SoftShop/

GLDIR   = /usr/local/

STDDIR  = /usr/

###########################################
# set the following line to 1
# to compile with debug symbols
###########################################

DEBUG     = 1

###########################################
#  set TCLTKSOURCE to 1
#  when using soucecode of Tcl/Tk
#  (otherwise use Bin-Package)
#  Perhaps you have to edit
#  Path or TCLVersion
###########################################

TCLDEBUG      = 0
TCLTKSOURCE   = 0

TCLVERSION    = 83
TCLMAJOR      = 8
TCLMINOR      = 3
TCLDOTVERSION = 8.3.2

TIXVERSION    = 81
TIXMAJOR      = 8
TIXMINOR      = 1
TIXDOTVERSION = 8.1.8.3

ifeq "$(TCLDEBUG)" "1"
DBGX = g
else
DBGX =
endif

# sorry, but Togl needs "TkWinChildProc"
# and this is not in the tk-stub-ext

ifeq "$(TCLVERSION)" "88888"
TCLTKDEFINES = USE_TCL_STUBS;USE_TK_STUBS
STUBPREFIX   = stub
else
TCLTKDEFINES =
STUBPREFIX   =
endif

ifeq "$(TCLTKSOURCE)" "1"
TCLDIR  = /usr/local/tcl$(TCLDOTVERSION)/
TKDIR   = /usr/local/tk$(TCLDOTVERSION)/
TIXDIR  = /usr/local/tix-$(TIXDOTVERSION)/
else
TCLDIR  = /usr/
TKDIR   = /usr/X11R6
TIXDIR  =
endif

TCLSTUBLIB = tcl$(STUBPREFIX)$(TCLMAJOR).$(TCLMINOR)$(DBGX)
TCLLIB     = tcl$(TCLMAJOR).$(TCLMINOR)$(DBGX)
TCLDLL     = libtcl$(TCLMAJOR).$(TCLMINOR)$(DBGX).so

TKSTUBLIB = tk$(STUBPREFIX)$(TCLMAJOR).$(TCLMINOR)$(DBGX)
TKLIB     = tk$(TCLMAJOR).$(TCLMINOR)$(DBGX)
TKDLL     = libtk$(TCLMAJOR).$(TCLMINOR)$(DBGX).so

TIXSTUBLIB = tix$(STUBPREFIX)$(TIXMAJOR).$(TIXMINOR).$(TCLMAJOR).$(TCLMINOR)$(DBGX)
TIXLIB     = tix$(TIXMAJOR).$(TIXMINOR).$(TCLMAJOR).$(TCLMINOR)$(DBGX)
TIXDLL     = libtix$(TIXMAJOR).$(TIXMINOR).$(TCLMAJOR).$(TCLMINOR)$(DBGX).so

###########################################
#  SoftShop Directories 
###########################################

GSLDIR        = $(ROOT)src/gsl/
GTSDIR        = $(ROOT)src/gts/
BINDIR        = $(ROOT)bin/
INCDIR        = $(ROOT)include/
LIBDIR        = $(ROOT)lib/

###########################################
#  SoftShop Directories 
###########################################

SOFTINCDIR     = $(SOFTSHOPDIR)include/
SOFTLIBDIR     = $(SOFTSHOPDIR)lib/
XGRAPHUTILSDIR = $(SOFTSHOPDIR)XGraph/utils/

###########################################
# file-extensions as macro 
###########################################

H   = .h
C   = .c
CPP = .cpp

O   = .o

LIB =
DLL = .so

E   = .e
CFG = .cfg

RC  = .rc
RES = .res

INI = .ini 

###########################################
#  libs to build and use
###########################################

GLLIB      = GL
GLDLL      = libGL$(DLL)

GLULIB     = GLU
GLUDLL     = libGLU$(DLL)

BASICSLIBNAME = basics
BASICSLIB     = $(BASICSLIBNAME)$(LIB)
BASICSDLL     = lib$(BASICSLIBNAME)$(DLL)

IDLIBNAME  = identity
IDLIB      = $(IDLIBNAME)$(LIB)
IDDLL      = lib$(IDLIBNAME)$(DLL)

TTOOLLIBNAME = ttool
TTOOLLIB     = $(TTOOLLIBNAME)$(LIB)
TTOOLDLL     = lib$(TTOOLLIBNAME)$(DLL)

SIMTOOLLIBNAME = simtool
SIMTOOLLIB     = $(SIMTOOLLIBNAME)$(LIB)
SIMTOOLDLL     = lib$(SIMTOOLLIBNAME)$(DLL)

XMATHLIBNAME = xmath
XMATHLIB     = $(XMATHLIBNAME)$(LIB)
XMATHDLL     = lib$(XMATHLIBNAME)$(DLL)

EXECONTEXTLIBNAME = execon
EXECONTEXTLIB     = $(EXECONTEXTLIBNAME)$(LIB)
EXECONTEXTDLL     = lib$(EXECONTEXTLIBNAME)$(DLL)

NEWSIMCLIBNAME = newsimc
NEWSIMCLIB     = $(NEWSIMCLIBNAME)$(LIB)
NEWSIMCDLL     = lib$(NEWSIMCLIBNAME)$(DLL)

VIEWSLIBNAME = views
VIEWSLIB     = $(VIEWSLIBNAME)$(LIB)
VIEWSDLL     = lib$(VIEWSLIBNAME)$(DLL)

XGRAPHLIBNAME = xgraph
XGRAPHLIB     = $(XGRAPHLIBNAME)$(LIB)
XGRAPHDLL     = lib$(XGRAPHLIBNAME)$(DLL)

MAINLIBNAME = sfxkern
MAINLIB     = $(MAINLIBNAME)$(LIB)
MAINDLL     = lib$(MAINLIBNAME)$(DLL)

###########################################
# Progs
###########################################

CC      = g++
LD      = g++

IMPLIB  = 
RC      = 

CP      = cp
RM      = rm -f

###########################################
# these macros cause maximum optimization
#  and no symbols
#
###########################################


ifeq "$(DEBUG)" "0"

DEBUGDEFINES = -DNDEBUG -DSHM
DEBUGLDFLAGS = 
DEBUGCCFLAGS = -O3 -mpentium -fPIC -fstrict-aliasing -fomit-frame-pointer -ffast-math \
               -funroll-loops -fschedule-insns2

else

# these macros enable debugging
DEBUGDEFINES = -D_DEBUG
DEBUGLDFLAGS = -g
DEBUGCCFLAGS = -ansi -pedantic -ggdb3 -fPIC -Wall -Wtraditional -Wpointer-arith \
               -Wcast-align -Wstrict-prototypes -Woverloaded-virtual 

endif

DEFINES = $(DEBUGDEFINES)

PROJECTCCFLAGS= $(DEBUGCCFLAGS) 

########################################## 
# some INCLUDES
##########################################

ifeq "$(TCLTKSOURCE)" "1"
TCLTK_INCLUDES  = -I$(TIXDIR)generic -I$(TCLDIR)generic -I$(TKDIR)generic -I$(TKDIR)unix 
else
TCLTK_INCLUDES  = -I$(TIXDIR)include -I$(TCLDIR)include -I$(TKDIR)include
endif

STD_INCLUDES    = -I$(GLDIR)include -I$(INCDIR) -I$(SOFTINCDIR) -I$(STDDIR)include

########################################## 
# the LIBDIRS
##########################################

ifeq "$(TCLTKSOURCE)" "1"
LIBDIRS  = -L./ -L$(TCLDIR)unix -L$(TKDIR)unix -L$(TIXDIR)unix/tk$(TCLMAJOR).$(TCLMINOR) -L$(GLDIR)lib \
           -L$(LIBDIR) -L$(SOFTLIBDIR) -L$(STDDIR)lib -L$(STDDIR)X11R6/lib
else
LIBDIRS  = -L./ -L$(TCLDIR)lib -L$(TKDIR)lib -L$(TIXDIR)lib -L$(GLDIR)lib\
           -L$(LIBDIR) -L$(SOFTLIBDIR) -L$(STDDIR)lib -L$(STDDIR)X11R6/lib
endif

########################################## 
# compiler and linker flags
##########################################

LNFLAGS_exe = -o $@ $(LIBDIRS) $(DEBUGLDFLAGS)

LNFLAGS_dll = -shared -fPIC -o $@ $(LIBDIRS) $(DEBUGLDFLAGS)

STD_LNLIBS_dll =  -lstdc++ -lc

STD_LNLIBS_exe =  -lstdc++ -lc

########################################## 
# Global makefile settings an objects
##########################################

#.AUTODEPEND
#.CACHEAUTODEPEND

.SUFFIXES: $(H) $(C) $(CPP) $(O) $(LIB) $(DLL) $(E)

  vpath % $(GSLDIR) $(GTSDIR) $(XGRAPHUTILSDIR)

###########################################
# Implicit Targets
###########################################

$(C)$(O):
	$(CC) -c $(PROJECTCCFLAGS) $(DEFINES) $< $(INCLUDES) 

$(CPP)$(O):
	$(CC) -c $(PROJECTCCFLAGS) $(DEFINES) $< $(INCLUDES) 

$(DLL)$(LIB):

$(RC)$(RES):

