-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
32 lines (23 loc) · 1.02 KB
/
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
.PHONY: build-all clean swagger migrate
PROTOC_FILES = $(shell find . -type f -name '*.proto')
PB_FILES = $(patsubst %.proto, %.pb.go, $(PROTOC_FILES))
PB_STORM_FILES = $(patsubst %.proto, %.pb.storm.go, $(PROTOC_FILES))
BIN = $(addprefix bin/,$(shell ls cmd))
build-all: $(PB_FILES) $(PB_STORM_FILES) $(BIN)
bin/%: cmd/%/main.go
go build -o $@ $<
swagger:
swagger generate server --exclude-main --copyright-file COPYRIGHT.txt
swagger generate model --copyright-file COPYRIGHT.txt
swagger generate client --copyright-file COPYRIGHT.txt
markdown:
swagger generate markdown --copyright-file COPYRIGHT.txt --output= docs/api.md
migrate:
migrate -path db/migrations -database "cockroachdb://root@localhost:26257/andromeda?sslmode=disable" drop -f
migrate -path db/migrations -database "cockroachdb://root@localhost:26257/andromeda?sslmode=disable" up
%.pb.storm.go: %.proto
protoc --stormrpc_out=. --stormrpc_opt=paths=source_relative -I. $<
%.pb.go: %.proto
protoc --go_out=. --go_opt=paths=source_relative -I. $<
clean:
rm -f bin/*