# -*- Makefile -*-
#
# @file  Makefile.CeilingNavigation
# @brief RTComponent makefile for "CeilingNavigation component"
# @date  $Date$
#
# This file is generated by rtc-template with the following argments.
#
#   rtc-template -bcxx --module-name=CeilingNavigation 
#   --module-desc='CeilingNavigation' --module-version=1.0.0 --module-vendor=NAIST and FSI 
#   --module-category=Navigation --module-comp-type=DataFlowComponent 
#   --module-act-type=PERIODIC --module-max-inst=1 
#   --config=NavigationMap:std::string:"./ceiling_map.bmp" --config=RadonResolution:unsigned short:5 --config=RadonSize:unsigned short:64 --config=RadonCoefficient:double:0.3 --config=SearchScope:unsigned short:8 --config=BlackWhiteValue:unsigned short:240 --config=Center_X:long:-1 --config=Center_Y:long:-1 --config=OfflineImage:std::string:"./offline_image" 
#   --inport=CameraData:TimedOctetSeq --outport=CeilingOdometry:TimedOdometry 
#
#
# $Id$
#

#CXXFLAGS = `rtm-config --cflags`  `pkg-config --cflags opencv` -I. -D_USE_SHOW_MAP -D_OFFLINE_IMAGE
CXXFLAGS = `rtm-config --cflags`  `pkg-config --cflags opencv` -I. -D_USE_SHOW_MAP
LDFLAGS  = `rtm-config --libs` `pkg-config --libs opencv`
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 = intellirobotDynSK.o intellirobotSK.o
STUB_OBJ = 
IMPL_OBJ = 
OBJS     = CeilingNavigation.o BlockMatching.o CeilingMap.o ImageData.o ./Common/sharedmem.o $(SKEL_OBJ) $(STUB_OBJ) $(IMPL_OBJ)

.SUFFIXES : .so

all: CeilingNavigation.so CeilingNavigationLinux

intellirobotStub.cpp : intellirobot.idl
	$(IDLC) $(IDLFLAGS) intellirobot.idl
	$(WRAPPER) $(WRAPPER_FLAGS) --idl-file=intellirobot.idl

intellirobotStub.h : intellirobot.idl
	$(IDLC) $(IDLFLAGS) intellirobot.idl
	$(WRAPPER) $(WRAPPER_FLAGS) --idl-file=intellirobot.idl

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

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

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

CeilingNavigationLinux: CeilingNavigationComp.o $(OBJS)
	$(CXX) -o $@ $(OBJS) CeilingNavigationComp.o $(LDFLAGS) 


clean: clean_objs clean_skelstub
	rm -f *~

clean_objs:
	rm -f $(OBJS) CeilingNavigationComp.o CeilingNavigation.so CeilingNavigationLinux

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

# add start 2011.01.24 by rtc-center
install:
	cp -p CeilingNavigationLinux ../../../bin/comp
	cp -p CeilingNavigation.so ../../../bin/so
# add end   2011.01.24 by rtc-center

CeilingNavigation.so: $(OBJS)
CeilingNavigation.o: CeilingNavigation.h intellirobotStub.h
CeilingNavigationComp.o: CeilingNavigationComp.cpp CeilingNavigation.cpp CeilingNavigation.h 
intellirobotStub.o : intellirobotStub.cpp intellirobotStub.h


# end of Makefile
