-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
50 lines (36 loc) · 822 Bytes
/
Makefile
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
prefix = /usr/local
# Support upper case PREFIX
ifneq ($(PREFIX),)
prefix := $(PREFIX)
endif
bindir = $(prefix)/bin
mandir = $(prefix)/share/man
SRCS = main.go history.go
VERSION = 1.1.2
.PHONY: all
all: ijq docs
.PHONY: docs
docs: ijq.1
ijq: $(SRCS)
go build -ldflags="-s -w -X main.Version=$(VERSION)" -o $@
%.1: %.1.scd
scdoc < $< > $@
.PHONY: test
test:
go test -v -coverprofile=./cover.out .
.PHONY: viewcover
viewcover:
go tool cover -html=./cover.out
.PHONY: install
install: ijq ijq.1
install -d $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1
install -m 0755 ijq $(DESTDIR)$(bindir)
install -m 0644 ijq.1 $(DESTDIR)$(mandir)/man1
.PHONY: uninstall
uninstall:
rm $(DESTDIR)$(bindir)/ijq $(DESTDIR)$(mandir)/man1/ijq.1
.PHONY: clean
clean:
rm -f ijq ijq.1
demo/ijq.gif: demo/ijq.tape
vhs < $<