INCLUDES += libnml/inifile

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

LIBINISRCS := libnml/inifile/inifile.cc
$(call TOOBJSDEPS, $(LIBINISRCS)) : EXTRAFLAGS=-fPIC

INIFILESRCS := libnml/inifile/inivar.cc

USERSRCS += $(INIFILESRCS) $(LIBINISRCS)
TARGETS += ../lib/liblinuxcncini.so ../lib/liblinuxcncini.so.0

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

../libexec/inivar: $(call TOOBJS, $(INIFILESRCS)) ../lib/liblinuxcncini.so.0
	$(ECHO) Linking $(notdir $@)
	@mkdir -p $(dir $@)
	$(Q)$(CXX) $(LDFLAGS) -o $@ $^ 
TARGETS += ../libexec/inivar
