aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-07-24 11:23:52 -0400
committerB. Watson <yalhcru@gmail.com>2021-07-24 11:23:52 -0400
commitf81125b285faa47273f699873fe49871123d0924 (patch)
tree3237e7a06c0beff704c42860f10c657d6135c091 /Makefile
parent0baa92a29a25d2bcf85b29176d8f764c7fcd2db9 (diff)
downloadslowbaud-f81125b285faa47273f699873fe49871123d0924.tar.gz
Add "make install"
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 11 insertions, 0 deletions
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