aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2013-06-24 20:14:41 +0200
committerMattias Andrée <maandree@operamail.com>2013-06-24 20:14:41 +0200
commitb582acc1d42c014f6d6f74913e510427d043911f (patch)
treeeaab481b0dda779fe88e4b27b5ff2331a2870b90
parentadd info manual (diff)
downloadmongotimer-b582acc1d42c014f6d6f74913e510427d043911f.tar.gz
mongotimer-b582acc1d42c014f6d6f74913e510427d043911f.tar.bz2
mongotimer-b582acc1d42c014f6d6f74913e510427d043911f.tar.xz
add makefile
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rw-r--r--Makefile55
1 files changed, 55 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..6eff754
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,55 @@
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved. This file is offered as-is,
+# without any warranty.
+
+PREFIX = /usr
+DATA = /share
+BIN = /bin
+LIBEXEC = /libexec
+PKGNAME = mongoclock
+COMMAND = mongoclock
+LICENSES = $(PREFIX)$(DATA)
+
+
+all: mongoclock.install doc
+
+doc: info
+
+info: mongoclock.info.gz
+
+%.info.gz: info/%.texinfo
+ makeinfo "$<"
+ gzip -9 -f "$*.info"
+
+mongoclock.install: mongoclock
+ cp "$<" "$@"
+ sed -i 's:$$0.py:$(DESTDIR)$(PREFIX)$(LIBEXEC)/$(COMMAND).py:g' "$@"
+
+install: install-cmd install-license install-info
+
+install-cmd:
+ install -dm755 "$(DESTDIR)$(PREFIX)$(BIN)"
+ install -dm755 "$(DESTDIR)$(PREFIX)$(LIBEXEC)"
+ install -m755 mongoclock.install "$(DESTDIR)$(PREFIX)$(BIN)/$(COMMAND)"
+ install -m755 mongoclock.py "$(DESTDIR)$(PREFIX)$(LIBEXEC)/$(COMMAND).py"
+
+install-license:
+ install -dm755 "$(DESTDIR)$(LICENSES)/$(PKGNAME)"
+ install -m644 COPYING LICENSE "$(DESTDIR)$(LICENSES)/$(PKGNAME)"
+
+install-info: mongoclock.info.gz
+ install -dm755 "$(DESTDIR)$(PREFIX)$(DATA)/info"
+ install -m644 mongoclock.info.gz "$(DESTDIR)$(PREFIX)$(DATA)/info/$(PKGNAME).info.gz"
+
+uninstall:
+ -rm -- "$(DESTDIR)$(PREFIX)$(BIN)/$(COMMAND)"
+ -rm -- "$(DESTDIR)$(LICENSES)/$(PKGNAME)/COPYING"
+ -rm -- "$(DESTDIR)$(LICENSES)/$(PKGNAME)/LICENSE"
+ -rmdir -- "$(DESTDIR)$(LICENSES)/$(PKGNAME)"
+ -rm -- "$(DESTDIR)$(PREFIX)$(DATA)/info/$(PKGNAME).info.gz"
+
+.PHONY: clean
+clean:
+ -rm -f mongoclock.info.gz mongoclock.install
+