From bceeabdf443d5e03ac38a80a195383d3ef800ffa Mon Sep 17 00:00:00 2001 From: orbea Date: Tue, 3 May 2022 09:29:28 -0700 Subject: [PATCH] build: Use standard install variables This removes DESTDIR from both BINDIR and MANDIR and adds it directly to the intall and uninstall rules. This also moves 'man1' directly to the rules as it should not be configurable by the user. And lastly this removes the non-standard and now useless MANPREFIX. --- Makefile | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) rewrite Makefile (60%) diff --git a/Makefile b/Makefile dissimilarity index 60% index 8fea662..43c90f4 100644 --- a/Makefile +++ b/Makefile @@ -1,24 +1,23 @@ -LDLIBS=-lncursesw -PREFIX=/usr/local -MANPREFIX=$(PREFIX)/man -BINDIR=$(DESTDIR)$(PREFIX)/bin -MANDIR=$(DESTDIR)$(MANPREFIX)/man1 - -all: rover - -rover: rover.c config.h - $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDLIBS) - -install: rover - rm -f $(BINDIR)/rover - mkdir -p $(BINDIR) - cp rover $(BINDIR)/rover - mkdir -p $(MANDIR) - cp rover.1 $(MANDIR)/rover.1 - -uninstall: - rm -f $(BINDIR)/rover - rm -f $(MANDIR)/rover.1 - -clean: - rm -f rover +LDLIBS=-lncursesw +PREFIX=/usr/local +BINDIR=$(PREFIX)/bin +MANDIR=$(PREFIX)/man + +all: rover + +rover: rover.c config.h + $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LDLIBS) + +install: rover + rm -f $(DESTDIR)$(BINDIR)/rover + mkdir -p $(DESTDIR)$(BINDIR) + cp rover $(DESTDIR)$(BINDIR)/rover + mkdir -p $(DESTDIR)$(MANDIR)/man1 + cp rover.1 $(DESTDIR)$(MANDIR)/man1/rover.1 + +uninstall: + rm -f $(DESTDIR)$(BINDIR)/rover + rm -f $(DESTDIR)$(MANDIR)/man1/rover.1 + +clean: + rm -f rover -- 2.11.4.GIT