-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (35 loc) · 1.17 KB
/
Makefile
File metadata and controls
42 lines (35 loc) · 1.17 KB
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
.PHONY: build lint run clean dep
.DEFAULT_GOAL := run
BINARY_NAME = chimes
GOLANGCI_LINT_VERSION = v1.42.1
BUILD_DIR ?= ./bin
DEFAULT_OS ?= linux
# Build the project
build:
@echo "Building Project 🔨"
GOARCH=amd64 GOOS=darwin go build -o ${BUILD_DIR}/${BINARY_NAME}-darwin ./cmd/chimes
GOARCH=amd64 GOOS=linux go build -o ${BUILD_DIR}/${BINARY_NAME}-linux ./cmd/chimes
GOARCH=amd64 GOOS=windows go build -o ${BUILD_DIR}/${BINARY_NAME}-windows ./cmd/chimes
# Run the project
run: build
@echo "Running Project 🚀"
./${BUILD_DIR}/${BINARY_NAME}-${DEFAULT_OS}
# Link the project
lint:
@echo "Linting Project 🔍️"
golangci-lint run
# Clean up
clean:
@echo "Cleaning up Project 🧹"
go clean
rm ./${BUILD_DIR}/${BINARY_NAME}-darwin
rm ./${BUILD_DIR}/${BINARY_NAME}-linux
rm ./${BUILD_DIR}/${BINARY_NAME}-windows
# Download all dependencies
dep:
@echo "Downloading Project Dependencies 📦️"
go mod download
# Installing golangci-lint
install-linter:
@echo "Installling golangci-lint ⏬"
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_LINT_VERSION)