From d468e50867760fbd017e01b1fc7514f34c98df4a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 24 Aug 2014 00:14:20 +0200 Subject: add install and uninstall rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3-70-g09d2