eaaca07
diff --git a/etc/buildsys/btypes/rules_sysinstall.mk b/etc/buildsys/btypes/rules_sysinstall.mk
eaaca07
index fd21a2a0b..090019592 100644
eaaca07
--- a/etc/buildsys/btypes/rules_sysinstall.mk
eaaca07
+++ b/etc/buildsys/btypes/rules_sysinstall.mk
eaaca07
@@ -17,15 +17,15 @@ include $(BUILDSYSDIR)/btypes/rules_fawkes.mk
eaaca07
 include $(BUILDSYSDIR)/ext/gmsl
eaaca07
 
eaaca07
 # Plugins are installed to special directory
eaaca07
-$(foreach P,$(PLUGINS_all:$(PLUGINDIR)/%.so=%),$(eval INST_LIB_SUBDIR_$(call nametr,$P) = $(FFLIBSUBDIR)/plugins))
eaaca07
+$(foreach P,$(PLUGINS_build:$(PLUGINDIR)/%.so=%),$(eval INST_LIB_SUBDIR_$(call nametr,$P) = $(FFLIBSUBDIR)/plugins))
eaaca07
 
eaaca07
 # Library headers get subdir matching name if not set
eaaca07
-$(foreach P,$(LIBS_all:$(LIBDIR)/libfawkes%.so=%) $(LIBS_gui:$(LIBDIR)/libfawkes%.so=%),$(if $(and $(call not,$(INST_HDRS_SUBDIR_libfawkes$P)),$P),$(eval INST_HDRS_SUBDIR_libfawkes$P = $(P:_%=%))))
eaaca07
-$(foreach P,$(LIBS_all:$(LIBDIR)/libfv%.so=%) $(LIBS_gui:$(LIBDIR)/libfv%.so=%),$(if $(and $(call not,$(INST_HDRS_SUBDIR_libfv$P)),$P),$(eval INST_HDRS_SUBDIR_libfv$P = fv$P)))
eaaca07
+$(foreach P,$(LIBS_build:$(LIBDIR)/libfawkes%.so=%) $(LIBS_gui:$(LIBDIR)/libfawkes%.so=%),$(if $(and $(call not,$(INST_HDRS_SUBDIR_libfawkes$P)),$P),$(eval INST_HDRS_SUBDIR_libfawkes$P = $(P:_%=%))))
eaaca07
+$(foreach P,$(LIBS_build:$(LIBDIR)/libfv%.so=%) $(LIBS_gui:$(LIBDIR)/libfv%.so=%),$(if $(and $(call not,$(INST_HDRS_SUBDIR_libfv$P)),$P),$(eval INST_HDRS_SUBDIR_libfv$P = fv$P)))
eaaca07
 
eaaca07
 ifdef __buildsys_lua_mk_
eaaca07
 # Lua libraries are "inferred" and automatically installed to proper directory
eaaca07
-$(foreach L,$(LIBS_all:$(LIBDIR)/lua/%.so=%),$(if $L,$(eval INST_LIB_SUBDIR_lua_$(call nametr,$L) = $(FFLIBSUBDIR))))
eaaca07
+$(foreach L,$(LIBS_build:$(LIBDIR)/lua/%.so=%),$(if $L,$(eval INST_LIB_SUBDIR_lua_$(call nametr,$L) = $(FFLIBSUBDIR))))
eaaca07
 endif
eaaca07
 
eaaca07
 # Prefix man pages with proper path
eaaca07
@@ -49,7 +49,7 @@ endif
eaaca07
 endif
eaaca07
 
eaaca07
 .PHONY: install_targets
eaaca07
-install_targets: $(subst $(LIBDIR),$(DESTDIR)$(EXEC_LIBDIR),$(LIBS_all) $(LIBS_gui)) $(subst $(PLUGINDIR),$(DESTDIR)$(EXEC_PLUGINDIR),$(PLUGINS_all)) $(subst $(BINDIR),$(DESTDIR)$(EXEC_BINDIR),$(BINS_all) $(BINS_gui)) $(MANPAGES_install)
eaaca07
+install_targets: $(subst $(LIBDIR),$(DESTDIR)$(EXEC_LIBDIR),$(LIBS_build) $(LIBS_gui)) $(subst $(PLUGINDIR),$(DESTDIR)$(EXEC_PLUGINDIR),$(PLUGINS_build)) $(subst $(BINDIR),$(DESTDIR)$(EXEC_BINDIR),$(BINS_build) $(BINS_gui)) $(MANPAGES_install)
eaaca07
 
eaaca07
 .PHONY: install_resdirs $(INST_RESDIRS)
eaaca07
 install_resdirs: $(INST_RESDIRS)
eaaca07
@@ -74,7 +74,7 @@ $(INST_RESDIRS):
eaaca07
 	$(SILENTSYMB) if [ -d "$(RESDIR)/$@" ]; then	\
eaaca07
 		echo -e "$(INDENT_PRINT)[DIR] $(DESTDIR)$(TBOLDGRAY)$(RESDIR)/$@$(TNORMAL)"; \
eaaca07
 		mkdir -p $(DESTDIR)$(EXEC_RESDIR)/$@ || exit $?; \
eaaca07
-		echo -e "$(INDENT_PRINT)[CPY] $(PARENTDIR)$(TBOLDGRAY)$@(TNORMAL) -> $(DESTDIR)$(EXEC_RESDIR)/$@"; \
eaaca07
+		echo -e "$(INDENT_PRINT)[CPY] $(PARENTDIR)$(TBOLDGRAY)$@$(TNORMAL) -> $(DESTDIR)$(EXEC_RESDIR)/$@"; \
eaaca07
 		cp -af $(RESDIR)/$@/* $(DESTDIR)$(EXEC_RESDIR)/$@ || exit $$?; \
eaaca07
 	fi
eaaca07
 endif
eaaca07
@@ -146,22 +146,22 @@ endif
eaaca07
 # uninstall target to remove files from system
eaaca07
 .PHONY: uninstall
eaaca07
 uninstall: presubdirs subdirs
eaaca07
-ifneq ($(BINS_all)$(BINS_gui),)
eaaca07
-	$(SILENTSYMB)echo -e "$(INDENT_PRINT)--- Uninstalling binaries: $(subst $(BINDIR)/,,$(BINS_all) $(BINS_gui))"
eaaca07
-	$(SILENT)rm -f $(subst $(BINDIR),$(DESTDIR)$(EXEC_BINDIR),$(BINS_all) $(BINS_gui))
eaaca07
-	$(SILENT)$(foreach B,$(subst $(BINDIR)/,,$(BINS_all) $(BINS_gui)),$(if $(wildcard $(DESTDIR)$(EXEC_DFILEDIR)/$B.desktop),rm -f $(DESTDIR)$(EXEC_DFILEDIR)/$B.desktop;))
eaaca07
+ifneq ($(BINS_build)$(BINS_gui),)
eaaca07
+	$(SILENTSYMB)echo -e "$(INDENT_PRINT)--- Uninstalling binaries: $(subst $(BINDIR)/,,$(BINS_build) $(BINS_gui))"
eaaca07
+	$(SILENT)rm -f $(subst $(BINDIR),$(DESTDIR)$(EXEC_BINDIR),$(BINS_build) $(BINS_gui))
eaaca07
+	$(SILENT)$(foreach B,$(subst $(BINDIR)/,,$(BINS_build) $(BINS_gui)),$(if $(wildcard $(DESTDIR)$(EXEC_DFILEDIR)/$B.desktop),rm -f $(DESTDIR)$(EXEC_DFILEDIR)/$B.desktop;))
eaaca07
 endif
eaaca07
-ifneq ($(LIBS_all)$(LIBS_gui),)
eaaca07
-	$(SILENTSYMB)echo -e "$(INDENT_PRINT)--- Uninstalling libraries: $(subst $(LIBDIR)/,,$(LIBS_all) $(LIBS_gui))"
eaaca07
-	$(SILENT)$(foreach L,$(subst $(LIBDIR)/,,$(LIBS_all) $(LIBS_gui)), \
eaaca07
+ifneq ($(LIBS_build)$(LIBS_gui),)
eaaca07
+	$(SILENTSYMB)echo -e "$(INDENT_PRINT)--- Uninstalling libraries: $(subst $(LIBDIR)/,,$(LIBS_build) $(LIBS_gui))"
eaaca07
+	$(SILENT)$(foreach L,$(subst $(LIBDIR)/,,$(LIBS_build) $(LIBS_gui)), \
eaaca07
 	rm -f $(abspath $(DESTDIR)$(EXEC_LIBDIR)/$(INST_LIB_SUBDIR_$(call nametr,$(L:%.so=%))))/$L*; \
eaaca07
 	$(if $(HDRS_$(call nametr,$(L:%.so=%))), \
eaaca07
 	rm -f $(foreach h,$(HDRS_$(call nametr,$(L:%.so=%))),"$(DESTDIR)$(EXEC_INCDIR)/$(INST_HDRS_SUBDIR_$(call nametr,$(L:%.so=%)))/$(if $(HDR_RENAME_$h),$(HDR_RENAME_$h),$h)" ); \
eaaca07
 	))
eaaca07
 endif
eaaca07
-ifneq ($(PLUGINS_all)$(PLUGINS_gui),)
eaaca07
-	$(SILENTSYMB)echo -e "$(INDENT_PRINT)--- Uninstalling plugins: $(subst $(PLUGINDIR)/,,$(PLUGINS_all) $(PLUGINS_gui))"
eaaca07
-	$(SILENT)rm -f $(subst $(PLUGINDIR),$(DESTDIR)$(EXEC_PLUGINDIR),$(PLUGINS_all) $(PLUGINS_gui))
eaaca07
+ifneq ($(PLUGINS_build)$(PLUGINS_gui),)
eaaca07
+	$(SILENTSYMB)echo -e "$(INDENT_PRINT)--- Uninstalling plugins: $(subst $(PLUGINDIR)/,,$(PLUGINS_build) $(PLUGINS_gui))"
eaaca07
+	$(SILENT)rm -f $(subst $(PLUGINDIR),$(DESTDIR)$(EXEC_PLUGINDIR),$(PLUGINS_build) $(PLUGINS_gui))
eaaca07
 endif
eaaca07
 ifneq ($(INST_RESDIRS),)
eaaca07
 	$(SILENTSYMB)echo -e "$(INDENT_PRINT)--- Removing resource direcotries: $(INST_RESDIRS)"
eaaca07
@@ -200,13 +200,16 @@ $(DESTDIR)$(EXEC_LIBDIR)/%.so: $(LIBDIR)/%.so
eaaca07
 	ln -sf "$(notdir $(subst $(LIBDIR),$(abspath $(DESTDIR)$(EXEC_LIBDIR)/$(INST_LIB_SUBDIR_$(call nametr,$*))),$<).$(SOVER_$(call nametr,$*)))" "$(subst $(LIBDIR),$(abspath $(DESTDIR)$(EXEC_LIBDIR)/$(INST_LIB_SUBDIR_$(call nametr,$*))),$<)" || exit $$?; \
eaaca07
 	)
eaaca07
 	$(SILENT) $(if $(HDRS_$(call nametr,$*)),$(foreach h,$(HDRS_$(call nametr,$*)), \
eaaca07
-	if [ -f "$(SRCDIR)/$h" ]; then \
eaaca07
-		echo -e "$(INDENT_PRINT)--- Copying header $h to $(DESTDIR)$(EXEC_INCDIR)/$(INST_HDRS_SUBDIR_$(call nametr,$*))/$(if $(HDR_RENAME_$h),$(HDR_RENAME_$h),$h)"; \
eaaca07
-		install -D -m 644 "$(SRCDIR)/$h" "$(DESTDIR)$(EXEC_INCDIR)/$(INST_HDRS_SUBDIR_$(call nametr,$*))/$(if $(HDR_RENAME_$h),$(HDR_RENAME_$h),$h)" || exit $$?; \
eaaca07
+	if [ -f "$(SRCDIR)/$h" ] ; then \
eaaca07
+		hpath=$(SRCDIR)/$h; \
eaaca07
+	elif [ -f "$(IFACESRCDIR)/$h" ]; then \
eaaca07
+		hpath=$(IFACESRCDIR)/$h; \
eaaca07
 	else \
eaaca07
 		echo -e "$(INDENT_PRINT)--- $(TRED)Header $h does not exist.$(TNORMAL)"; \
eaaca07
 		exit 1; \
eaaca07
 	fi; \
eaaca07
+	echo -e "$(INDENT_PRINT)--- Copying header $h to $(DESTDIR)$(EXEC_INCDIR)/$(INST_HDRS_SUBDIR_$(call nametr,$*))/$(if $(HDR_RENAME_$h),$(HDR_RENAME_$h),$h)"; \
eaaca07
+	install -D -m 644 "$$hpath" "$(DESTDIR)$(EXEC_INCDIR)/$(INST_HDRS_SUBDIR_$(call nametr,$*))/$(if $(HDR_RENAME_$h),$(HDR_RENAME_$h),$h)" || exit $$?; \
eaaca07
 	))
eaaca07
 
eaaca07
 #	$(SILENTSYMB) for h in $(HDRS_$(call nametr,$*)); do \
84091e3
diff --git a/src/plugins/mongodb/Makefile b/src/plugins/mongodb/Makefile
84091e3
index df2de28b3..bd0705cb2 100644
84091e3
--- a/src/plugins/mongodb/Makefile
84091e3
+++ b/src/plugins/mongodb/Makefile
84091e3
@@ -19,8 +19,6 @@ include $(BASEDIR)/etc/buildsys/config.mk
84091e3
 include $(LIBSRCDIR)/utils/utils.mk
84091e3
 include $(BUILDSYSDIR)/boost.mk
84091e3
 
84091e3
-PRESUBDIRS = aspect interfaces
84091e3
-
84091e3
 INCDIRS += $(INCDIRS_MONGODB)
84091e3
 
84091e3
 MONGODB_REQ_BOOST_LIBS = system filesystem
84091e3
@@ -50,6 +48,7 @@ ifeq ($(HAVE_MONGODB_REQ_BOOST_LIBS),1)
84091e3
 endif
84091e3
 
84091e3
 ifeq ($(HAVE_MONGODB)$(HAVE_CPP14)$(HAVE_MONGODB_REQ_BOOST_LIBS),111)
84091e3
+  PRESUBDIRS = aspect interfaces
84091e3
   PLUGINS_build = $(PLUGINS_all)
84091e3
 else
84091e3
   ifneq ($(HAVE_MONGODB),1)
84091e3
diff --git a/src/plugins/pddl-planner/Makefile b/src/plugins/pddl-planner/Makefile
84091e3
index a26c250f1..8eea704ac 100644
84091e3
--- a/src/plugins/pddl-planner/Makefile
84091e3
+++ b/src/plugins/pddl-planner/Makefile
84091e3
@@ -18,8 +18,6 @@ BASEDIR = ../../..
84091e3
 include $(BASEDIR)/etc/buildsys/config.mk
84091e3
 include $(BASEDIR)/src/plugins/mongodb/mongodb.mk
84091e3
 
84091e3
-PRESUBDIRS = interfaces
84091e3
-
84091e3
 LIBS_pddl_planner = m fawkescore fawkesutils fawkesaspects fawkesbaseapp \
84091e3
                       fawkesblackboard fawkesinterface fawkesrobotmemory \
84091e3
                       PddlPlannerInterface
84091e3
@@ -30,6 +28,8 @@ OBJS_all    = $(OBJS_pddl_planner)
84091e3
 PLUGINS_all = $(PLUGINDIR)/pddl-planner.$(SOEXT)
84091e3
 
84091e3
 ifeq ($(HAVE_CPP11)$(HAVE_MONGODB),11)
84091e3
+  PRESUBDIRS = interfaces
84091e3
+
84091e3
   CFLAGS  += $(CFLAGS_CPP11) $(CFLAGS_MONGODB)
84091e3
   LDFLAGS += $(LDFLAGS_CTEMPLATE) $(LDFLAGS_MONGODB)
84091e3
 
84091e3
diff --git a/src/plugins/pddl-robot-memory/Makefile b/src/plugins/pddl-robot-memory/Makefile
84091e3
index ece300fa8..59b7c75fd 100644
84091e3
--- a/src/plugins/pddl-robot-memory/Makefile
84091e3
+++ b/src/plugins/pddl-robot-memory/Makefile
84091e3
@@ -19,8 +19,6 @@ include $(BASEDIR)/etc/buildsys/config.mk
84091e3
 include $(BASEDIR)/src/plugins/robot-memory/robot_memory.mk
84091e3
 include $(BASEDIR)/src/plugins/pddl-robot-memory/ctemplate.mk
84091e3
 
84091e3
-PRESUBDIRS = interfaces
84091e3
-
84091e3
 LIBS_pddl_robot_memory = m fawkescore fawkesutils fawkesaspects fawkesbaseapp \
84091e3
                          fawkesblackboard fawkesinterface fawkesrobotmemory \
84091e3
                          PddlGenInterface
84091e3
@@ -31,6 +29,9 @@ OBJS_all   = $(OBJS_pddl_robot_memory)
84091e3
 PLUGINS_all = $(PLUGINDIR)/pddl-robot-memory.$(SOEXT)	  
84091e3
 
84091e3
 ifeq ($(HAVE_CPP11)$(HAVE_ROBOT_MEMORY)$(HAVE_CTEMPLATE),111)
84091e3
+
84091e3
+  PRESUBDIRS = interfaces
84091e3
+
84091e3
   CFLAGS  += $(CFLAGS_CPP11)
84091e3
   LDFLAGS += $(LDFLAGS_CTEMPLATE)
84091e3
 
84091e3
diff --git a/src/plugins/perception/pcl-db/Makefile b/src/plugins/perception/pcl-db/Makefile
84091e3
index 47b495aef..e756d5456 100644
84091e3
--- a/src/plugins/perception/pcl-db/Makefile
84091e3
+++ b/src/plugins/perception/pcl-db/Makefile
84091e3
@@ -23,8 +23,6 @@ include $(BASEDIR)/src/plugins/mongodb/mongodb.mk
84091e3
 # Add -DUSE_TIMETRACKER to enable time tracking
84091e3
 CFLAGS += -DUSE_TIMETRACKER
84091e3
 
84091e3
-PRESUBDIRS = interfaces
84091e3
-
84091e3
 ifeq ($(PCL_USES_OPENMP),1)
84091e3
   ifneq ($(USE_OPENMP),1)
84091e3
     CFLAGS  += $(CFLAGS_OPENMP)
84091e3
@@ -57,6 +55,8 @@ PLUGINS_all = $(PLUGINDIR)/pcl-db-store.so \
84091e3
               $(PLUGINDIR)/pcl-db-merge.so
84091e3
 
84091e3
 ifeq ($(HAVE_MONGODB)$(HAVE_PCL)$(HAVE_TF)$(HAVE_CPP11),1111)
84091e3
+  PRESUBDIRS = interfaces
84091e3
+
84091e3
   CFLAGS += $(CFLAGS_PCL) $(CFLAGS_TF) $(CFLAGS_MONGODB) $(CFLAGS_CPP11)
84091e3
   LDFLAGS += $(LDFLAGS_PCL) $(LDFLAGS_TF) $(LDFLAGS_MONGODB)
84091e3
 
eaaca07
diff --git a/src/plugins/webview/Makefile b/src/plugins/webview/Makefile
eaaca07
index ea6986ab6..b27708cf3 100644
eaaca07
--- a/src/plugins/webview/Makefile
eaaca07
+++ b/src/plugins/webview/Makefile
eaaca07
@@ -45,7 +45,6 @@ PLUGINS_all = $(PLUGINDIR)/webview.so
eaaca07
 
eaaca07
 ifeq ($(HAVE_BOOST_LIBS)$(HAVE_LIBMICROHTTPD),11)
eaaca07
   PLUGINS_build = $(PLUGINS_all)
eaaca07
-  INST_RESDIRS = webview
eaaca07
 
eaaca07
   CFLAGS  += $(call boost-libs-cflags,$(REQ_BOOST_LIBS))
eaaca07
   LDFLAGS += $(call boost-libs-ldflags,$(REQ_BOOST_LIBS))
eaaca07
diff --git a/src/plugins/webview/frontend/Makefile b/src/plugins/webview/frontend/Makefile
eaaca07
index a03b74d7a..e7e6f520b 100644
eaaca07
--- a/src/plugins/webview/frontend/Makefile
eaaca07
+++ b/src/plugins/webview/frontend/Makefile
eaaca07
@@ -21,6 +21,7 @@ NPM = $(shell type -p npm)
eaaca07
 
eaaca07
 ifneq ($(NPM),)
eaaca07
   TARGETS_all += dist/index.html
eaaca07
+  INST_RESDIRS = webview
eaaca07
 
eaaca07
   SRCS_FRONTEND = $(shell find $(SRCDIR)/src/ -regex '.*\.\(html\|ts\|json\|js\|scss\)')
eaaca07
 else