aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-26 13:28:50 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-26 13:28:50 +0200
commit92b2294d976aebf7fb35d47123213bcac6b91d13 (patch)
tree39ea3d045e6546eba5ef72e6cc563b5d6f815c6a
parentadd x-window-focus (diff)
downloadnightshift-92b2294d976aebf7fb35d47123213bcac6b91d13.tar.gz
nightshift-92b2294d976aebf7fb35d47123213bcac6b91d13.tar.bz2
nightshift-92b2294d976aebf7fb35d47123213bcac6b91d13.tar.xz
update makefile0.4
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--Makefile23
1 files changed, 20 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 8aeff07..25a1249 100644
--- a/Makefile
+++ b/Makefile
@@ -10,10 +10,14 @@ PREFIX ?= /usr
BIN ?= /bin
# The resource path excluding prefix
DATA ?= /share
+# The documenation path excluding prefix and /share
+DOC ?= /doc
# The command path including prefix
BINDIR ?= $(PREFIX)$(BIN)
# The resource path including prefix
DATADIR ?= $(PREFIX)$(DATA)
+# The documentation path including prefix and /share
+DOCDIR ?= $(DATADIR)$(DOC)
# The license base path including prefix
LICENSEDIR ?= $(DATADIR)/licenses
@@ -27,6 +31,9 @@ PKGNAME ?= nightshift
# Python source files
PYFILES = __main__.py interface.py
+# Configuration script example files
+EXAMPLES = x-window-focus
+
# Build rules
@@ -78,12 +85,12 @@ bin/nightshift.fish: src/completion
# Install rules
.PHONY: install
-install: install-base install-shell
+install: install-base install-examples install-shell
.PHONY: install
-install-all: install-base install-shell
+install-all: install-base install-examples install-shell
-# Install base rules
+# Install base
.PHONY: install-base
install-base: install-command install-license
@@ -98,6 +105,13 @@ install-license:
install -dm755 -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
install -m644 COPYING LICENSE -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
+# Install documentation
+
+.PHONY: install-examples
+install-examples: $(foreach E,$(EXAMPLES),examples/$(E))
+ install -dm755 -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME)/examples"
+ install -m644 $^ -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME)/examples"
+
# Install shell auto-completion
.PHONY: install-shell
@@ -127,6 +141,9 @@ uninstall:
-rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/COPYING"
-rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE"
-rmdir -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
+ -rm -- $(foreach E,$(EXAMPLES),"$(DESTDIR)$(DOCDIR)/$(PKGNAME)/examples/$(E)")
+ -rmdir -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME)/examples"
+ -rmdir -- "$(DESTDIR)$(DOCDIR)/$(PKGNAME)"
-rm -- "$(DESTDIR)$(DATADIR)/fish/completions/$(COMMAND).fish"
-rmdir -- "$(DESTDIR)$(DATADIR)/fish/completions"
-rmdir -- "$(DESTDIR)$(DATADIR)/fish"