-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (22 loc) · 859 Bytes
/
Makefile
File metadata and controls
33 lines (22 loc) · 859 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
all: docs build
.PHONY: docs clean test docker
GO_INTERNAL_SRC = $(wildcard internal/*.go internal/*/*.go internal/*/*/*.go internal_inject/**/*.go)
GO_CMD_SRC = $(wildcard cmd/*/*.go)
OUTPUT_BINS = $(patsubst cmd/%, bin/%, $(wildcard cmd/*))
PB_FILES = $(wildcard proto/*.proto)
DOCS_FILES = docs/swagger.json
build: $(OUTPUT_BINS)
docs: ${DOCS_FILES}
${DOCS_FILES}: $(GO_INTERNAL_SRC) $(GO_CMD_SRC)
swag fmt
swag init -g ../../cmd/apiserver/main.go -d internal/api,internal/model,internal/sdk --parseDependency --parseInternal
internal/models/%.pb.go: proto/%.proto
protoc --proto_path=proto --go_out=internal/models --go_opt=paths=source_relative $<
bin/%: ./cmd/%/main.go $(GO_INTERNAL_SRC) $(GO_CMD_SRC)
go build -o $@ ./$(shell dirname $<)
docker:
docker build -t $(DOCKER_IMG_NAME) .
test:
go test -v -cover ./...
clean:
-rm -rf bin/