aboutsummaryrefslogtreecommitdiffgithub
path: root/Makefile
diff options
context:
space:
mode:
authorAustin Adams <screamingmoron@gmail.com>2015-08-08 20:48:18 -0400
committerAustin Adams <screamingmoron@gmail.com>2015-08-08 20:48:18 -0400
commit5cda9dfa4bc94ab06e0da8186104119ac0006349 (patch)
tree4a65d360b50971ca5d4eea68182aea1e9d582c61 /Makefile
downloadnsdo-5cda9dfa4bc94ab06e0da8186104119ac0006349.tar.gz
nsdo-5cda9dfa4bc94ab06e0da8186104119ac0006349.tar.xz
initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 29 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..390723a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,29 @@
+CFLAGS ?= -Wall -Werror -O3
+PREFIX ?= /usr/local
+
+PROG = nsdo
+MANSECTION = 1
+MANPAGE = $(PROG).$(MANSECTION)
+MANPAGEGZ = $(MANPAGE).gz
+README = README.md
+
+.PHONY: all install clean
+
+all: $(PROG) $(MANPAGEGZ) $(README)
+
+install: $(PROG) $(MANPAGEGZ)
+ install -Dm6755 $< $(PREFIX)/bin/$<
+ install -Dm644 $(word 2,$^) $(PREFIX)/share/man/man$(MANSECTION)/$(word 2,$^)
+
+clean:
+ rm -fv $(PROG) $(MANPAGEGZ) $(README)
+
+$(MANPAGEGZ): $(MANPAGE)
+ gzip --best -k $<
+
+$(README): readme.head $(MANPAGE)
+ { \
+ cat $<; \
+ echo; \
+ MANWIDTH=68 man -l $(word 2,$^) | sed 's/^/ /'; \
+ } >$@