-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
43 lines (35 loc) · 921 Bytes
/
Copy pathMakefile
File metadata and controls
43 lines (35 loc) · 921 Bytes
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
36
37
38
39
40
41
42
43
PROJECT_NAME = "upstash-redis-local"
BASE=$(shell pwd)
BUILD_DIR=$(BASE)/bin
VERSION ?= v1.0
BUILD_DATE = $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
COMMIT_SHA = $(shell git rev-parse --short HEAD)
LDFLAGS = -ldflags="-X main.Version=${VERSION}"
PACKAGE = $(shell go list -m)
.PHONY: clean
clean:
@echo "> Cleaning Build targets"
rm -rf bin
.PHONY: deps
deps:
@echo "> Installing dependencies"
@go mod tidy
@go mod download
.PHONY: build
build: deps
@echo "> Building upstash-redis-local backend Server Binary"
go build ${LDFLAGS} -o ${BUILD_DIR}/${PROJECT_NAME}
@echo "> Binary has been built successfully"
.PHONY: build-cli
build-cli: deps
@echo "> Building upstash-local CLI"
go build -o ${BUILD_DIR}/upstash-local ./cmd/upstash-local
.PHONY: test
test:
go test -v ./...
.PHONY: build-all
build-all: build build-cli
.PHONY: run
run: build
@echo "> Running ${PROJECT_NAME}"
${BUILD_DIR}/${PROJECT_NAME}