# Makefile for running/tDifferential
# Satofumi KAMIMURA
# $Id: Makefile 256 2008-10-06 11:50:34Z satofumi $

# Compile options
SH7045_DIR = ../../sh7045
include ${SH7045_DIR}/rules.mk

ARCH = sh-coff
LD_LOAD_FOR_BUILD = ${SH7045_DIR}/sh45load.x
LD_ROM_FOR_BUILD = ${SH7045_DIR}/sh45rom.x
LD_INTERNAL_FOR_BUILD = ${SH7045_DIR}/sh45rom.x
START_UP_FILES = ${SH7045_DIR}/crt0.S

CFLAGS_FOR_BUILD = -O2 -m2 -Wall -Werror ${INCLUDES}
INCLUDES = -I../libs/sh7045
LDFLAGS_FOR_BUILD = -nostartfiles ${START_UP_FILES}
LDLIBS_FOR_BUILD =


# Target
TARGET = t_differential_drive.mot

all : ${TARGET}

clean :
	${RM} *.o ${TARGET} *.cof
	cd samples/ && ${MAKE} clean
	cd etags_sample/ && ${MAKE} clean

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

.PHONY : all clean depend
######################################################################
REQUIRE_LIBS = ${SH7045_DIR}/sh7045.a
${REQUIRE_LIBS} :
	cd ${@D}/ && ${MAKE} ${@F}

OBJS = pwm_ctrl.o motor_ctrl.o encoder_ctrl.o wheel_ctrl.o body_ctrl.o body_position.o running_ctrl.o velocity_ctrl.o position_ctrl.o t_differential_drive.o

t_differential_drive.cof : ${OBJS} ${REQUIRE_LIBS}

# DO NOT DELETE

encoder_ctrl.o: encoder_t.h
motor_ctrl.o: motor_t.h servo_mode.h rotational_direction.h
motor_t.o: servo_mode.h rotational_direction.h
wheel_ctrl.o: servo_mode.h rotational_direction.h
body_ctrl.o: body_ctrl.h
body_position.o: body_position.h
encoder_ctrl.o: encoder_ctrl.h encoder_t.h
motor_ctrl.o: motor_ctrl.h motor_t.h servo_mode.h rotational_direction.h
motor_ctrl.o: pwm_ctrl.h
position_ctrl.o: position_ctrl.h
pwm_ctrl.o: pwm_ctrl.h
running_ctrl.o: running_ctrl.h
velocity_ctrl.o: position_ctrl.c position_ctrl.h
wheel_ctrl.o: wheel_ctrl.h servo_mode.h rotational_direction.h
