-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
46 lines (34 loc) · 882 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
SHELL := /bin/bash
PLATFORMS := windows linux darwin
BINARY := dyndsn-r53
# These will be provided to the target
VERSION := 2.0.0
BUILD := `git rev-parse HEAD`
# Use linker flags to provide version/build settings to the target
LDFLAGS=-ldflags "-X=main.version=$(VERSION) -X=main.build=$(BUILD)"
os = $(word 1, $@)
PKGS := $(shell go list ./... | grep -v /vendor)
clean:
# go clean
rm -f dyndns-r53
rm -f dyndns-r53.exe
rm -rf release/
.PHONY: clean
build:
go build $(LDFLAGS) cmd/dyndns-r53.go
.PHONY: build
test:
go test $(PKGS)
.PHONY: test
lint:
golangci-lint run
.PHONY: lint
$(PLATFORMS):
mkdir -p release
GOOS=$(os) GOARCH=amd64 go build $(LDFLAGS) -o release/$(BINARY)-v$(VERSION)-$(os)-amd64 cmd/dyndns-r53.go
.PHONY: $(PLATFORMS)
install:
@go install $(LDFLAGS) cmd/dyndns-r53.go
# run "make release -j3
release: windows linux darwin
.PHONY: release