-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
48 lines (41 loc) · 1.44 KB
/
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
43
44
45
46
47
48
# Makefile for Universum
# This Makefile defines several commands to manage and build the project universum.
# The commands include building, testing, cleaning, and running the project,
# as well as configuring the project and generating test coverage reports.
# Colors
RED := \033[0;31m
GREEN := \033[0;32m
YELLOW := \033[1;33m
BLUE := \033[0;34m
NC := \033[0m
BINARYNAME := universum
# Go Commands
GOCMD := go # Command to run Go
GOBUILD := $(GOCMD) build # Command to build Go binaries
GOCLEAN := $(GOCMD) clean # Command to clean Go binaries and caches
GOGET := $(GOCMD) get # Command to download Go modules
GOFMT := gofmt # Command to format Go source code
GOINSTALL := $(GOCMD) install # Command to install Go packages
STATICCHECK := staticcheck # Command to run static analysis on Go code
# Target: help
.PHONY: help
help:
@printf "\n${YELLOW}Makefile Targets:${NC}\n\n"
@printf " ${GREEN}configure${NC} - Configure the project\n"
@printf " ${GREEN}test${NC} - Run unit tests\n"
# Target: configure
.PHONY: configure
configure:
@printf "\n${YELLOW}CONFIGURING THE PACKAGE...${NC}\n\n"
$(GOINSTALL) honnef.co/go/tools/cmd/staticcheck@latest
$(GOCMD) mod tidy
$(GOCMD) mod verify
$(GOFMT) -s -w .
$(STATICCHECK) ./...
@printf "\n"
# Target: test
.PHONY: test
test:
@printf "\n${YELLOW}RUNNING UNIT TESTS...${NC}\n\n"
$(GOCMD) test ./...
@printf "\n"