# =============================================================================
# Makefile for the simple Octopus VR Juggler application.  Notes have been
# made about what is necessary for this particular application's use of
# Octopus.  In most cases, these can be generalized to all applications that
# use Octopus.
#
# This file will work with IRIX make (and smake) and with GNU make.
# ----------------------------------------------------------------------------
#     Patrick Hartling 
#     Virtual Reality Applications Center
#
# *** IMPORTANT NOTES -- READ THESE FIRST ***
#     1) This file _requires_ the use of GNU make (gmake).
#
# =============================================================================

# Nothing but comments should come before this line.
default: all

# -----------------------------------------------------------------------------
# Application-specific variable settings.  It is safe to modify these.
# -----------------------------------------------------------------------------

# The application name that is built.  A value must be set for this!
APP_NAME	= demo

# The directory where the source files for this application are located.
srcdir  	= .

# Compiler flags needed for this application.  They are used as follows:
#
#    DEBUG_APP         - If set to TRUE, this application will be compiled with
#                        debugging symbols and no optimized symbols
#    OPTIM_APP         - If set to TRUE, this application will be compiled with
#                        optimized symbols and no debugging symbols
#    EXTRA_CFLAGS      - Extra application-specific C compiler flags
#    EXTRA_CXXFLAGS    - Extra application-specific C++ compiler flags
#    EXTRA_DEBUG_FLAGS - Extra application-specific compiler debugging flags
#    EXTRA_INCLUDES    - Extra include paths (-I... options) for the compilers
#    EXTRA_OPTIM_FLAGS - Extra application-specific compiler optimization flags
#
DEBUG_APP		= TRUE
OPTIM_APP		= FALSE
EXTRA_CFLAGS		=
EXTRA_CXXFLAGS		=
EXTRA_DEBUG_FLAGS	=
EXTRA_INCLUDES		= $(OCT_INCLUDES)
EXTRA_OPTIM_FLAGS	=

# A value for $(OCTOPUS_ROOT) (the root of the Octopus installation) must be
# set.  The common method I have used is to set environment variables so that
# everything that might need such values can have access to it.  For example,
# to use the latest Octopus installation, the $OCTOPUS_ROOT environment
# variable should be set to /home/vr/octopus/latest.
#
# Note that the actual include path for the Octopus headers must be (for now)
# "-I$(OCTOPUS_ROOT)/include -I$(OCTOPUS_ROOT)/include/octopus" because the
# header files are in a subdirectory of $(OCTOPUS_ROOT)/include but are
# referenced two different ways.  This is not ideal.
OCT_INCLUDES	= -I$(OCTOPUS_ROOT)/include
OCT_LIB_DIR	= -L$(OCTOPUS_ROOT)/lib32

# -loctopus and -lACE are necessary for this application and all Octopus
# applications.  -lprimitives is only for this application so I can have a
# nice interface for making primitives in the virtual environment.
OCT_LIBS	= -loctopus -loctopusAvatar -loctopusAvatarGL -lACE -lprimitives

# The list of all source files needed for this application.  Based on this,
# a list of object files is put in $(OBJS) automatically.
SRCS		= main.cpp		\
                  SimpleApp.cpp		\
                  SimpleObject.cpp	\
                  SphereObject.cpp	\
                  UserData.cpp

# This is for extra libraries needed specfically for your application.  The
# general libraries needed for applications are in $(LIBS).
EXTRA_LIBS	= $(OCT_LIB_DIR) $(OCT_LIBS)
EXTRA_SYS_LIBS	= -lpthread

# Files for the 'clean' target to remove.
CLEAN_FILES	=

# The following include line MUST COME BEFORE the targets for compiling the
# application.
#
# To build an application, include one of the following files:
#
#     vrac.glapp.mk         - An ordinary OpenGL app
#     vrac.pfapp.mk         - An ordinary Performer app
#     vrac.juggler.glapp.mk - An ordinary VR Juggler OpenGL app
#     vrac.juggler.pfapp.mk - An ordinary VR Juggler Performer app
#
include /home/vr/apps/mk/vrac.juggler.glapp.mk

# -----------------------------------------------------------------------------
# Targets.
# -----------------------------------------------------------------------------
all: $(APP_NAME)

# Target for the application to be built.
$(APP_NAME): $(OBJS)
	$(LINK) -o $@ $(OBJS) $(EXTRA_LIBS) $(LIBS)