-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
27 lines (18 loc) · 757 Bytes
/
Makefile
File metadata and controls
27 lines (18 loc) · 757 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
.PHONY: all clean fmt test
rwildcard = $(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
GO := go
CGO_ENABLED := 0
GOFLAGS := -ldflags=-s -w
all: check in out
check: *.go cmd/check/* $(call rwildcard,vendor/,*.go)
GOFLAGS="${GOFLAGS}" CGO_ENABLED=${CGO_ENABLED} $(GO) build -o ./$@ ./cmd/$@
in: *.go cmd/in/* $(call rwildcard,vendor/,*.go)
GOFLAGS="${GOFLAGS}" CGO_ENABLED=${CGO_ENABLED} $(GO) build -o ./$@ ./cmd/$@
out: *.go cmd/out/* $(call rwildcard,vendor/,*.go)
GOFLAGS="${GOFLAGS}" CGO_ENABLED=${CGO_ENABLED} $(GO) build -o ./$@ ./cmd/$@
fmt: *.go $(call rwildcard,cmd/,*.go) $(call rwildcard,fakes/,*.go)
@find -not -path '*vendor*' -name \*.go -exec gofmt -s -w {} +
test:
$(GO) test
clean:
@rm -vf check in out