-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (37 loc) · 1.14 KB
/
Makefile
File metadata and controls
44 lines (37 loc) · 1.14 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
43
44
# The following Makefile creates an abstraction to easily run the most common development commands.
# To run, just execute the command: `make <target>`. Excluding <target> builds the project by default.
BIN := roguespot-orch
# -trimpath makes Go stacktraces only print relative paths to files instead of full paths. Makes the
# terminal output cleaner.
BUILD_FLAGS ?= -trimpath
GO ?= go
# Builds the project. Default target when no targets are specified
.PHONY: build
build:
$(GO) build $(BUILD_FLAGS)
# Build the project, then run it by calling the executable
.PHONY: build-run
build-run: build
./$(BIN)
# Cleans build files, such as the executable
.PHONY: clean
clean:
$(GO) clean -i ./...
# Formats all files accordingy to Go's standards and tidy the go.mod file
.PHONY: fmt
fmt:
$(GO) fmt ./...
$(GO) mod tidy -v
# Lints all files using both Go's built-in tool and a golangci-lint, a third-party linter
.PHONY: lint
lint:
$(GO) vet ./...
golangci-lint run ./...
# Run the project without compiling it
.PHONY: run
run:
$(GO) run $(BUILD_FLAGS) .
# Run all tests for the project with a coverage report
.PHONY: test
test:
$(GO) test -cover ./...