about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2018-01-03 18:54:01 +0100
committerLeah Neukirchen <leah@vuxu.org>2018-01-03 18:54:01 +0100
commit61e78e06804250c2e9aef87aa11cd7dcf7253cae (patch)
tree17bfe40bf3d3cc6721485e91a29ab76e82fa5863
parentd894e01a8d04af999706099969ed4f9e733f4111 (diff)
downloadrdd-61e78e06804250c2e9aef87aa11cd7dcf7253cae.tar.gz
rdd-61e78e06804250c2e9aef87aa11cd7dcf7253cae.tar.xz
rdd-61e78e06804250c2e9aef87aa11cd7dcf7253cae.zip
rewrite Makefile
-rw-r--r--Makefile27
1 files changed, 22 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 43b5e2f..ea91cfa 100644
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,26 @@
-CFLAGS=-O3 -Wall
-all: rdd
+ALL=rdd
 
-rdd: sosemanuk.o rdd.o
+CFLAGS=-g -O3 -Wall -Wno-switch -Wextra -Wwrite-strings
+
+DESTDIR=
+PREFIX=/usr/local
+BINDIR=$(PREFIX)/bin
+MANDIR=$(PREFIX)/share/man
+
+all: $(ALL)
+
+clean: FRC
+	rm -f $(ALL) *.o
 
+rdd: sosemanuk.o rdd.o
 rdd.c: sosemanuk.h
 
-clean:
-	rm -f rdd rdd.o sosemanuk.o
+install: FRC all
+	mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(MANDIR)/man1 $(DESTDIR)$(ZSHCOMPDIR)
+	install -m0755 $(ALL) $(DESTDIR)$(BINDIR)
+	install -m0644 $(ALL:=.1) $(DESTDIR)$(MANDIR)/man1
+
+README: rdd.1
+	mandoc -Tutf8 $< | col -bx >$@
+
+FRC: