helpers: use $(INSTALL) to ... install the helper.
[platform/upstream/gstreamer.git] / libs / gst / helpers / Makefile.am
index 2816bc2..a616721 100644 (file)
@@ -1,3 +1,23 @@
+if ENABLE_BASH_COMPLETION
+bin_PROGRAMS = gst-completion-helper-@GST_API_VERSION@
+
+gst_completion_helper_@GST_API_VERSION@_SOURCES = gst-completion-helper.c
+gst_completion_helper_@GST_API_VERSION@_CFLAGS = $(GST_OBJ_CFLAGS)
+gst_completion_helper_@GST_API_VERSION@_LDADD = $(GST_OBJ_LIBS)
+
+bashhelpersdir = $(BASH_HELPERS_DIR)
+dist_bashhelpers_DATA = gst
+
+install-exec-hook:
+       cd $(DESTDIR)$(bindir) && \
+       $(INSTALL) `echo "gst-completion-helper-" | sed '$(transform)'`@GST_API_VERSION@$(EXEEXT) \
+       -D $(DESTDIR)$(BASH_HELPERS_DIR)/gst-completion-helper-@GST_API_VERSION@$(EXEEXT) && \
+       rm `echo "gst-completion-helper-" | sed '$(transform)'`@GST_API_VERSION@$(EXEEXT)
+
+uninstall-hook:
+       rm -f $(DESTDIR)$(BASH_HELPERS_DIR)/gst-completion-helper-@GST_API_VERSION@$(EXEEXT)
+endif
+
 helpers_PROGRAMS = gst-plugin-scanner
 helpersdir=$(libexecdir)/gstreamer-$(GST_API_VERSION)
 
@@ -17,3 +37,7 @@ Android.mk: Makefile.am
 # clean out the old one to make sure everything is udpated correctly
 # remove again after release
 CLEANFILES = plugin-scanner
+
+if ENABLE_BASH_COMPLETION
+CLEANFILES += gst-completion-helper-@GST_API_VERSION@
+endif