-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
42 lines (33 loc) · 835 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
# Project-specific variables
BINARIES ?= tvtime
OS=$(shell uname -s)
# Common variables
SOURCES := $(shell find . -type f -name "*.go")
COMMANDS := $(shell go list ./... | grep -v /vendor/ | grep /cmd/)
PACKAGES := $(shell go list ./... | grep -v /vendor/ | grep -v /cmd/)
GO ?= go
.PHONY: setup
setup:
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh
ifeq ($(OS), Darwin)
brew install dep
else
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
endif
dep ensure -vendor-only
all: build
.PHONY: build
build: $(BINARIES)
.PHONY: install
install:
$(GO) install ./cmd/gotty-client
$(BINARIES): $(SOURCES)
$(GO) build -i -o $@ ./cmd/$@
.PHONY: lint
lint:
./bin/golangci-lint run --enable-all ./...
.PHONY: ci
ci: lint build
.PHONY: clean
clean:
rm -f $(BINARIES)