aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile35
1 files changed, 35 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 59b9bc6..157a6f9 100644
--- a/Makefile
+++ b/Makefile
@@ -21,6 +21,8 @@ MANDIR ?=$(PREFIX)/share/man
ARCHIVE ?= tarballs
INSTALL = /usr/bin/install
+.PHONY: clean install_lib install_bin install_doc install_man install_completion install build_man tarball release debian web web_deploy uninstall
+
clean:
find . -name *~ | xargs rm -f # clean local backups
@@ -31,23 +33,56 @@ install_lib:
$(INSTALL) -D -m 0755 -d share/keyringer/editors $(DESTDIR)/$(PREFIX)/share/$(PACKAGE)/editors
$(INSTALL) -D -m 0644 share/keyringer/editors/* $(DESTDIR)/$(PREFIX)/share/$(PACKAGE)/editors
+uninstall_lib:
+ rm -f $(DESTDIR)/$(PREFIX)/lib/$(PACKAGE)/functions
+ rm -f $(DESTDIR)/$(PREFIX)/lib/$(PACKAGE)/actions/*
+ rmdir $(DESTDIR)/$(PREFIX)/lib/$(PACKAGE)/actions 2> /dev/null || true
+ rmdir $(DESTDIR)/$(PREFIX)/lib/$(PACKAGE) 2> /dev/null || true
+ rm -f $(DESTDIR)/$(PREFIX)/share/$(PACKAGE)/editors/*
+ rmdir $(DESTDIR)/$(PREFIX)/share/$(PACKAGE)/editors 2> /dev/null || true
+ rmdir $(DESTDIR)/$(PREFIX)/share/$(PACKAGE) 2> /dev/null || true
+ rmdir -p $(DESTDIR)/$(PREFIX)/lib 2>/dev/null || true
+
install_bin:
$(INSTALL) -D -m 0755 keyringer $(DESTDIR)/$(PREFIX)/bin/keyringer
+uninstall_bin:
+ rm -f $(DESTDIR)/$(PREFIX)/bin/keyringer
+ rmdir -p $(DESTDIR)/$(PREFIX)/bin 2>/dev/null || true
+
install_doc:
$(INSTALL) -D -m 0644 index.md $(DESTDIR)/$(PREFIX)/share/doc/$(PACKAGE)/README.md
$(INSTALL) -D -m 0644 LICENSE $(DESTDIR)/$(PREFIX)/share/doc/$(PACKAGE)/LICENSE
+uninstall_doc:
+ rm -f $(DESTDIR)/$(PREFIX)/share/doc/$(PACKAGE)/LICENSE
+ rm -f $(DESTDIR)/$(PREFIX)/share/doc/$(PACKAGE)/README.md
+ rmdir $(DESTDIR)/$(PREFIX)/share/doc/$(PACKAGE) 2>/dev/null || true
+ rmdir $(DESTDIR)/$(PREFIX)/share/doc 2>/dev/null || true
+
install_man:
$(INSTALL) -D -m 0644 share/man/keyringer.1 $(DESTDIR)/$(MANDIR)/man1/keyringer.1
+uninstall_man:
+ rm -f $(DESTDIR)/$(PREFIX)/share/man/man1/keyringer.1
+ rmdir -p $(DESTDIR)/$(PREFIX)/share/man/man1 2> /dev/null || true
+
install_completion:
$(INSTALL) -D -m 0644 lib/keyringer/completions/bash/keyringer $(DESTDIR)/$(PREFIX)/share/bash-completion/completions/keyringer
$(INSTALL) -D -m 0644 lib/keyringer/completions/zsh/_keyringer $(DESTDIR)/$(PREFIX)/share/zsh/site-functions/_keyringer
+uninstall_completion:
+ rm -f $(DESTDIR)/$(PREFIX)/share/zsh/site-functions/_keyringer
+ rm -f $(DESTDIR)/$(PREFIX)/share/bash-completion/completions/keyringer
+ rmdir -p $(DESTDIR)/$(PREFIX)/share/zsh/site-functions 2> /dev/null || true
+ rmdir -p $(DESTDIR)/$(PREFIX)/share/bash-completion/completions 2> /dev/null || true
+
install: clean
@make install_lib install_bin install_doc install_man install_completion
+uninstall: uninstall_completion uninstall_man uninstall_doc uninstall_bin uninstall_lib
+ rmdir -p $(DESTDIR)/$(PREFIX)/share 2>/dev/null || true
+
build_man:
# Pipe output to sed to avoid http://lintian.debian.org/tags/hyphen-used-as-minus-sign.html
# Fixed in http://johnmacfarlane.net/pandoc/releases.html#pandoc-1.10-2013-01-19