aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-08-08 14:16:45 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-08-08 14:16:45 +0200
commit21d353f91e9cb3869334a9118173d86b3fa8c6da (patch)
tree3262e46da5d08ba1bfb7ed73de52b340f1d9ce66
parent6229023e78640519c987273558a8649eac1816ca (diff)
downloadmblaze-21d353f91e9cb3869334a9118173d86b3fa8c6da.tar.gz
Makefile: add install rule
-rw-r--r--Makefile14
1 files changed, 14 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index c2b8dd0..8004ca8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,12 @@
CFLAGS=-g -O2 -Wall -Wno-switch -Wextra -fstack-protector-strong -D_FORTIFY_SOURCE=2
+DESTDIR=
+PREFIX=/usr/local
+BINDIR=$(PREFIX)/bin
+MANDIR=$(PREFIX)/share/man
+
ALL = maddr magrep mdate mdeliver mdirs mflag mgenmid mhdr minc mlist mmime mpick mscan msed mseq mshow msort mthread
+SCRIPT = mcolor mcomp mless mquote
all: $(ALL)
@@ -29,4 +35,12 @@ README: man/mblaze.7
clean: FRC
-rm -f $(ALL) *.o
+install: FRC all
+ mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1
+ install -m0755 $(ALL) $(SCRIPT) $(DESTDIR)$(BINDIR)
+ ln -sf mless $(DESTDIR)$(BINDIR)/mnext
+ ln -sf mless $(DESTDIR)$(BINDIR)/mprev
+ ln -sf mrepl $(DESTDIR)$(BINDIR)/mcomp
+ install -m0644 man/*.[0-9] $(DESTDIR)$(MANDIR)/man1
+
FRC: