-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (29 loc) · 744 Bytes
/
Copy pathMakefile
File metadata and controls
36 lines (29 loc) · 744 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
GOFMT_FILES?=$$(find . -name '*.go' | grep -v pb.go)
.PHONY: default
default: fmt build
.PHONY: protoc
protoc:
@echo "--> Compiling protobufs"
protoc *.proto --go_out=plugins=grpc,paths=source_relative:.
.PHONY: fmt
fmt:
@echo "--> Formatting source files"
gofmt -w $(GOFMT_FILES)
.PHONY: fmt-json
fmt-json:
@echo "--> Formatting JSON file"
@jq type bangs.json >/dev/null
jq -SM '.' bangs.json | awk 'BEGIN{RS="";getline<"-";print>ARGV[1]}' bangs.json
.PHONY: build
build: fmt
@echo "--> Building"
go build -ldflags="-s -w" ./...
go build -ldflags="-s -w" ./cmd/bang
.PHONY: clean
clean:
@echo "--> Cleaning"
rm -f bang bang.exe
.PHONY: godoc
godoc:
@echo "--> Serving GoDoc at http://localhost:8080/"
@godoc -http ":8080"