From 4a73ba328f374320ee36a77439b7c4fd58d5b84c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 20 Feb 2021 00:40:19 +0100 Subject: m + improve makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 52 ++++++++++++++++++++-------------------------------- 1 file changed, 20 insertions(+), 32 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index f0d87a4..1589ccf 100644 --- a/Makefile +++ b/Makefile @@ -1,38 +1,26 @@ -PREFIX = /usr -BINDIR = $(PREFIX)/bin -DATADIR = $(PREFIX)/share -MANDIR = $(DATADIR)/man -LICENSEDIR = $(DATADIR)/license +.POSIX: -PKGNAME = blue -COMMAND = blue +PREFIX = /usr +MANPREFIX = $(PREFIX)/share/man all: -clean: - -install: install-cmd install-doc install-license -install-doc: install-man - -install-cmd: - mkdir -p -- "$(DESTDIR)$(BINDIR)" - cp -- blue.py "$(DESTDIR)$(BINDIR)/$(COMMAND)" - chmod 0755 -- "$(DESTDIR)$(BINDIR)/$(COMMAND)" + @: + +install: + mkdir -p -- "$(DESTDIR)$(PREFIX)/bin" + mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1" + mkdir -p -- "$(DESTDIR)$(PREFIX)/share/licenses/blue" + cp -- blue "$(DESTDIR)$(PREFIX)/bin/" + cp -- blue.1 "$(DESTDIR)$(MANDIR)/man1/" + cp -- LICENSE "$(DESTDIR)$(PREFIX)/share/licenses/blue/" + +uninstall: + -rm -f -- "$(DESTDIR)$(PREFIX)/bin/blue" + -rm -f -- blue.1 "$(DESTDIR)$(MANPREFIX)/man1/blue.1" + -rm -f -- LICENSE "$(DESTDIR)$(PREFIX)/share/licenses/blue/LICENSE" + -rmdir -- LICENSE "$(DESTDIR)$(PREFIX)/share/licenses/blue" -install-man: - mkdir -p -- "$(DESTDIR)$(MANDIR)/man1" - cp -- blue.py "$(DESTDIR)$(MANDIR)/man1/$(COMMAND).1" - chmod 0644 -- "$(DESTDIR)$(MANDIR)/man1/$(COMMAND).1" - -install-license: - mkdir -p -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)" - cp -- LICENSE "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE" - chmod 0644 -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE" - -uninstall: - -rm -- "$(DESTDIR)$(BINDIR)/$(COMMAND)" - -rm -- "$(DESTDIR)$(MANDIR)/man1/$(COMMAND).1" - -rm -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)/LICENSE" - -rmdir -- "$(DESTDIR)$(LICENSEDIR)/$(PKGNAME)" +clean: + @: .PHONY: all install uninstall clean -.PHONY: install-cmd install-doc install-man install-license -- cgit v1.2.3-70-g09d2