-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (32 loc) · 736 Bytes
/
Makefile
File metadata and controls
41 lines (32 loc) · 736 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
33
34
35
36
37
38
39
40
41
PACKAGES = $(shell go list ./...)
GO := CGO_ENABLED=0 go
.PHONY: all
all: build
.PHONY: clean
clean:
$(GO) clean -i ./...
rm -rf ./bin/
.PHONY: format
format: go/fmt
.PHONY: go/fmt
go/fmt:
$(GO) fmt $(PACKAGES)
.PHONY: test
test:
@for PKG in $(PACKAGES); do $(GO) test -cover $$PKG || exit 1; done;
.PHONY: generate
generate: build
./bin/githubhook-gen --output=githubevents
.PHONY: build
build: \
bin/gen
.PHONY: bin/gen
bin/gen:
mkdir -p bin
$(GO) build -v -ldflags '-w $(LDFLAGS)' -o ./bin/githubhook-gen ./gen/*.go
.PHONY: tidy
tidy:
$(GO) mod tidy
cd examples/simple-http-server && $(GO) mod tidy
cd examples/simple-http-server-funcs && $(GO) mod tidy
cd examples/simple-http-server-packages && $(GO) mod tidy