forked from mylxsw/aidea-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
20 lines (16 loc) · 883 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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:
go build -race -ldflags "$(LDFLAGS)" -o build/debug/aidea-server cmd/main.go
build-release:
GOOS=linux GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o build/release/aidea-server-linux cmd/main.go
GOOS=linux GOARCH=arm go build -ldflags "$(LDFLAGS)" -o build/release/aidea-server-linux-arm cmd/main.go
GOOS=darwin GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o build/release/aidea-server-darwin cmd/main.go
GOOS=windows GOARCH=amd64 go build -ldflags "$(LDFLAGS)" -o build/release/aidea-server.exe cmd/main.go
orm:
# https://github.com/mylxsw/eloquent
eloquent gen --source 'internal/repo/model/*.yaml'
gofmt -s -w internal/repo/model/*.go
.PHONY: build build-release orm