summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-09-07 18:39:35 -0400
committerJune McEnroe <june@causal.agency>2018-09-07 18:39:35 -0400
commit2f5dcd268b6d4c4bf5c792c7e1264704668ab77e (patch)
tree66aaa028769e1cf53da82bbf9fdd6ef69f818ac0
parentSymlink atch.1 (diff)
downloadsrc-2f5dcd268b6d4c4bf5c792c7e1264704668ab77e.tar.gz
src-2f5dcd268b6d4c4bf5c792c7e1264704668ab77e.zip
Link man pages in ~/.local
-rw-r--r--bin/Makefile11
1 files changed, 8 insertions, 3 deletions
diff --git a/bin/Makefile b/bin/Makefile
index 6e92483d..6038d2e4 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -1,7 +1,10 @@
+PREFIX = ~/.local
+
 ANY_BINS = atch dtch glitch hnel modem open pbcopy pbd pbpaste pngo scheme wake xx
 BSD_BINS = klon watch
 LIN_BINS = bri fbatt fbclock
 ALL_BINS = $(ANY_BINS) $(BSD_BINS) $(LIN_BINS)
+ALL_MANS = $(ALL_BINS:%=%.1)
 
 CFLAGS += -Wall -Wextra -Wpedantic
 LDLIBS = -lcurses -lm -lutil -lz
@@ -40,8 +43,10 @@ clean:
 	rm -f tags $(ALL_BINS)
 
 link:
-	mkdir -p ~/.local/bin
-	ln -s -f $(ALL_BINS:%=$(PWD)/%) ~/.local/bin
+	mkdir -p $(PREFIX)/bin $(PREFIX)/share/man/man1
+	ln -s -f $(ALL_BINS:%=$(PWD)/%) $(PREFIX)/bin
+	ln -s -f $(ALL_MANS:%=$(PWD)/%) $(PREFIX)/share/man/man1
 
 unlink:
-	rm -f $(ALL_BINS:%=~/.local/bin/%)
+	rm -f $(ALL_BINS:%=$(PREFIX)/bin/%)
+	rm -f $(ALL_MANS:%=$(PREFIX)/share/man/man1/%)