-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (33 loc) · 987 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
36
37
38
39
40
41
42
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
MAIN_SRC_DIR=./cmd/bookmarks
DIST_DIR=bin
BINARY_NAME=bookmarks
BINARY_LINUX=$(BINARY_NAME)_linux
BINARY_WIN=$(BINARY_NAME)_win.exe
GOARCH="amd64"
all: clean fmt test build
clean:
rm -rf ${DIST_DIR}
test:
$(GOTEST) -v ./...
build: ## show this help
@echo 'Building MacOS binary'
GOARCH=${GOARCH} GOOS=darwin go build -o ${DIST_DIR}/${BINARY_NAME}-darwin-${GOARCH} ${MAIN_SRC_DIR}
@echo 'Building Linux binary'
GOARCH=${GOARCH} GOOS=linux go build -o ${DIST_DIR}/${BINARY_NAME}-linux-${GOARCH} ${MAIN_SRC_DIR}
@echo 'Building Windows binary'
GOARCH=${GOARCH} GOOS=windows go build -o ${DIST_DIR}/${BINARY_NAME}-windows-${GOARCH}.exe ${MAIN_SRC_DIR}
fmt: ## format the go source files
goimports -w .
lint: # https://staticcheck.io/
staticcheck ./...
dcup:
docker compose up --build -d
dcdn:
docker compose down
docker-build:
docker build -t sivaprasadreddy/bookmarks .