-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
32 lines (24 loc) · 668 Bytes
/
Copy pathmakefile
File metadata and controls
32 lines (24 loc) · 668 Bytes
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
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1
MAN_SOURCE = man/when.1
MAN_DEST = $(MANDIR)/when.1
BINARY = when
GOCMD = go
GOFLAGS = -v
GOTEST = $(GOCMD) test
PKGS = ./...
install:
@mkdir -p $(BINDIR) $(MANDIR)
@$(GOCMD) build -o $(BINDIR)/$(BINARY) ./cmd/when
@cp $(MAN_SOURCE) $(MAN_DEST)
@echo "$(BINARY) installed to $(BINDIR)/$(BINARY)"
@echo "$(MAN_SOURCE) man page installed to $(MAN_DEST)"
uninstall:
@rm -f $(BINDIR)/$(BINARY) $(MAN_DEST)
@echo "$(BINARY) and $(MAN_SOURCE) man page removed"
build:
@$(GOCMD) build -o $(BINARY) ./cmd/when
test:
$(GOTEST) $(GOFLAGS) $(PKGS)
.PHONY: install uninstall build test