# -*- Makefile -*-
#
# @file  Makefile.Measure3D
# @brief RTComponent makefile for "Measure3D component"
# @date  $Date$
#
# This file is generated by rtc-template with the following argments.
#
#   rtc-template -bcxx --module-name=Measure3D 
#   --module-desc='Calculate 3D from stereo images' --module-version=1.0.0 --module-vendor=AIST 
#   --module-category=Category --module-comp-type=STATIC 
#   --module-act-type=PERIODIC --module-max-inst=0 
#   --inport=ImageIn:Img::TimedMultiCameraImage --outport=Data3DOut:TimedStereo3D 
#   --service-idl=Vision.idl 
#   --consumer-idl=Img.idl 
#   --service=Reconstruct3D:Reconstruct3DService:Reconstruct3DService 
#   --consumer=CameraCapture:CaptureCameraService:Img::CameraCaptureService 
#
#
# $Id$
#

CXXFLAGS = `rtm-config --cflags` `pkg-config --cflags opencv` -I.
LDFLAGS  = `rtm-config --libs` `pkg-config --libs opencv`
SHFLAGS  = -shared

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

SKEL_OBJ = VisionSkel.o 
STUB_OBJ = ImgStub.o 
IMPL_OBJ = VisionSVC_impl.o 
OBJS     = Measure3D.o $(SKEL_OBJ) $(STUB_OBJ) $(IMPL_OBJ) \
           measure3d_scene.o \
           read_measure3d_config.o

.SUFFIXES : .so

all: Measure3D.so Measure3DComp

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

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

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

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


clean: clean_objs clean_skelstub
	rm -f *~

clean_objs:
	rm -f $(OBJS) Measure3DComp.o Measure3D.so Measure3DComp

clean_skelstub:
	rm -f *Skel.h *Skel.cpp
	rm -f *Stub.h *Stub.cpp
	rm -f *SK.cc
	rm -f Img.hh Vision.hh

VisionSkel.cpp : Vision.idl
	$(IDLC) $(IDLFLAGS) Vision.idl
	$(WRAPPER) $(WRAPPER_FLAGS) --idl-file=Vision.idl
VisionSkel.h : Vision.idl
	$(IDLC) $(IDLFLAGS) Vision.idl
	$(WRAPPER) $(WRAPPER_FLAGS) --idl-file=Vision.idl


ImgStub.cpp : Img.idl
	$(IDLC) $(IDLFLAGS) Img.idl
	$(WRAPPER) $(WRAPPER_FLAGS) --idl-file=Img.idl
ImgStub.h : Img.idl
	$(IDLC) $(IDLFLAGS) Img.idl
	$(WRAPPER) $(WRAPPER_FLAGS) --idl-file=Img.idl


Measure3D.so: $(OBJS)
Measure3D.o: Measure3D.h VisionSkel.h VisionSVC_impl.h ImgStub.h 
Measure3DComp.o: Measure3DComp.cpp Measure3D.cpp Measure3D.h VisionSkel.h VisionSVC_impl.h 

measure3d_scene.o:measure3d_scene.c measure3d_scene.h
read_measure3d_config.o:read_measure3d_config.c 

VisionSVC_impl.o: VisionSVC_impl.cpp VisionSVC_impl.h VisionSkel.h VisionStub.h
VisionSkel.o: VisionSkel.cpp VisionSkel.h VisionStub.h
VisionStub.o: VisionStub.cpp VisionStub.h


ImgSkel.o: ImgSkel.cpp ImgSkel.h ImgStub.h
ImgStub.o: ImgStub.cpp ImgStub.h 

# end of Makefile
