#******************************************************************************
#
#       Copyright:      2005-2010 Paul Obermeier (obermeier@tcl3d.org)
#
#                       See the file "Tcl3D_License.txt" for information on
#                       usage and redistribution of this file, and for a
#                       DISCLAIMER OF ALL WARRANTIES.
#
#       Module:         Tcl3D
#       Filename:       config_mingw
#
#       Author:         Paul Obermeier
#
#       Description:    Configuration file for Windows based systems using
#                       MinGW with gcc compiler.
#                       This file is included from the global Makefile.
#                       The syntax is based on GNU make.
#
#******************************************************************************

# Set the following variable to 1, if compiling with stubs.
WITH_STUBS = 1

# Set the following variable to 1, if compiling with debugging information.
# WITH_DEBUG = 1

INSTDIR = "C:/Program Files/Tcl"
TCLDIR  = "C:/Program Files/Tcl"
TKDIR   = "C:/Program Files/Tcl"

TCLMAJOR     = 8
TCLMINOR     = 5

INSTBIN  = $(INSTDIR)/bin
INSTLIB  = $(INSTDIR)/lib
INSTINC  = $(INSTDIR)/include

# Do not print out unused variables or functions, as this occurs very often
# in the auto-generated SWIG code.
WARNINGS = -Wall -Wno-unused-variable -Wno-unused-function

ifdef WITH_DEBUG
# Debug version
OPT = -g  -mieee-fp -ffloat-store $(WARNINGS)
DEBUG_SUFFIX=d
else
# Optimized version
OPT = -O2 -mieee-fp -ffloat-store $(WARNINGS) -Wuninitialized -DNDEBUG
DEBUG_SUFFIX=
endif

PPSTUBS   = -DUSE_TCL_STUBS -DUSE_TK_STUBS
PPNOSTUBS = -D$(OS_TYPE) -DWIN32 -D_WIN32

CC           = gcc -c
CXX          = g++ -c
MAKE         = make
LD           = gcc -rdynamic
LDOUT        = -o
SHLIB_LD     = gcc -shared
SHLIB_LDXX   = g++ -shared
SHLIB_CFLAGS = -fpic

OBJEXT   = .o
LIBEXT   = .lib
SHLIBEXT = .dll
BINEXT   = .exe
DSEP     = /

GLLIBS = -lglu32 -lopengl32

SYSLIBS = -luser32 -lgdi32 -lws2_32

TCLVERSION   = $(TCLMAJOR)$(TCLMINOR)
TCLINCDIR    = $(TCLDIR)/include
TKINCDIR     = $(TKDIR)/include
TCLLIBDIR    = $(TCLDIR)/lib
TKLIBDIR     = $(TKDIR)/lib
TCLSTUBLIBS  = $(TKLIBDIR)/tkstub$(TCLVERSION)$(LIBEXT) $(TCLLIBDIR)/tclstub$(TCLVERSION)$(LIBEXT)
TCLSTDLIBS   = $(TKLIBDIR)/tk$(TCLVERSION)$(LIBEXT) $(TCLLIBDIR)/tcl$(TCLVERSION)$(LIBEXT)
TCLSH        = tclsh$(TCLVERSION)

RM           = rm -f
RMDIR        = rm -rf
CP           = cp
CPDIR        = xcopy /E /I /Y /Q
MKDIR        = mkdir

INCL   = -I. -I$(TCLINCDIR)

ifdef WITH_STUBS
TCLLIBS = $(TCLSTUBLIBS)
PPDEFS  = $(PPNOSTUBS) $(PPSTUBS)
else
TCLLIBS = $(TCLSTDLIBS)
PPDEFS  = $(PPNOSTUBS)
endif

# Needed for Togl to identify platform
PPDEFS += -DTOGL_WGL

# Compile GLEW as static version.
PPDEFS += -DGLEW_STATIC

# Additional debugging options

# Debug tcl3dVector allocation and destruction.
# PPDEFS += -DDEBUG_VECTOR=1
