#******************************************************************************
#
#       Copyright:      2009-2014 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 -> tcl3dOsg
#       Filename:       Makefile
#
#       Author:         Paul Obermeier
#
#       Description:    Makefile for the tcl3dOsg subpackage.
#                       The syntax is based on GNU make.
#
#******************************************************************************

# OPENSCENEGRAPH_SOVERSION 25 corresponds to OSG 2.2.0
# OPENSCENEGRAPH_SOVERSION 35 corresponds to OSG 2.4.0
# OPENSCENEGRAPH_SOVERSION 44 corresponds to OSG 2.6.0
# OPENSCENEGRAPH_SOVERSION 48 corresponds to OSG 2.6.1
# OPENSCENEGRAPH_SOVERSION 55 corresponds to OSG 2.8.0, 2.8.1 and 2.8.2
# OPENSCENEGRAPH_SOVERSION 80 corresponds to OSG 3.0.0, 3.0.1 

.PHONY: all install clean distclean \
        osg osganimation osgdb osgfx osgga osgmanipulator osgparticle \
	osgsim osgshadow osgterrain osgtext osgutil osgviewer osgvolume

include ../make.oscheck
include ../make.macros
include ../make.wrap

# The key file name to detect whether Tcl3D could be wrapped
# with OSG support. If this file does not exist, we can not wrap
# the OSG library, even if WRAP_OSG has been defined in make.wrap.
KEY_OSG  = include/osg/Object

HAVE_OSG =
ifdef WRAP_OSG
HAVE_OSG = $(strip $(wildcard $(KEY_OSG)))
endif

OSGLIBS =
ifneq (,$(HAVE_OSG))
PPDEFS += -DUSE_OSG_IF

ifeq (win32,$(KERNEL))
ifdef WITH_DEBUG
# This overwrites the globally set -MD
OPT += -MDd
endif

# Check OpenThreads/Config file for correct setting.
PPDEFS += -D_OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED

OSGLIBS = lib$(DSEP)osg$(DEBUG_SUFFIX)$(LIBEXT) \
	  lib$(DSEP)osgAnimation$(DEBUG_SUFFIX)$(LIBEXT) \
	  lib$(DSEP)osgDB$(DEBUG_SUFFIX)$(LIBEXT) \
	  lib$(DSEP)osgFX$(DEBUG_SUFFIX)$(LIBEXT) \
	  lib$(DSEP)osgGA$(DEBUG_SUFFIX)$(LIBEXT) \
	  lib$(DSEP)osgManipulator$(DEBUG_SUFFIX)$(LIBEXT) \
	  lib$(DSEP)osgParticle$(DEBUG_SUFFIX)$(LIBEXT) \
	  lib$(DSEP)osgSim$(DEBUG_SUFFIX)$(LIBEXT) \
	  lib$(DSEP)osgShadow$(DEBUG_SUFFIX)$(LIBEXT) \
	  lib$(DSEP)osgTerrain$(DEBUG_SUFFIX)$(LIBEXT) \
	  lib$(DSEP)osgText$(DEBUG_SUFFIX)$(LIBEXT) \
	  lib$(DSEP)osgUtil$(DEBUG_SUFFIX)$(LIBEXT) \
	  lib$(DSEP)osgViewer$(DEBUG_SUFFIX)$(LIBEXT) \
	  lib$(DSEP)osgVolume$(DEBUG_SUFFIX)$(LIBEXT)

OPENTHREADLIBS = \
	  lib/OpenThreads$(DEBUG_SUFFIX)$(LIBEXT)

else
# Unix systems
ifeq (Darwin,$(KERNEL))
ifeq (yes,$(HAVE_DARWIN_10_4))
    PPDEFS += -D_OPENTHREADS_ATOMIC_USE_MUTEX
else
    PPDEFS += -D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS
endif
endif
ifeq (Linux,$(KERNEL))
ifeq (x86_64,$(MACHINE))
# SuSE 10.2 64-bit 
PPDEFS += -D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS
else
PPDEFS += -D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS
# SuSE 10.2 and 11.1 32-bit 
#PPDEFS += -D_OPENTHREADS_ATOMIC_USE_MUTEX
endif
endif
ifeq (IRIX64,$(KERNEL))
PPDEFS += -D_OPENTHREADS_ATOMIC_USE_MUTEX
endif
OSGLIBS = -L../extlibs/$(OS_TYPE)/OSG \
          -losg$(DEBUG_SUFFIX) \
          -losgAnimation$(DEBUG_SUFFIX) \
          -losgDB$(DEBUG_SUFFIX) \
          -losgFX$(DEBUG_SUFFIX) \
          -losgGA$(DEBUG_SUFFIX) \
          -losgManipulator$(DEBUG_SUFFIX) \
          -losgParticle$(DEBUG_SUFFIX) \
          -losgSim$(DEBUG_SUFFIX) \
          -losgShadow$(DEBUG_SUFFIX) \
          -losgTerrain$(DEBUG_SUFFIX) \
          -losgText$(DEBUG_SUFFIX) \
          -losgUtil$(DEBUG_SUFFIX) \
          -losgViewer$(DEBUG_SUFFIX) \
          -losgVolume$(DEBUG_SUFFIX)

OPENTHREADLIBS = \
          -L../extlibs/$(OS_TYPE)/OSG -lOpenThreads$(DEBUG_SUFFIX)

endif
endif

ALL_LIBS =  \
            $(OPENTHREADLIBS) \
            $(OSGLIBS) \
            $(TCLLIBS) \
            $(GLLIBS) \
            $(SYSLIBS)

WRAPOBJS = \
        tcl3dOsg_wrap$(OBJEXT) \
        tcl3dOsgAnimation_wrap$(OBJEXT) \
        tcl3dOsgDB_wrap$(OBJEXT) \
        tcl3dOsgFX_wrap$(OBJEXT) \
        tcl3dOsgGA_wrap$(OBJEXT) \
        tcl3dOsgManipulator_wrap$(OBJEXT) \
        tcl3dOsgOpenThreads_wrap$(OBJEXT) \
        tcl3dOsgParticle_wrap$(OBJEXT) \
        tcl3dOsgSim_wrap$(OBJEXT) \
        tcl3dOsgShadow_wrap$(OBJEXT) \
        tcl3dOsgTerrain_wrap$(OBJEXT) \
        tcl3dOsgText_wrap$(OBJEXT) \
        tcl3dOsgUtil_wrap$(OBJEXT) \
        tcl3dOsgViewer_wrap$(OBJEXT) \
        tcl3dOsgVolume_wrap$(OBJEXT)

# Suppress some warnings, which makes reading the output difficult.
# w302: Identifier 'name' redefined (ignored).
# w312: Unnamed nested class not currently supported (ignored).
# w325: Nested class not currently supported (name ignored).
# w503: Can't wrap 'identifier' unless renamed to a valid identifier.
# w509: Overloaded method declaration effectively ignored, as it is shadowed by declaration
SWIG_WARN = -w302 -w312 -w325 -w503 -w509

SWIG_OSG_FILES = \
        $(COMMON_SWIGFILES) \
        swigfiles/tcl3dMixinVector.i \
        swigfiles/tcl3dStdVector.i \
        swigfiles/osgHeader.i \
        swigfiles/osgOpenThreads.i \
        swigfiles/osgBasic.i \
        swigfiles/osg.i \
        swigfiles/tcl3dOsg.i \
        swigfiles/tcl3dOsgCameraCallback.i \
        swigfiles/tcl3dOsgNodeCallback.i \
        swigfiles/tcl3dOsgNodeVisitor.i

SWIG_OSGANIMATION_FILES = \
        $(COMMON_SWIGFILES) \
        swigfiles/osgHeader.i \
        swigfiles/osgAnimationHeader.i \
        swigfiles/osg.i \
        swigfiles/osgAnimation.i \
        swigfiles/tcl3dOsgAnimation.i

SWIG_OSGDB_FILES = \
        $(COMMON_SWIGFILES) \
        swigfiles/osgHeader.i \
        swigfiles/osgDBHeader.i \
        swigfiles/osg.i \
        swigfiles/osgDB.i \
        swigfiles/tcl3dOsgDB.i

SWIG_OSGFX_FILES = \
        $(COMMON_SWIGFILES) \
        swigfiles/osgHeader.i \
        swigfiles/osgFXHeader.i \
        swigfiles/osg.i \
        swigfiles/osgFX.i \
        swigfiles/tcl3dOsgFX.i

SWIG_OSGGA_FILES = \
        $(COMMON_SWIGFILES) \
        swigfiles/osgHeader.i \
        swigfiles/osgGAHeader.i \
        swigfiles/osg.i \
        swigfiles/osgGA.i \
        swigfiles/tcl3dOsgGA.i

SWIG_OSGMANIPULATOR_FILES = \
        $(COMMON_SWIGFILES) \
        swigfiles/osgHeader.i \
        swigfiles/osgManipulatorHeader.i \
        swigfiles/osg.i \
        swigfiles/osgManipulator.i \
        swigfiles/tcl3dOsgManipulator.i

SWIG_OSGOPENTHREADS_FILES = \
        $(COMMON_SWIGFILES) \
        swigfiles/osgOpenThreadsHeader.i \
        swigfiles/osgOpenThreads.i \
        swigfiles/tcl3dOsgOpenThreads.i

SWIG_OSGPARTICLE_FILES = \
        $(COMMON_SWIGFILES) \
        swigfiles/osgHeader.i \
        swigfiles/osgParticleHeader.i \
        swigfiles/osg.i \
        swigfiles/osgParticle.i \
        swigfiles/tcl3dOsgParticle.i

SWIG_OSGSIM_FILES = \
        $(COMMON_SWIGFILES) \
        swigfiles/osgHeader.i \
        swigfiles/osgSimHeader.i \
        swigfiles/osg.i \
        swigfiles/osgSim.i \
        swigfiles/tcl3dOsgSim.i

SWIG_OSGSHADOW_FILES = \
        $(COMMON_SWIGFILES) \
        swigfiles/osgHeader.i \
        swigfiles/osgShadowHeader.i \
        swigfiles/osg.i \
        swigfiles/osgShadow.i \
	swigfiles/tcl3dOsgShadow.i

SWIG_OSGTERRAIN_FILES = \
        $(COMMON_SWIGFILES) \
        swigfiles/osgHeader.i \
        swigfiles/osgTerrainHeader.i \
        swigfiles/osg.i \
        swigfiles/osgTerrain.i \
        swigfiles/tcl3dOsgTerrain.i

SWIG_OSGTEXT_FILES = \
        $(COMMON_SWIGFILES) \
        swigfiles/osgHeader.i \
        swigfiles/osgTextHeader.i \
        swigfiles/osg.i \
        swigfiles/osgText.i \
        swigfiles/tcl3dOsgText.i

SWIG_OSGUTIL_FILES = \
        $(COMMON_SWIGFILES) \
        swigfiles/osgHeader.i \
        swigfiles/osgUtilHeader.i \
        swigfiles/osg.i \
        swigfiles/osgUtil.i \
        swigfiles/tcl3dOsgUtil.i

SWIG_OSGVIEWER_FILES = \
        $(COMMON_SWIGFILES) \
        swigfiles/osgHeader.i \
        swigfiles/osgViewerHeader.i \
        swigfiles/osg.i \
        swigfiles/osgViewer.i \
        swigfiles/tcl3dOsgViewer.i

SWIG_OSGVOLUME_FILES = \
        $(COMMON_SWIGFILES) \
        swigfiles/osgHeader.i \
        swigfiles/osgVolumeHeader.i \
        swigfiles/osg.i \
        swigfiles/osgVolume.i \
        swigfiles/tcl3dOsgVolume.i

WRAPSRCS = $(WRAPOBJS:$(OBJEXT)=.cpp)
ALL_SRCS = $(WRAPSRCS)

PKG_NAME           = tcl3dOsg
PKG_OSG            = $(PKG_NAME)$(SHLIBEXT)
PKG_OSGANIMATION   = $(PKG_NAME)Animation$(SHLIBEXT)
PKG_OSGDB          = $(PKG_NAME)DB$(SHLIBEXT)
PKG_OSGFX          = $(PKG_NAME)FX$(SHLIBEXT)
PKG_OSGGA          = $(PKG_NAME)GA$(SHLIBEXT)
PKG_OSGMANIPULATOR = $(PKG_NAME)Manipulator$(SHLIBEXT)
PKG_OSGOPENTHREADS = $(PKG_NAME)OpenThreads$(SHLIBEXT)
PKG_OSGPARTICLE    = $(PKG_NAME)Particle$(SHLIBEXT)
PKG_OSGSIM         = $(PKG_NAME)Sim$(SHLIBEXT)
PKG_OSGSHADOW      = $(PKG_NAME)Shadow$(SHLIBEXT)
PKG_OSGTERRAIN     = $(PKG_NAME)Terrain$(SHLIBEXT)
PKG_OSGTEXT        = $(PKG_NAME)Text$(SHLIBEXT)
PKG_OSGUTIL        = $(PKG_NAME)Util$(SHLIBEXT)
PKG_OSGVIEWER      = $(PKG_NAME)Viewer$(SHLIBEXT)
PKG_OSGVOLUME      = $(PKG_NAME)Volume$(SHLIBEXT)
PKG_LIBS           = $(PKG_OSG) \
		     $(PKG_OSGANIMATION) \
		     $(PKG_OSGDB) \
		     $(PKG_OSGFX) \
	       	     $(PKG_OSGGA)  \
	       	     $(PKG_OSGMANIPULATOR)  \
	       	     $(PKG_OSGOPENTHREADS)  \
	       	     $(PKG_OSGPARTICLE)  \
	       	     $(PKG_OSGSIM)  \
	       	     $(PKG_OSGSHADOW) \
	       	     $(PKG_OSGTERRAIN) \
	       	     $(PKG_OSGTEXT) \
	       	     $(PKG_OSGUTIL) \
	       	     $(PKG_OSGVIEWER) \
	       	     $(PKG_OSGVOLUME)

ifeq (yes,$(HAVE_VS2008))
    # MS Visual Studio Express 2008 does not generate correct code when
    # compiling the wrapper code of OpensceneGraph with global optimization.
    # So we switch optimization off for the tcl3dOsg module.
    OPT += /Od
endif
ifeq (Darwin,$(KERNEL))
    OPT += -O0
endif

PPDEFS += $(TCLSTUBS)

CFLAGS = $(OPT) $(PPDEFS) -I$(GL_INCDIR) -Iinclude $(INCL)   

.SUFFIXES:                    # Delete the default suffixes.
.SUFFIXES: .cpp $(OBJEXT) .h  # Install our own suffixes.

.cpp$(OBJEXT):
	$(CXX) $(CFLAGS) $<

all: osg osganimation osgdb osgfx osgga osgmanipulator osgopenthreads \
     osgparticle osgsim osgshadow osgterrain osgtext osgutil osgviewer \
     osgvolume

osg:            $(PKG_OSG)
osganimation:   $(PKG_OSGANIMATION)
osgdb:          $(PKG_OSGDB)
osgfx:          $(PKG_OSGFX)
osgga:          $(PKG_OSGGA)
osgmanipulator: $(PKG_OSGMANIPULATOR)
osgopenthreads: $(PKG_OSGOPENTHREADS)
osgparticle:    $(PKG_OSGPARTICLE)
osgsim:         $(PKG_OSGSIM)
osgshadow:      $(PKG_OSGSHADOW)
osgterrain:     $(PKG_OSGTERRAIN)
osgtext:        $(PKG_OSGTEXT)
osgutil:        $(PKG_OSGUTIL)
osgviewer:      $(PKG_OSGVIEWER)
osgvolume:      $(PKG_OSGVOLUME)

install:
	-$(MKDIR) $(TCL3D_INSTLIB)
	-$(MKDIR) $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) $(PKG_OSG)                        $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) $(PKG_OSGANIMATION)               $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) $(PKG_OSGDB)                      $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) $(PKG_OSGFX)                      $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) $(PKG_OSGGA)                      $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) $(PKG_OSGMANIPULATOR)             $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) $(PKG_OSGOPENTHREADS)             $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) $(PKG_OSGPARTICLE)                $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) $(PKG_OSGSIM)                     $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) $(PKG_OSGSHADOW)                  $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) $(PKG_OSGTERRAIN)                 $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) $(PKG_OSGTEXT)                    $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) $(PKG_OSGUTIL)                    $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) $(PKG_OSGVIEWER)                  $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) $(PKG_OSGVOLUME)                  $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) tclfiles$(DSEP)tcl3dOsgQuery.tcl  $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) tclfiles$(DSEP)tcl3dOsgUtil.tcl   $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) tclfiles$(DSEP)tcl3dOsgKeysym.tcl $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) tclfiles$(DSEP)tcl3dOsgBitmaps.tcl $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) tclfiles$(DSEP)pkgIndex.tcl       $(TCL3D_INSTLIB)$(DSEP)$(PKG_NAME)
	$(CP) ..$(DSEP)pkgIndex.tcl             $(TCL3D_INSTLIB)

clean:
	-$(RM) $(WRAPOBJS)
	-$(RM) $(WRAPSRCS)
	-$(RM) $(VC_CLEANUP_FILES)

distclean: clean
	-$(RM) $(PKG_LIBS)
	-$(RMDIR) tests$(DSEP)testOut

tcl3dOsg_wrap.cpp: $(SWIG_OSG_FILES)
	swig -c++ -tcl -pkgversion $(VERSION) $(PPDEFS) $(SWIG_WARN) \
             -namespace -prefix osg \
             -I../tcl3dOgl/swigfiles -I../swigfiles -Iswigfiles \
	     -Iinclude -I$(GL_INCDIR) $(INCL) \
             -o $@ swigfiles/tcl3dOsg.i

tcl3dOsgDB_wrap.cpp: $(SWIG_OSGDB_FILES)
	-swig -c++ -tcl -pkgversion $(VERSION) $(PPDEFS) $(SWIG_WARN) \
             -namespace -prefix osgDB \
             -I../swigfiles -Iswigfiles -Iinclude -I$(GL_INCDIR) $(INCL) \
             -o $@ swigfiles/tcl3dOsgDB.i

tcl3dOsgAnimation_wrap.cpp: $(SWIG_OSGANIMATION_FILES)
	-swig -c++ -tcl -pkgversion $(VERSION) $(PPDEFS) $(SWIG_WARN) \
             -namespace -prefix osgAnimation \
             -I../swigfiles -Iswigfiles -Iinclude -I$(GL_INCDIR) $(INCL) \
             -o $@ swigfiles/tcl3dOsgAnimation.i

tcl3dOsgFX_wrap.cpp: $(SWIG_OSGFX_FILES)
	-swig -c++ -tcl -pkgversion $(VERSION) $(PPDEFS) $(SWIG_WARN) \
             -namespace -prefix osgFX \
             -I../swigfiles -Iswigfiles -Iinclude -I$(GL_INCDIR) $(INCL) \
             -o $@ swigfiles/tcl3dOsgFX.i

tcl3dOsgGA_wrap.cpp: $(SWIG_OSGGA_FILES)
	-swig -c++ -tcl -pkgversion $(VERSION) $(PPDEFS) $(SWIG_WARN) \
             -namespace -prefix osgGA \
             -I../swigfiles -Iswigfiles -Iinclude -I$(GL_INCDIR) $(INCL) \
             -o $@ swigfiles/tcl3dOsgGA.i

tcl3dOsgManipulator_wrap.cpp: $(SWIG_OSGMANIPULATOR_FILES)
	-swig -c++ -tcl -pkgversion $(VERSION) $(PPDEFS) $(SWIG_WARN) \
             -namespace -prefix osgManipulator \
             -I../swigfiles -Iswigfiles -Iinclude -I$(GL_INCDIR) $(INCL) \
             -o $@ swigfiles/tcl3dOsgManipulator.i

tcl3dOsgOpenThreads_wrap.cpp: $(SWIG_OSGOPENTHREADS_FILES)
	-swig -c++ -tcl -pkgversion $(VERSION) $(PPDEFS) $(SWIG_WARN) \
             -namespace -prefix osgOpenThreads \
             -I../swigfiles -Iswigfiles -Iinclude -I$(GL_INCDIR) $(INCL) \
             -o $@ swigfiles/tcl3dOsgOpenThreads.i

tcl3dOsgParticle_wrap.cpp: $(SWIG_OSGPARTICLE_FILES)
	-swig -c++ -tcl -pkgversion $(VERSION) $(PPDEFS) $(SWIG_WARN) \
             -namespace -prefix osgParticle \
             -I../swigfiles -Iswigfiles -Iinclude -I$(GL_INCDIR) $(INCL) \
             -o $@ swigfiles/tcl3dOsgParticle.i

tcl3dOsgSim_wrap.cpp: $(SWIG_OSGSIM_FILES)
	-swig -c++ -tcl -pkgversion $(VERSION) $(PPDEFS) $(SWIG_WARN) \
             -namespace -prefix osgSim \
             -I../swigfiles -Iswigfiles -Iinclude -I$(GL_INCDIR) $(INCL) \
             -o $@ swigfiles/tcl3dOsgSim.i

tcl3dOsgShadow_wrap.cpp: $(SWIG_OSGSHADOW_FILES)
	-swig -c++ -tcl -pkgversion $(VERSION) $(PPDEFS) $(SWIG_WARN) \
             -namespace -prefix osgShadow \
             -I../swigfiles -Iswigfiles -Iinclude -I$(GL_INCDIR) $(INCL) \
             -o $@ swigfiles/tcl3dOsgShadow.i

tcl3dOsgTerrain_wrap.cpp: $(SWIG_OSGTERRAIN_FILES)
	-swig -c++ -tcl -pkgversion $(VERSION) $(PPDEFS) $(SWIG_WARN) \
             -namespace -prefix osgTerrain \
             -I../swigfiles -Iswigfiles -Iinclude -I$(GL_INCDIR) $(INCL) \
             -o $@ swigfiles/tcl3dOsgTerrain.i

tcl3dOsgText_wrap.cpp: $(SWIG_OSGTEXT_FILES)
	-swig -c++ -tcl -pkgversion $(VERSION) $(PPDEFS) $(SWIG_WARN) \
             -namespace -prefix osgText \
             -I../swigfiles -Iswigfiles -Iinclude -I$(GL_INCDIR) $(INCL) \
             -o $@ swigfiles/tcl3dOsgText.i

tcl3dOsgUtil_wrap.cpp: $(SWIG_OSGUTIL_FILES)
	-swig -c++ -tcl -pkgversion $(VERSION) $(PPDEFS) $(SWIG_WARN) \
             -namespace -prefix osgUtil \
             -I../swigfiles -Iswigfiles -Iinclude -I$(GL_INCDIR) $(INCL) \
             -o $@ swigfiles/tcl3dOsgUtil.i

tcl3dOsgViewer_wrap.cpp: $(SWIG_OSGVIEWER_FILES)
	swig -c++ -tcl -pkgversion $(VERSION) $(PPDEFS) $(SWIG_WARN) \
             -namespace -prefix osgViewer \
             -I../swigfiles -Iswigfiles -Iinclude -I$(GL_INCDIR) $(INCL) \
             -o $@ swigfiles/tcl3dOsgViewer.i

tcl3dOsgVolume_wrap.cpp: $(SWIG_OSGVOLUME_FILES)
	swig -c++ -tcl -pkgversion $(VERSION) $(PPDEFS) $(SWIG_WARN) \
             -namespace -prefix osgVolume \
             -I../swigfiles -Iswigfiles -Iinclude -I$(GL_INCDIR) $(INCL) \
             -o $@ swigfiles/tcl3dOsgVolume.i

$(PKG_OSG): tcl3dOsg_wrap$(OBJEXT)
	$(SHLIB_LDXX) $(SHLIB_CFLAGS) $(LDOUT)$@ \
                      tcl3dOsg_wrap$(OBJEXT) $(ALL_LIBS)
	$(MT32) -manifest $(PKG_OSG).manifest -outputresource:"$(PKG_OSG);2"

$(PKG_OSGDB): tcl3dOsgDB_wrap$(OBJEXT)
	$(SHLIB_LDXX) $(SHLIB_CFLAGS) $(LDOUT)$@ \
                      tcl3dOsgDB_wrap$(OBJEXT) $(ALL_LIBS)
	$(MT32) -manifest $(PKG_OSGDB).manifest -outputresource:"$(PKG_OSGDB);2"

$(PKG_OSGANIMATION): tcl3dOsgAnimation_wrap$(OBJEXT)
	$(SHLIB_LDXX) $(SHLIB_CFLAGS) $(LDOUT)$@ \
                      tcl3dOsgAnimation_wrap$(OBJEXT) $(ALL_LIBS)
	$(MT32) -manifest $(PKG_OSGANIMATION).manifest -outputresource:"$(PKG_OSGANIMATION);2"

$(PKG_OSGFX): tcl3dOsgFX_wrap$(OBJEXT)
	$(SHLIB_LDXX) $(SHLIB_CFLAGS) $(LDOUT)$@ \
                      tcl3dOsgFX_wrap$(OBJEXT) $(ALL_LIBS)
	$(MT32) -manifest $(PKG_OSGFX).manifest -outputresource:"$(PKG_OSGFX);2"

$(PKG_OSGGA): tcl3dOsgGA_wrap$(OBJEXT)
	$(SHLIB_LDXX) $(SHLIB_CFLAGS) $(LDOUT)$@ \
                      tcl3dOsgGA_wrap$(OBJEXT) $(ALL_LIBS)
	$(MT32) -manifest $(PKG_OSGGA).manifest -outputresource:"$(PKG_OSGGA);2"

$(PKG_OSGMANIPULATOR): tcl3dOsgManipulator_wrap$(OBJEXT)
	$(SHLIB_LDXX) $(SHLIB_CFLAGS) $(LDOUT)$@ \
                      tcl3dOsgManipulator_wrap$(OBJEXT) $(ALL_LIBS)
	$(MT32) -manifest $(PKG_OSGMANIPULATOR).manifest -outputresource:"$(PKG_OSGMANIPULATOR);2"

$(PKG_OSGOPENTHREADS): tcl3dOsgOpenThreads_wrap$(OBJEXT)
	$(SHLIB_LDXX) $(SHLIB_CFLAGS) $(LDOUT)$@ \
                      tcl3dOsgOpenThreads_wrap$(OBJEXT) $(ALL_LIBS)
	$(MT32) -manifest $(PKG_OSGOPENTHREADS).manifest -outputresource:"$(PKG_OSGOPENTHREADS);2"

$(PKG_OSGPARTICLE): tcl3dOsgParticle_wrap$(OBJEXT)
	$(SHLIB_LDXX) $(SHLIB_CFLAGS) $(LDOUT)$@ \
                      tcl3dOsgParticle_wrap$(OBJEXT) $(ALL_LIBS)
	$(MT32) -manifest $(PKG_OSGPARTICLE).manifest -outputresource:"$(PKG_OSGPARTICLE);2"

$(PKG_OSGSIM): tcl3dOsgSim_wrap$(OBJEXT)
	$(SHLIB_LDXX) $(SHLIB_CFLAGS) $(LDOUT)$@ \
                      tcl3dOsgSim_wrap$(OBJEXT) $(ALL_LIBS)
	$(MT32) -manifest $(PKG_OSGSIM).manifest -outputresource:"$(PKG_OSGSIM);2"

$(PKG_OSGSHADOW): tcl3dOsgShadow_wrap$(OBJEXT)
	$(SHLIB_LDXX) $(SHLIB_CFLAGS) $(LDOUT)$@ \
                      tcl3dOsgShadow_wrap$(OBJEXT) $(ALL_LIBS)
	$(MT32) -manifest $(PKG_OSGSHADOW).manifest -outputresource:"$(PKG_OSGSHADOW);2"

$(PKG_OSGTERRAIN): tcl3dOsgTerrain_wrap$(OBJEXT)
	$(SHLIB_LDXX) $(SHLIB_CFLAGS) $(LDOUT)$@ \
                      tcl3dOsgTerrain_wrap$(OBJEXT) $(ALL_LIBS)
	$(MT32) -manifest $(PKG_OSGTERRAIN).manifest -outputresource:"$(PKG_OSGTERRAIN);2"

$(PKG_OSGTEXT): tcl3dOsgText_wrap$(OBJEXT)
	$(SHLIB_LDXX) $(SHLIB_CFLAGS) $(LDOUT)$@ \
                      tcl3dOsgText_wrap$(OBJEXT) $(ALL_LIBS)
	$(MT32) -manifest $(PKG_OSGTEXT).manifest -outputresource:"$(PKG_OSGTEXT);2"

$(PKG_OSGUTIL): tcl3dOsgUtil_wrap$(OBJEXT)
	$(SHLIB_LDXX) $(SHLIB_CFLAGS) $(LDOUT)$@ \
                      tcl3dOsgUtil_wrap$(OBJEXT) $(ALL_LIBS)
	$(MT32) -manifest $(PKG_OSGUTIL).manifest -outputresource:"$(PKG_OSGUTIL);2"

$(PKG_OSGVIEWER): tcl3dOsgViewer_wrap$(OBJEXT)
	$(SHLIB_LDXX) $(SHLIB_CFLAGS) $(LDOUT)$@ \
                      tcl3dOsgViewer_wrap$(OBJEXT) $(ALL_LIBS)
	$(MT32) -manifest $(PKG_OSGVIEWER).manifest -outputresource:"$(PKG_OSGVIEWER);2"

$(PKG_OSGVOLUME): tcl3dOsgVolume_wrap$(OBJEXT)
	$(SHLIB_LDXX) $(SHLIB_CFLAGS) $(LDOUT)$@ \
                      tcl3dOsgVolume_wrap$(OBJEXT) $(ALL_LIBS)
	$(MT32) -manifest $(PKG_OSGVOLUME).manifest -outputresource:"$(PKG_OSGVOLUME);2"

ifneq (,$(HAVE_OSG))
	@echo Tcl3D built with OSG support
else
	@echo Tcl3D built without OSG support
endif
