summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMarten Ringwelski <git@maringuu.de>2021-03-16 22:28:05 +0100
committerHubert Hirtz <hubert@hirtz.pm>2021-03-16 23:11:32 +0100
commit47bf3860df0c38e77a3866586d628a0480d7d946 (patch)
treea18d8cbc170bcb87cee24538ad2d8889f22e8ddf /Makefile
parentdocs: Fix typo (diff)
Add Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile33
1 files changed, 33 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..8cc57e5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,33 @@
+.POSIX:
+.SUFFIXES:
+
+GO = go
+RM = rm
+SCDOC = scdoc
+GOFLAGS =
+PREFIX = /usr/local
+BINDIR = bin
+MANDIR = share/man
+
+all: senpai doc/senpai.1 doc/senpai.5
+
+senpai:
+ $(GO) build $(GOFLAGS) ./cmd/senpai
+doc/senpai.1: doc/senpai.1.scd
+ $(SCDOC) < doc/senpai.1.scd > doc/senpai.1
+doc/senpai.5: doc/senpai.5.scd
+ $(SCDOC) < doc/senpai.5.scd > doc/senpai.5
+
+clean:
+ $(RM) -rf senpai doc/senpai.1 doc/senpai.5
+install: all
+ mkdir -p $(DESTDIR)$(PREFIX)/$(BINDIR)
+ mkdir -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
+ mkdir -p $(DESTDIR)$(PREFIX)/$(MANDIR)/man5
+ cp -f senpai $(DESTDIR)$(PREFIX)/$(BINDIR)
+ cp -f doc/senpai.1 $(DESTDIR)$(PREFIX)/$(MANDIR)/man1
+ cp -f doc/senpai.5 $(DESTDIR)$(PREFIX)/$(MANDIR)/man5
+uninstall:
+ $(RM) $(DESTDIR)$(PREFIX)/$(BINDIR)/senpai
+ $(RM) $(DESTDIR)$(PREFIX)/$(MANDIR)/man1/senpai.1
+ $(RM) $(DESTDIR)$(PREFIX)/$(MANDIR)/man5/senpai.5