 #
 # RHexLib, 
 #
 # Copyright (c) 2001 The University of Michigan, its Regents,
 # Fellows, Employees and Agents. All rights reserved, and distributed as
 # free software under the following license.
 # 
 #  Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are
 # met:
 # 
 # 1) Redistributions of source code must retain the above copyright
 # notice, this list of conditions, the following disclaimer and the
 # file called "CREDITS" which accompanies this distribution.
 # 
 # 2) Redistributions in binary form must reproduce the above copyright
 # notice, this list of conditions, the following disclaimer and the file
 # called "CREDITS" which accompanies this distribution in the
 # documentation and/or other materials provided with the distribution.
 # 
 # 3) Neither the name of the University of Michigan, Ann Arbor or the
 # names of its contributors may be used to endorse or promote products
 # derived from this software without specific prior written permission.
 # 
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 ######################################################################
 # $Id$
 #
 # Sample Makefile for compiling RHexLib executables
 #
 # Created       : Uluc Saranli, 11/16/2000
 # Last Modified : Jay Gowdy 10/14/2002
 #
 ######################################################################

###########################################################
# You will need to modify the following section           #
###########################################################

# This line defines the name of the executables. Note that we assume
# the presence of an associated .cc file as well.
EXEC = supervisor 

# This line specifies all the other source files that need to be
# compiled and linked together with the executable
SOURCES = 

# This line specifies any flags that you want to feed the
# compiler, usually to find rhexlib and module include files.
AUXFLAGS = \
	-L$(LIBS_TOPDIR)/lib \
	-I$(RHEX_TOPDIR)/include/behaviors \
	-L$(RHEX_TOPDIR)/lib \
	-I$(SIMSECT_DIR)/include \
	-I$(SIMSECT_DIR)/systems/hexapod \
	-I$(RHEX_TOPDIR)/RobotCode/Hardware/include

# This line specifies any libraries that you want to link
# your executable against, usually containing modules and modes.
AUXLIBS += \
	$(RHEX_TOPDIR)/lib/librhexmodes.a \
	$(RHEX_TOPDIR)/lib/librhexmodules.a \
	$(LIBS_TOPDIR)/lib/libbase.a \
	$(LIBS_TOPDIR)/lib/libutils.a

ifeq ($(RHEX_HARDWARE), _MCRHIO_)
AUXLIBS += \
	$(RHEX_TOPDIR)/lib/librhexresearchhw.a \
	$(RHEX_TOPDIR)/lib/librhexcommonhw.a
endif

ifeq ($(RHEX_HARDWARE), _RUGGED_)
AUXLIBS += \
	$(RHEX_TOPDIR)/lib/librhexruggedhw.a \
	$(RHEX_TOPDIR)/lib/librhexcommonhw.a
endif

ifeq ($(RHEX_HARDWARE), _AQUA_)
AUXLIBS += \
	$(RHEX_TOPDIR)/lib/librhexaquahw.a \
	$(RHEX_TOPDIR)/lib/librhexcommonhw.a
endif

ifeq ($(RHEX_HARDWARE), _DUMMY_)
AUXLIBS += \
	$(RHEX_TOPDIR)/lib/librhexdummyhw.a \
	$(RHEX_TOPDIR)/lib/librhexcommonhw.a
endif

ifeq ($(RHEX_HARDWARE), _SIMSECT_)
AUXFLAGS += \
	-I$(RHEX_TOPDIR)/RobotCode/Hardware/SimSectHW

AUXLIBS += \
	$(RHEX_TOPDIR)/lib/librhexsimsecthw.a \
	$(RHEX_TOPDIR)/lib/librhexcommonhw.a \
	$(RHEX_TOPDIR)/lib/libhexapod.a \
	$(RHEX_TOPDIR)/lib/libengine.a \
	$(RHEX_TOPDIR)/lib/libml.a \
	$(RHEX_TOPDIR)/lib/libmisc.a 

SS_CONFIG_DIR = $(RHEX_TOPDIR)/SWRI/Config/robots/simsect

default: all dials.scr hexaped.oogl SimSect.rc

dials.scr: $(SS_CONFIG_DIR)/dials.scr
	rm -f dials.scr
	ln -s $(SS_CONFIG_DIR)/dials.scr dials.scr

hexaped.oogl: $(SS_CONFIG_DIR)/hexaped.oogl
	rm -f hexaped.oogl
	ln -s $(SS_CONFIG_DIR)/hexaped.oogl hexaped.oogl

SimSect.rc: $(SS_CONFIG_DIR)/SimSect.rc
	rm -f SimSect.rc
	ln -s $(SS_CONFIG_DIR)/SimSect.rc SimSect.rc

endif

ifeq ($(RHEX_HARDWARE), _ARACHI_)
LDLIBS += -lXi -lXext -lX11 -lXmu -lGL -lGLU -lglut -lm -lqhull
AUXFLAGS += \
	-I$(ARACHI_DIR)/include -L$(ARACHI_DIR)/lib \
	-I$(SIMLIB_DIR)/include -L$(SIMLIB_DIR)/lib \
	-L/usr/X11R6/lib 

AUXLIBS += \
	$(RHEX_TOPDIR)/lib/librhexsimhw.a \
	$(RHEX_TOPDIR)/lib/librhexcommonhw.a \
	$(SIMLIB_DIR)/lib/libsimrti.a \
	$(SIMLIB_DIR)/lib/libsimpcm.a \
	$(SIMLIB_DIR)/lib/libsimcdl.a \
	$(SIMLIB_DIR)/lib/libsimpcm.a \
	$(SIMLIB_DIR)/lib/libsimrti.a \
	$(SIMLIB_DIR)/lib/libsimgraphics.a \
	$(ARACHI_DIR)/lib/libarachi.a

endif

###########################################################
# The rest of this file should not be modified            #
###########################################################

ifndef RHEX_DIR
$(error RHEX_DIR environment variable is not defined!)
endif

include $(RHEX_DIR)/tools/bintargets.mk

