 #
 # This file is part of 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$
 #
 # The Makefile for the RHexLib example executables
 #
 # Created       : Haldun Komsuoglu, 02/28/2002
 # Last Modified : Haldun Komsuoglu, 02/28/2002
 #
 ######################################################################

UNAME = $(shell uname)

############################################
# Modify the following segment only.       #
############################################

# This line defines the name of the executables. Note that we assume
# the presence of an associated .cc file as well.
EXEC = \
	calib_legsensor \
	calib_encoders  \
	calib_power     \
	calib_motors    \
	calib_accel     \

# This line specifies all the other source files that need to be
# compiled and linked together with the executable
SOURCES = \
	KeyboardInput.cc        \
	Calibrator.cc           \
	Iterator.cc             \
	LegSensorCalibrator.cc	\
	EncoderCalibrator.cc    \
	PowerSenseCalibrator.cc \
	MotorCalibrator.cc      \
	AccelCalibrator.cc      \

# This line specifies any additional flags that you want to feed the
# compiler. It is usually used to specify additional include
# directories through -I and additional link directories through -L
AUXFLAGS = \
	-L$(RHEX_TOPDIR)/lib \
	-I$(RHEX_TOPDIR)/include \
	-I$(RHEX_TOPDIR)/include/behaviors

AUXLIBS = \
	$(RHEX_TOPDIR)/lib/librhexmodules.a



# This line specifies any additional libraries that you want to link
# your executable against. Note that you MUST specify the full path of
# the library in question.
ifeq ($(RHEX_HARDWARE), _MCRHIO_)
AUXLIBS += \
	$(RHEX_TOPDIR)/lib/librhexresearchhw.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_)
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 hexaped.oogl SimSect.rc

allclean : clean
	@rm -f hexaped.oogl
	@rm -f SimSect.rc
	@rm -f SimSect.log

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

LIBS = libbase.a libutils.a

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