# -*- Makefile -*-
#
# @file  Makefile.RTC_OmniWheel# @brief RTComponent makefile for "RTC_OmniWheel component"
# @date  $Date$
#
# This file is generated by rtc-template with the following argments.
#
#  /usr/bin/rtc-template -bcxx --module-name=RTC_OmniWheel  \
#  --module-desc=Control OmniWheel Chair and obtain odometry  \
#  --module-version=1.0.0 --module-vendor=Chiba Institute of Technology  \
#  --module-category=Control --module-comp-type=DataFlowComponent  \
#  --module-act-type=SPORADIC --module-max-inst=1  \
#  --inport=inVelIISIn:IIS::TimedVelocity  \
#  --outport=outOdometryIISOut:IIS::TimedPosition --consumer-idl=IIS.idl  \
#  --config=odo_id:int:100 --config=odo_pos_x:double:0.0  \
#  --config=odo_pos_y:double:0.0 --config=odo_pos_theta:double:0.0  \
#  --config=check_ResetPos:int:1 --config=check_Log:int:1  \
#  --config=gain_pos_x:double:1.0 --config=gain_pos_y:double:1.0  \
#  --config=gain_pos_theta:double:1.0  
#
#
# $Id$
#

CANFESTIVAL_INC = /usr/local/include/canfestival
CANFESTIVAL_LIB = /usr/local/lib
#CXX      = `rtm-config --cxx`
CXXFLAGS = `rtm-config --cflags` -I. -I$(CANFESTIVAL_INC)
#For PCAN
LDFLAGS  = `rtm-config --libs` -lpcan -lrt -lm -ldl
#For IFCAN
#LDFLAGS  = `rtm-config --libs` -lifcan -lrt -lm -ldl
#For CANFESTIVAL
#LDFLAGS  = `rtm-config --libs` -lcanfestival_can_peak_linux -lpcan -lrt -lm -ldl
SHFLAGS  = -shared

IDLC     = `rtm-config --idlc`
IDLFLAGS = `rtm-config --idlflags` -I`rtm-config --prefix`/include/rtm/idl
WRAPPER  = rtm-skelwrapper
WRAPPER_FLAGS = --include-dir="" --skel-suffix=Skel --stub-suffix=Stub

SKEL_OBJ = IISStub.o
STUB_OBJ =  
IMPL_OBJ = MoveWheelChair.o 
OBJS     = RTC_OmniWheel.o $(SKEL_OBJ) $(STUB_OBJ) $(IMPL_OBJ)

.SUFFIXES : .so

all: RTC_OmniWheel.so RTC_OmniWheelComp


.cpp.o:
	rm -f $@
	$(CXX) $(CXXFLAGS) -c -o $@ $<

.o.so:
	rm -f $@
	$(CXX) $(SHFLAGS) -o $@ $(OBJS) $(LDFLAGS)

RTC_OmniWheelComp: RTC_OmniWheelComp.o $(OBJS)
	$(CXX) -o $@ $(OBJS) RTC_OmniWheelComp.o $(LDFLAGS) 


clean: clean_objs clean_skelstub
	rm -f *~

clean_objs:
	rm -f $(OBJS) RTC_OmniWheelComp.o RTC_OmniWheel.so RTC_OmniWheelComp

clean_skelstub:
	rm -f *Skel.h *Skel.cpp
	rm -f *Stub.h *Stub.cpp

IISStub.cpp : IIS.idl
	$(IDLC) $(IDLFLAGS) IIS.idl
	$(WRAPPER) $(WRAPPER_FLAGS) --idl-file=IIS.idl
IISStub.h : IIS.idl
	$(IDLC) $(IDLFLAGS) IIS.idl
	$(WRAPPER) $(WRAPPER_FLAGS) --idl-file=IIS.idl

RTC_OmniWheel.so: $(OBJS)
RTC_OmniWheel.o: RTC_OmniWheel.h  IISStub.h
RTC_OmniWheelComp.o: RTC_OmniWheelComp.cpp RTC_OmniWheel.cpp RTC_OmniWheel.h  

IISStub.o: IISStub.cpp IISStub.h

# end of Makefile

