# Makefile for tsukuba_challenge/programs
# Satofumi KAMIMURA
# $Id$

# Compile options
CC = g++
CXXFLAGS = -g -O0 -Wall -Werror ${INCLUDES} `sdl-config --cflags`
INCLUDES = -I../../libs/joystick -I../../libs/common -I../../libs/pathCtrl -I../../libs/runCtrl -I../../libs/coordinateCtrl -I../../libs/gl_gui -I../../libs/gui -I../../libs/connection -Iscip_samples
LDFLAGS =
#LDLIBS = -lwiimote -lopenglut `sdl-config --libs`
LDLIBS = -lwiimote `sdl-config --libs` -lGL -lglut

# Target
TARGET = \
	adjustSteerOffset \
	gettimeofdaySample \
	followLinesSample \
	clockSample \
	steerCtrlSample \
	wiiRadicon \
	pathFollow \
	old_wiiRadicon \
#	getGpsPosition \

all : ${TARGET}

URG_Ctrl :
	gcc URG_Ctrl.c -o URG_Ctrl -lm
	
rm :
	rm log* up* down* 0* *log b0* l0* Todo.dat Fodo.dat

clean :
	${RM} *.o ${TARGET}

depend :
	makedepend -Y -- ${INCLUDES} -- ${wildcard *.h *.cpp}

.PHONY : all clean
######################################################################
REQUIRE_LIBS = ../../libs/pathCtrl/pathCtrl.a ../../libs/coordinateCtrl/coordinateCtrl.a ../../libs/joystick/joystick.a ../../libs/gl_gui/gl_gui.a ../../libs/gui/gui.a ../../libs/connection/connection.a ../../libs/common/common.a

${REQUIRE_LIBS} :
	cd ${@D}/ && ${MAKE} ${@F}

scip2.o : scip_samples/scip2.c
	${CXX} ${CXXFLAGS} -c $<

scipUtil.o : scip_samples/scipUtil.c
	${CXX} ${CXXFLAGS} -c $<

scipBase.o : scip_samples/scipBase.c
	${CXX} ${CXXFLAGS} -c $<

#getGpsPosition : TwinGpsCoordinate.o ${REQUIRE_LIBS}
old_wiiRadicon : ${REQUIRE_LIBS}
wiiRadicon pathFollow adjustSteerOffset : RobotCtrl.o SimulationCtrl.o SteerCtrl.o SeniorCarCtrl.o HoistTask.o scip2.o scipUtil.o scipBase.o FollowLineCalc.o localize3.o aroundmap.o SH2.o URG_Ctrl.o ${REQUIRE_LIBS}
steerCtrlSample : HoistTask.o SteerCtrl.o scip2.o localize3.o aroundmap.o scipUtil.o SH2.o scipBase.o URG_Ctrl.o ${REQUIRE_LIBS}
followLinesSample : SimulationCtrl.o FollowLineCalc.o ${REQUIRE_LIBS}

# DO NOT DELETE

FollowLineCalc.o: ../../libs/common/GridTypes.h
RobotCtrl.o: RobotCtrlInterface.h ../../libs/common/GridTypes.h
RobotCtrl.o: ../../libs/runCtrl/FollowLineInterface.h
RobotCtrl.o: ../../libs/runCtrl/GetPositionInterface.h
RobotCtrlInterface.o: ../../libs/common/GridTypes.h
RobotCtrlInterface.o: ../../libs/runCtrl/FollowLineInterface.h
RobotCtrlInterface.o: ../../libs/runCtrl/GetPositionInterface.h
SimulationCtrl.o: RobotCtrlInterface.h ../../libs/common/GridTypes.h
SimulationCtrl.o: ../../libs/runCtrl/FollowLineInterface.h
SimulationCtrl.o: ../../libs/runCtrl/GetPositionInterface.h
TwinGpsCoordinate.o: ../../libs/common/GridTypes.h
FollowLineCalc.o: FollowLineCalc.h ../../libs/common/GridTypes.h
FollowLineCalc.o: RobotCtrlInterface.h
FollowLineCalc.o: ../../libs/runCtrl/FollowLineInterface.h
FollowLineCalc.o: ../../libs/runCtrl/GetPositionInterface.h
FollowLineCalc.o: ../../libs/common/MathUtils.h ../../libs/common/DetectOS.h
HoistTask.o: SH2.h URG_Ctrl.h
URG_Ctrl.o: URG_Ctrl.h aroundmap.h localize3.h
URG_Ctrl.o: scip_samples/scipBase.h scip_samples/scip1.h
URG_Ctrl.o: scip_samples/scip2.h scip_samples/scipUtil.h localize3.h
RobotCtrl.o: RobotCtrl.h RobotCtrlInterface.h ../../libs/common/GridTypes.h
RobotCtrl.o: ../../libs/runCtrl/FollowLineInterface.h
RobotCtrl.o: ../../libs/runCtrl/GetPositionInterface.h SteerCtrl.h
RobotCtrl.o: SeniorCarCtrl.h ../../libs/common/MathUtils.h
RobotCtrl.o: ../../libs/common/DetectOS.h FollowLineCalc.h
RobotCtrl.o: ../../libs/common/ThreadCreator.h ../../libs/common/GetTicks.h
RobotCtrl.o: ../../libs/common/Delay.h
SeniorCarCtrl.o: SeniorCarCtrl.h ../../libs/common/ThreadCreator.h
SeniorCarCtrl.o: HoistTask.h
SimulationCtrl.o: SimulationCtrl.h RobotCtrlInterface.h
SimulationCtrl.o: ../../libs/common/GridTypes.h
SimulationCtrl.o: ../../libs/runCtrl/FollowLineInterface.h
SimulationCtrl.o: ../../libs/runCtrl/GetPositionInterface.h
SimulationCtrl.o: ../../libs/coordinateCtrl/CoordinateCtrl.h
SimulationCtrl.o: ../../libs/gl_gui/GlSdlVideo.h
SimulationCtrl.o: ../../libs/gui/InputHandler.h ../../libs/common/MathUtils.h
SimulationCtrl.o: ../../libs/common/DetectOS.h
SimulationCtrl.o: ../../libs/common/ThreadCreator.h FollowLineCalc.h
SimulationCtrl.o: ../../libs/common/Delay.h
SteerCtrl.o: SteerCtrl.h ../../libs/common/GridTypes.h
SteerCtrl.o: ../../libs/connection/SerialCtrl.h
SteerCtrl.o: ../../libs/connection/ConnectionInterface.h HoistTask.h
TwinGpsCoordinate.o: TwinGpsCoordinate.h ../../libs/common/GridTypes.h
aroundmap.o: aroundmap.h
SH2.o: SH2.h
followLinesSample.o: SimulationCtrl.h RobotCtrlInterface.h
followLinesSample.o: ../../libs/common/GridTypes.h
followLinesSample.o: ../../libs/runCtrl/FollowLineInterface.h
followLinesSample.o: ../../libs/runCtrl/GetPositionInterface.h
followLinesSample.o: ../../libs/pathCtrl/FollowLines.h
followLinesSample.o: ../../libs/common/Delay.h
getGpsPosition.o: TwinGpsCoordinate.h ../../libs/common/GridTypes.h
getGpsPosition.o: ../../libs/common/Delay.h
localize3.o: aroundmap.h localize3.h
old_wiiRadicon.o: ../../libs/joystick/WiiJoystick.h
old_wiiRadicon.o: ../../libs/joystick/JoystickInterface.h
old_wiiRadicon.o: ../../libs/common/GridTypes.h
pathFollow.o: RobotCtrl.h RobotCtrlInterface.h ../../libs/common/GridTypes.h
pathFollow.o: ../../libs/runCtrl/FollowLineInterface.h
pathFollow.o: ../../libs/runCtrl/GetPositionInterface.h
pathFollow.o: ../../libs/pathCtrl/FollowLines.h
pathFollow.o: ../../libs/coordinateCtrl/CoordinateCtrl.h
pathFollow.o: ../../libs/joystick/WiiJoystick.h
pathFollow.o: ../../libs/joystick/JoystickInterface.h
pathFollow.o: ../../libs/common/Delay.h
steerCtrlSample.o: SteerCtrl.h ../../libs/common/GridTypes.h
wiiRadicon.o: ../../libs/joystick/WiiJoystick.h
wiiRadicon.o: ../../libs/joystick/JoystickInterface.h
wiiRadicon.o: ../../libs/common/GridTypes.h SimulationCtrl.h
wiiRadicon.o: RobotCtrlInterface.h ../../libs/runCtrl/FollowLineInterface.h
wiiRadicon.o: ../../libs/runCtrl/GetPositionInterface.h RobotCtrl.h
wiiRadicon.o: ../../libs/common/Delay.h
