~taiite/senpai

ref: 917f7544003088bb215b5f29cd54a23325c7d442 senpai/Makefile -rw-r--r-- 893 bytes
917f7544 — Nomeji make install an independant task in Makefile a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
.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:
	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

.PHONY: all senpai clean install uninstall