.PHONY: all

OPENRSDK_ROOT?=/usr/local/OPEN_R_SDK

SRC:= \
	safemot.cc \
	../../Events/EventBase.cc \
	../../Events/EventRouter.cc \
	../../Motion/MotionManager.cc \
	../../Motion/MotionSequenceMC.cc \
	../../Motion/PostureEngine.cc \
	../../Shared/get_time.cc \
	../../Shared/LoadSave.cc \
	../../Shared/Profiler.cc \
	../../Shared/TimeET.cc \
	../../Shared/WorldState.cc

OBJ:=$(addsuffix .o,$(basename $(notdir $(SRC))))

FLAGS=-g -Wall -O2 -DTGT_ERS210

all: safemot

safemot: $(OBJ)
	g++ $(FLAGS) $(OBJ) -o $@

safemot.o:	safemot.cc
	g++ $(FLAGS) -I. -I../.. -c $<

EventBase.o:	../../Events/EventBase.cc
	g++ $(FLAGS) -I. -I../.. -c $<

EventRouter.o:	../../Events/EventRouter.cc
	g++ $(FLAGS) -I. -I../.. -c $<

Kinematics.o:	../../Motion/Kinematics.cc
	g++ $(FLAGS) -I. -I../.. -c $<

MotionManager.o:	../../Motion/MotionManager.cc
	g++ $(FLAGS) -I. -I../.. -c $<

MotionSequenceMC.o:	../../Motion/MotionSequenceMC.cc
	g++ $(FLAGS) -I. -I../.. -c $<

PostureEngine.o:	../../Motion/PostureEngine.cc
	g++ $(FLAGS) -I. -I../.. -c $<

get_time.o:	../../Shared/get_time.cc
	g++ $(FLAGS) -I. -I../.. -c $<

LoadSave.o:	../../Shared/LoadSave.cc
	g++ $(FLAGS) -I. -I../.. -c $<

Profiler.o:	../../Shared/Profiler.cc
	g++ $(FLAGS) -I. -I../.. -c $<

TimeET.o:	../../Shared/TimeET.cc
	g++ $(FLAGS) -I. -I../.. -c $<

WorldState.o:	../../Shared/WorldState.cc
	g++ $(FLAGS) -I. -I../.. -c $<

#-isystem $(OPENRSDK_ROOT)/OPEN_R/include \
#-isystem $(OPENRSDK_ROOT)/OPEN_R/include/MCOOP \
#-isystem $(OPENRSDK_ROOT)/OPEN_R/include/R4000 \

clean:
	rm -f safemot *.o *~ 

