summaryrefslogtreecommitdiffstats
path: root/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am41
1 files changed, 41 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..26f3c7c
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,41 @@
+SUBDIRS = completions doc helpers test
+
+pkgdata_DATA = bash_completion
+
+# Empty, but here just to get the compat dir created with install
+compatdir = $(sysconfdir)/bash_completion.d
+compat_DATA =
+
+profiledir = $(sysconfdir)/profile.d
+profile_DATA = bash_completion.sh
+
+pkgconfigdir = $(datadir)/pkgconfig
+pkgconfig_DATA = bash-completion.pc
+
+cmakeconfigdir = $(datadir)/cmake/$(PACKAGE)/
+cmakeconfig_DATA = bash-completion-config.cmake \
+ bash-completion-config-version.cmake
+
+%: %.in Makefile
+ $(SED) \
+ -e 's|@prefix[@]|$(prefix)|' \
+ -e 's|@datadir[@]|$(datadir)|' \
+ -e 's|@sysconfdir[@]|$(sysconfdir)|' \
+ -e 's|@PACKAGE[@]|$(PACKAGE)|' \
+ -e 's|@VERSION[@]|$(VERSION)|' \
+ <$(srcdir)/$@.in >$@
+
+CLEANFILES = bash_completion.sh bash-completion.pc \
+ bash-completion-config.cmake bash-completion-config-version.cmake
+
+EXTRA_DIST = CHANGES $(pkgdata_DATA) bash_completion.sh.in .dir-locals.el \
+ .editorconfig README.md CONTRIBUTING.md pyproject.toml .perltidyrc \
+ .shellcheckrc bash-completion.pc.in bash-completion-config.cmake.in \
+ bash-completion-config-version.cmake.in setup-symlinks.sh
+
+install-data-hook:
+ tmpfile=`mktemp $${TMPDIR:-/tmp}/bash_completion.XXXXXX` && \
+ $(SED) -e 's|-/etc/bash_completion\.d|-$(compatdir)|' \
+ $(DESTDIR)$(datadir)/$(PACKAGE)/bash_completion >$$tmpfile && \
+ cat $$tmpfile >$(DESTDIR)$(datadir)/$(PACKAGE)/bash_completion && \
+ rm $$tmpfile