-
Notifications
You must be signed in to change notification settings - Fork 36
/
Makefile
29 lines (24 loc) · 775 Bytes
/
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
# Makefile for building Tork
GITCOMMIT:=$(shell git describe --dirty --always)
BINARY:=tork
SYSTEM:=
CHECKS:=check
BUILDOPTS:=-v
GOPATH?=$(HOME)/go
MAKEPWD:=$(dir $(realpath $(firstword $(MAKEFILE_LIST))))
CGO_ENABLED?=0
.PHONY: all
all: tork
tork: *.go go.* $(wildcard */**/*.go)
CGO_ENABLED=$(CGO_ENABLED) $(SYSTEM) go build $(BUILDOPTS) -ldflags="-s -w -X github.com/runabol/tork.GitCommit=$(GITCOMMIT)" -o $(BINARY) cmd/main.go
.PHONY: clean
clean:
go clean
rm -f tork
.PHONY: generate-swagger
generate-swagger: docs/swagger.json
docs/swagger.json: *.go go.* $(wildcard */**/*.go)
# Note: this command comes from https://github.com/swaggo/swag
swag init --parseDependency -g internal/coordinator/api/api.go --output docs
rm docs/docs.go
rm docs/swagger.yaml