INCLUDES += libnml/posemath

POSEMATHSRCS := $(addprefix libnml/posemath/, _posemath.c posemath.cc gomath.c sincos.c)
$(call TOOBJSDEPS, $(POSEMATHSRCS)) : EXTRAFLAGS=-fPIC
USERSRCS += $(POSEMATHSRCS) 
TARGETS += ../lib/libposemath.so ../lib/libposemath.so.0

../lib/libposemath.so.0: $(call TOOBJS,$(POSEMATHSRCS)) ../lib/librtapi_math.so.0
	$(ECHO) Creating shared library $(notdir $@)
	@mkdir -p ../lib
	@rm -f $@
	@$(CXX) $(LDFLAGS) -Wl,-soname,$(notdir $@) -shared -o $@ $^

../include/%.h: ./libnml/posemath/%.h
	$(ECHO) Copying header file $@
	$(Q)cp $^ $@
../include/%.hh: ./libnml/posemath/%.hh
	$(ECHO) Copying header file $@
	$(Q)cp $^ $@
