-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
50 lines (38 loc) · 823 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
# Copyright (c) 2020, Compromised AUTHORS.
# All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
GO ?= go
GOLANGCI_LINT ?= $$($(GO) env GOPATH)/bin/golangci-lint
LDFLAGS ?= -s -w
TAGS += timetzdata
.PHONY: all
all: binary lint vet test
.PHONY: develop
develop: binary run
.PHONY: binary
binary: export CGO_ENABLED=0
binary: dist FORCE
$(GO) version
$(GO) build -trimpath -ldflags "$(LDFLAGS)" -o dist/compromised ./cmd/compromised
dist:
mkdir $@
.PHONY: lint
lint:
$(GOLANGCI_LINT) run
.PHONY: vet
vet:
$(GO) vet ./...
.PHONY: test
test:
$(GO) build -trimpath -ldflags "$(LDFLAGS)" ./...
$(GO) test -race -v ./...
.PHONY: run
run:
./dist/compromised config
./dist/compromised
.PHONY: clean
clean:
$(GO) clean
rm -rf dist/
FORCE: