summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 11 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 172219f..b146099 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,6 @@
TARGET=xlnch
+PREFIX?=/usr/local
+MANUALS=$(PREFIX)/share/man
SRC=*.c
CC=gcc
CFLAGS=-D_GNU_SOURCE -std=c99 -pedantic
@@ -15,6 +17,9 @@ debug: $(SRC)
noasan: $(SRC)
$(CC) $(DBG_FLAGS) $(CFLAGS) -o $(TARGET) $^ $(LIBS)
+docs:
+ scdoc < man/xlnch.1.scd > man/xlnch.1
+
.PHONY: clean
clean:
@@ -22,7 +27,11 @@ clean:
rm -f $(TARGET)
install: $(TARGET)
- @cp -v $(TARGET) /usr/local/bin/$(TARGET)
+ mkdir -p $(PREFIX)/bin $(MANUALS)/man1
+ @cp -v $(TARGET) $(PREFIX)/bin/$(TARGET)
+ @install -v -m644 man/xlnch.1 $(MANUALS)/man1/xlnch.1
+
uninstall:
- @rm -v /usr/local/bin/$(TARGET)
+ @rm -v $(PREFIX)/bin/$(TARGET)
+ @rm -v $(MANUALS)/man1/xlnch.1