 #
 # 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       : Uluc Saranli, 11/16/2000
 # Last Modified : Uluc Saranli, 06/27/2001
 #
 ######################################################################

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 = \
	adc_test din_test aout_test  \
	enc_test_mm enc_test poscontrol_test \
	power_test temp_test digout_test drive_test calib_test

# The following files have been removed from the above list because
# They have not been used in a long time. If you need one, please
# put it back into the list
# accel_test accel_test_filtered hall_test rc_test torque_test
# dial_test backemf_test drive_test gyro_test calib_test

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

# 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), _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), _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

