# $Filename: C:\Software\Sfx3D\Makelin.def $
# $Revision: 1.2 $
# $Date: Thu Mar 23 14:29:42 2000 $
# $Author: schneider $
# $Log3: C:\Software\Sfx3D\qvcs\Makelin.efg $
# 
#   Makefiles
# 
# Revision 1.2  by: schneider  Rev date: Thu Mar 23 14:29:42 2000
#   GTS in Simulatorumgebung integriert
# 
# Revision 1.1  by: schneider  Rev date: Wed Feb 16 13:36:54 2000
#   Textures implemented
# 
# Revision 1.0  by: schneider  Rev date: Fri Jan 21 15:00:34 2000
#   Initial revision.
# 
# $Endlog$

##########################################
# 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/pta0/Sfx3D/

SOFTSHOPDIR = /home/pta0/SoftShop/

GLDIR   = /usr/local/

STDDIR  = /usr/

###########################################
# uncomment the following line 
# to compile with symbols
###########################################

DEBUG=1

###########################################
#  uncomment TCLTKSOURCE 
#  when using soucecode of Tcl/Tk
#  (otherwise use Bin-Package)
#  Perhaps you have to edit
#  Path or Version-Number (in LibName) !!
###########################################

TCLTKSOURCE=1

ifdef TCLTKSOURCE
TCLDIR = /usr/local/tcl8.0.5/
TKDIR  = /usr/local/tk8.0.5/
TIXDIR = /usr/local/Tix4.1.0/
else
TCLDIR = /usr/
TKDIR  = /usr/X11R6/
TIXDIR = /usr/X11R6/
endif

TCLLIB = tcl8.0
TCLDLL = libtcl8.0.so

TKLIB  = tk8.0
TKDLL  = libtk8.0.so

TIXLIB  = tix4.1.0
TIXDLL  = libtix4.1.0.so

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

SRCDIR        = $(ROOT)src/
GTSDIR        = $(ROOT)src-gts/
BINDIR        = $(ROOT)bin/
INCDIR        = $(ROOT)include/
LIBDIR        = $(ROOT)lib

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

SOFTINCDIR    = $(SOFTSHOPDIR)include/
SOFTLIBDIR    = $(SOFTSHOPDIR)lib/

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

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

O   = .o

LIB =
DLL = 

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     = -l$(BASICSLIBNAME)$(DLL)

IDLIBNAME  = identity
IDLIB      = $(IDLIBNAME)$(LIB)
IDDLL      = -l$(IDLIBNAME)$(DLL)

TTOOLLIBNAME = ttool
TTOOLLIB     = $(TTOOLLIBNAME)$(LIB)
TTOOLDLL     = -l$(TTOOLLIBNAME)$(DLL)

SIMTOOLLIBNAME = simtool
SIMTOOLLIB     = $(SIMTOOLLIBNAME)$(LIB)
SIMTOOLDLL     = -l$(SIMTOOLLIBNAME)$(DLL)

XMATHLIBNAME = xmath
XMATHLIB     = $(XMATHLIBNAME)$(LIB)
XMATHDLL     = -l$(XMATHLIBNAME)$(DLL)

EXECONTEXTLIBNAME = execon
EXECONTEXTLIB     = $(EXECONTEXTLIBNAME)$(LIB)
EXECONTEXTDLL     = -l$(EXECONTEXTLIBNAME)$(DLL)

NEWSIMCLIBNAME = newsimc
NEWSIMCLIB     = $(NEWSIMCLIBNAME)$(LIB)
NEWSIMCDLL     = -l$(NEWSIMCLIBNAME)$(DLL)

VIEWSLIBNAME = views
VIEWSLIB     = $(VIEWSLIBNAME)$(LIB)
VIEWSDLL     = -l$(VIEWSLIBNAME)$(DLL)

XGRAPHLIBNAME = xgraph
XGRAPHLIB     = $(XGRAPHLIBNAME)$(LIB)
XGRAPHDLL     = -l$(XGRAPHLIBNAME)$(DLL)

MAINLIBNAME = sfxkern
MAINLIB     = $(MAINLIBNAME)$(LIB)
MAINDLL     = -l$(MAINLIBNAME)$(DLL)

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

###########################################

CC      = g++
LD      = g++

IMPLIB  = 
RC      = 

CP      = cp
RM      = rm -f

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

ifndef DEBUG

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

else

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

endif

DEFINES = 

PROJECTCCFLAGS= $(DEBUGCCFLAGS) 

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

ifdef TCLTKSOURCE
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
##########################################

ifdef TCLTKSOURCE
LIBDIRS  = -L./ -L$(TCLDIR)unix -L$(TKDIR)unix -L$(TIXDIR)unix -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 % $(SRCDIR) $(GTSDIR)

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

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

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

$(DLL)$(LIB):

$(RC)$(RES):

