make: split out completion scripts from root worktree
This commit is contained in:
parent
225bac5a49
commit
bb1a89a837
33
Makefile
33
Makefile
|
@ -74,11 +74,7 @@ CROSSREPOMOVE_LINKS = \
|
||||||
extra2community \
|
extra2community \
|
||||||
community2extra
|
community2extra
|
||||||
|
|
||||||
COMPLETIONS = \
|
COMPLETIONS = $(addprefix $(BUILDDIR)/,$(patsubst %.in,%,$(wildcard contrib/completion/*/*)))
|
||||||
bash_completion \
|
|
||||||
zsh_completion
|
|
||||||
COMPLETIONS := $(addprefix $(BUILDDIR)/completion/,$(COMPLETIONS))
|
|
||||||
|
|
||||||
BASHCOMPLETION_LINKS = \
|
BASHCOMPLETION_LINKS = \
|
||||||
archco \
|
archco \
|
||||||
communityco
|
communityco
|
||||||
|
@ -108,14 +104,18 @@ man: $(MANS)
|
||||||
|
|
||||||
edit = sed -e "s|@pkgdatadir[@]|$(PREFIX)/share/devtools|g"
|
edit = sed -e "s|@pkgdatadir[@]|$(PREFIX)/share/devtools|g"
|
||||||
|
|
||||||
$(BUILDDIR)/bin/% $(BUILDDIR)/completion/%: %.in Makefile $(wildcard lib/*.sh)
|
define buildInScript
|
||||||
@echo "GEN $(notdir $@)"
|
$(1)/%: $(2)%.in
|
||||||
@mkdir -p $(dir $@)
|
@echo "GEN $$(notdir $$@)"
|
||||||
@$(RM) "$@"
|
@mkdir -p $$(dir $$@)
|
||||||
@{ echo -n 'm4_changequote([[[,]]])'; cat $<; } | m4 -P --define=m4_devtools_version=$(BUILDTOOLVER) | $(edit) >$@
|
@$(RM) "$$@"
|
||||||
@chmod a-w "$@"
|
@{ echo -n 'm4_changequote([[[,]]])'; cat $$<; } | m4 -P --define=m4_devtools_version=$$(BUILDTOOLVER) | $(edit) >$$@
|
||||||
@chmod +x "$@"
|
@chmod $(3) "$$@"
|
||||||
@bash -O extglob -n "$@"
|
@bash -O extglob -n "$$@"
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call buildInScript,build/bin,,555))
|
||||||
|
$(foreach completion,$(wildcard contrib/completion/*),$(eval $(call buildInScript,build/$(completion),$(completion)/,444)))
|
||||||
|
|
||||||
$(BUILDDIR)/doc/%: doc/%.asciidoc doc/asciidoc.conf doc/footer.asciidoc
|
$(BUILDDIR)/doc/%: doc/%.asciidoc doc/asciidoc.conf doc/footer.asciidoc
|
||||||
@mkdir -p $(BUILDDIR)/doc
|
@mkdir -p $(BUILDDIR)/doc
|
||||||
|
@ -134,9 +134,9 @@ install: all
|
||||||
for l in ${ARCHBUILD_LINKS}; do ln -sf archbuild $(DESTDIR)$(PREFIX)/bin/$$l; done
|
for l in ${ARCHBUILD_LINKS}; do ln -sf archbuild $(DESTDIR)$(PREFIX)/bin/$$l; done
|
||||||
for l in ${CROSSREPOMOVE_LINKS}; do ln -sf crossrepomove $(DESTDIR)$(PREFIX)/bin/$$l; done
|
for l in ${CROSSREPOMOVE_LINKS}; do ln -sf crossrepomove $(DESTDIR)$(PREFIX)/bin/$$l; done
|
||||||
ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides
|
ln -sf find-libdeps $(DESTDIR)$(PREFIX)/bin/find-libprovides
|
||||||
install -Dm0644 $(BUILDDIR)/bash_completion $(DESTDIR)$(PREFIX)/share/bash-completion/completions/devtools
|
install -Dm0644 $(BUILDDIR)/contrib/completion/bash/devtools $(DESTDIR)$(PREFIX)/share/bash-completion/completions/devtools
|
||||||
for l in ${BASHCOMPLETION_LINKS}; do ln -sf devtools $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$$l; done
|
for l in ${BASHCOMPLETION_LINKS}; do ln -sf devtools $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$$l; done
|
||||||
install -Dm0644 $(BUILDDIR)/zsh_completion $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
|
install -Dm0644 $(BUILDDIR)/contrib/completion/zsh/_devtools $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_devtools
|
||||||
ln -sf archco $(DESTDIR)$(PREFIX)/bin/communityco
|
ln -sf archco $(DESTDIR)$(PREFIX)/bin/communityco
|
||||||
for manfile in $(MANS); do \
|
for manfile in $(MANS); do \
|
||||||
install -Dm644 $$manfile -t $(DESTDIR)$(MANDIR)/man$${manfile##*.}; \
|
install -Dm644 $$manfile -t $(DESTDIR)$(MANDIR)/man$${manfile##*.}; \
|
||||||
|
@ -155,6 +155,7 @@ uninstall:
|
||||||
rm -f $(DESTDIR)$(PREFIX)/bin/communityco
|
rm -f $(DESTDIR)$(PREFIX)/bin/communityco
|
||||||
rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides
|
rm -f $(DESTDIR)$(PREFIX)/bin/find-libprovides
|
||||||
for manfile in $(notdir $(MANS)); do rm -f $(DESTDIR)$(MANDIR)/man$${manfile##*.}/$${manfile}; done;
|
for manfile in $(notdir $(MANS)); do rm -f $(DESTDIR)$(MANDIR)/man$${manfile##*.}/$${manfile}; done;
|
||||||
|
rmdir --ignore-fail-on-non-empty $(DESTDIR)$(PREFIX)/share/devtools/setarch-aliases.d $(DESTDIR)$(PREFIX)/share/devtools
|
||||||
|
|
||||||
TODAY=$(shell date +"%Y%m%d")
|
TODAY=$(shell date +"%Y%m%d")
|
||||||
tag:
|
tag:
|
||||||
|
@ -169,7 +170,7 @@ dist:
|
||||||
upload:
|
upload:
|
||||||
scp devtools-$(V).tar.gz devtools-$(V).tar.gz.sig repos.archlinux.org:/srv/ftp/other/devtools/
|
scp devtools-$(V).tar.gz devtools-$(V).tar.gz.sig repos.archlinux.org:/srv/ftp/other/devtools/
|
||||||
|
|
||||||
check: $(BINPROGS) $(BUILDDIR)/bash_completion makepkg-x86_64.conf PKGBUILD.proto
|
check: $(BINPROGS) $(BUILDDIR)/contrib/completion/bash/devtools makepkg-x86_64.conf PKGBUILD.proto
|
||||||
shellcheck $^
|
shellcheck $^
|
||||||
|
|
||||||
.PHONY: all completion man clean install uninstall dist upload check tag
|
.PHONY: all completion man clean install uninstall dist upload check tag
|
||||||
|
|
Loading…
Reference in New Issue