aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-08-16 13:01:30 +0200
committerMattias Andrée <maandree@operamail.com>2014-08-16 13:01:30 +0200
commit365dc51451c28f00e7693c931b1fa8866dd510ef (patch)
treec220f374da117c176f6ebc9500fe458d32168a58
parentadd makefile (diff)
downloadtimeprefix-1.tar.gz
timeprefix-1.tar.bz2
timeprefix-1.tar.xz
add install and uninstall rules1
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--Makefile32
1 files changed, 20 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index fb30138..61162c5 100644
--- a/Makefile
+++ b/Makefile
@@ -8,27 +8,20 @@
PREFIX ?= /usr
# The command path excluding prefix.
BIN ?= /bin
-# The library path excluding prefix.
-LIB ?= /lib
-# The executable library path excluding prefix.
-LIBEXEC ?= /libexec
# The resource path excluding prefix.
DATA ?= /share
# The command path including prefix.
BINDIR ?= $(PREFIX)$(BIN)
-# The library path including prefix.
-LIBDIR ?= $(PREFIX)$(LIB)
-# The executable library path including prefix.
-LIBEXECDIR ?= $(PREFIX)$(LIBEXEC)
# The resource path including prefix.
DATADIR ?= $(PREFIX)$(DATA)
-# The generic documentation path including prefix.
-DOCDIR ?= $(DATADIR)/doc
-# The info manual documentation path including prefix.
-INFODIR ?= $(DATADIR)/info
# The license base path including prefix.
LICENSEDIR ?= $(DATADIR)/licenses
+# The name of the command as it should be installed
+COMMAND ?= timeprefix
+# The name of the package as it should be installed
+PKGNAME ?= timeprefix
+
# Optimisation level (and debug flags.)
OPTIMISE = -Ofast
@@ -63,6 +56,21 @@ obj/%.o: src/%.c
$(CC) -std=$(STD) $(OPTIMISE) $(WARN) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
+.PHONY: install
+install: bin/timeprefix
+ install -dm755 -- "$(DESTDIR)$(BINDIR)"
+ install -m755 bin/timeprefix -- "$(DESTDIR)$(BINDIR)/$(COMMAND)"
+ install -dm755 -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
+ install -m644 LICENSE COPYING -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
+
+.PHONY: uninstall
+uninstall:
+ -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/COPYING"
+ -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE"
+ -rmdir -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
+ -rm -- "$(DESTDIR)$(BINDIR)/$(COMMAND)"
+
+
.PHONY: clean
clean:
-rm -r obj bin