-
Notifications
You must be signed in to change notification settings - Fork 436
/
Makefile
29 lines (23 loc) · 1.18 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
Version := $(shell date "+%Y%m%d%H%M")
GitCommit := $(shell git rev-parse HEAD)
DIR := $(shell pwd)
LDFLAGS := -s -w -X main.Version=$(Version) -X main.GitCommit=$(GitCommit) -X main.DEBUG=true
build: doc
go build -race -ldflags "$(LDFLAGS)" -o build/debug/aidea-server main.go
build-release: doc
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o build/release/aidea-server-linux main.go
GOOS=linux GOARCH=arm go build -ldflags "$(LDFLAGS)" -o build/release/aidea-server-linux-arm main.go
GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o build/release/aidea-server-darwin main.go
GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o build/release/aidea-server.exe main.go
build-linux: doc
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o build/release/aidea-server-linux main.go
# Update swagger documentation
# Please install swag before execution, installation method: `go install github.com/swaggo/swag/cmd/swag@latest`
# Reference: https://github.com/swaggo/gin-swagger
doc:
swag init
orm:
# https://github.com/mylxsw/eloquent
eloquent gen --source 'pkg/repo/model/*.yaml'
gofmt -s -w pkg/repo/model/*.go
.PHONY: build build-release orm build-linux doc