forked from mr-karan/doggo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (27 loc) · 980 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
30
31
32
33
34
35
CLI_BIN := ./bin/doggo.bin
WEB_BIN := ./bin/doggo-web.bin
HASH := $(shell git rev-parse --short HEAD)
BUILD_DATE := $(shell date '+%Y-%m-%d %H:%M:%S')
VERSION := ${HASH}
.PHONY: build-cli
build-cli:
go build -o ${CLI_BIN} -ldflags="-X 'main.buildVersion=${VERSION}' -X 'main.buildDate=${BUILD_DATE}'" ./cmd/doggo/
.PHONY: build-rutx11-cli
build-rutx11-cli:
GOARCH=arm GOARM=7 GOOS=linux go build -o ${CLI_BIN}_rutx11 -ldflags="-X 'main.buildVersion=${VERSION}' -X 'main.buildDate=${BUILD_DATE}'" ./cmd/
.PHONY: build-web
build-web:
go build -o ${WEB_BIN} -ldflags="-X 'main.buildVersion=${VERSION}' -X 'main.buildDate=${BUILD_DATE}'" ./web/
.PHONY: run-cli
run-cli: build-cli ## Build and Execute the CLI binary after the build step.
${CLI_BIN}
.PHONY: run-web
run-web: build-web ## Build and Execute the API binary after the build step.
${WEB_BIN} --config config-api-sample.toml
.PHONY: clean
clean:
go clean
- rm -rf ./bin/
.PHONY: lint
lint:
golangci-lint run