# -*- Makefile -*-
#
# @file  Makefile.SmartPal_controller
# @brief RTComponent makefile for "SmartPal_controller component"
# @date  $Date$
#
# This file is generated by rtc-template with the following argments.
#
#   rtc-template -bcxx --module-name=SmartPal_controller 
#   --module-desc='SmartPal controller' --module-version=1.0.0 --module-vendor=nomura 
#   --module-category=Category --module-comp-type=STATIC 
#   --module-act-type=PERIODIC --module-max-inst=0 
#   --config=Pgain:double:30000 --config=Dgain:double:100 
#   --inport=q_arm_ref_in:RTC::TimedDoubleSeq --inport=q_hand_ref_in:RTC::TimedDoubleSeq --inport=dq_odv_ref_in:RTC::TimedDoubleSeq --inport=q_cur_in:RTC::TimedDoubleSeq --inport=image_in:RTC::TimedLongSeq --outport=q_cur_out:RTC::TimedDoubleSeq --outport=q_hand_cur_out:RTC::TimedDoubleSeq --outport=q_camera_out:RTC::TimedDoubleSeq --outport=torque:RTC::TimedDoubleSeq --outport=image_out:RTC::TimedDoubleSeq 
#
#
# $Id$
#


TOP=../
#include $(TOP)Make.rules


CXXFLAGS = `rtm-config --cflags` \
            -I$(OPENHRP3_HOME)/DynamicsSimulator/server \
            -I$(OPENHRP3_HOME)/DynamicsSimulator/corba \
            -I$(OPENHRP3_HOME)/Common \
            -I$(OPENHRP3_HOME)/Controller/rtc \
	-I.

LDFLAGS  = `rtm-config --libs`\
	    -lhrpModel3 -L$(OPENHRP3_HOME)/DynamicsSimulator/server

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 = 
STUB_OBJ = 
IMPL_OBJ = 
OBJS     = SmartPal_controller.o $(SKEL_OBJ) $(STUB_OBJ) $(IMPL_OBJ)

.SUFFIXES : .so

all: SmartPal_controller.so SmartPal_controllerComp

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

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

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


clean: clean_objs clean_skelstub
	rm -f *~

clean_objs:
	rm -f $(OBJS) SmartPal_controllerComp.o SmartPal_controller.so SmartPal_controllerComp

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



SmartPal_controller.so: $(OBJS)
SmartPal_controller.o: SmartPal_controller.h 	 	
SmartPal_controllerComp.o: SmartPal_controllerComp.cpp SmartPal_controller.cpp SmartPal_controller.h 


run: SmartPal_controllerComp SmartPal_controller.so
	LD_LIBRARY_PATH=$(OPENHRP3_HOME)/DynamicsSimulator/server \
	$(OPENHRP3_HOME)/Controller/bridge/ControllerBridge \
	--config-file bridge.conf \



# end of Makefile
