aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-08-24 00:14:20 +0200
committerMattias Andrée <maandree@operamail.com>2014-08-24 00:14:20 +0200
commitd468e50867760fbd017e01b1fc7514f34c98df4a (patch)
tree850c96ce979b5d109fd5404c9abad6503ea44f1f /Makefile
parentadd makefile (diff)
downloadsetpgrp-d468e50867760fbd017e01b1fc7514f34c98df4a.tar.gz
setpgrp-d468e50867760fbd017e01b1fc7514f34c98df4a.tar.bz2
setpgrp-d468e50867760fbd017e01b1fc7514f34c98df4a.tar.xz
add install and uninstall rules
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--Makefile33
1 files changed, 32 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 25480da..2f0613b 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ INFODIR ?= $(DATADIR)/info
LICENSEDIR ?= $(DATADIR)/licenses
# The name of the package as it should be installed.
-PKGNAME ?= mds
+PKGNAME ?= setpgrp
# Optimisation level (and debug flags.)
@@ -71,6 +71,37 @@ bin/%: src/%.c
$(CC) $(C_FLAGS) -o $@ $^
+.PHONY: install
+install: install-commands install-license
+
+.PHONY: install-commands
+install-commands: install-getpgrp install-setpgrp
+
+.PHONY: install-getpgrp
+install-getpgrp: bin/getpgrp
+ install -dm755 -- "$(DESTDIR)$(BINDIR)"
+ install -m755 $< -- "$(DESTDIR)$(BINDIR)/getpgrp"
+
+.PHONY: install-setpgrp
+install-setpgrp: bin/setpgrp
+ install -dm755 -- "$(DESTDIR)$(BINDIR)"
+ install -m755 $< -- "$(DESTDIR)$(BINDIR)/setpgrp"
+
+.PHONY: install-license
+install-license:
+ install -dm755 -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
+ install -m644 COPYING LICENSE -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
+
+
+.PHONY: uninstall
+uninstall:
+ -rm -- "$(DESTDIR)$(BINDIR)/getpgrp"
+ -rm -- "$(DESTDIR)$(BINDIR)/setpgrp"
+ -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/COPYING"
+ -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE"
+ -rmdir -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)"
+
+
.PHONY: clean
clean:
-rm -r -- bin