From f81125b285faa47273f699873fe49871123d0924 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sat, 24 Jul 2021 11:23:52 -0400 Subject: Add "make install" --- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 3cd67e0..d0efe49 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,11 @@ CFLAGS=-Wall -O2 $(EXTRACFLAGS) LIBS=-lutil RST2MAN=rst2man.py +PREFIX=/usr +BINDIR=$(PREFIX)/bin +MANDIR=$(PREFIX)/man +MAN1DIR=$(MANDIR)/man1 + all: $(PROJ) $(PROJ): $(PROJ).c $(PROJ).1 README.txt @@ -19,6 +24,12 @@ README.txt: $(PROJ).1 test: all sh test.sh +install: all + mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MAN1DIR) + install -s -m0755 $(PROJ) $(DESTDIR)$(BINDIR) + install -m0644 $(PROJ).1 $(DESTDIR)$(MAN1DIR) + gzip --help >/dev/null 2>/dev/null && gzip $(DESTDIR)$(MAN1DIR)/$(PROJ).1 + # Don't remove the man page or README here, it's in git. clean: rm -f $(PROJ) core *.o -- cgit v1.2.3