-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (45 loc) · 807 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Go variables
GOCMD := go
GOBUILD := $(GOCMD) build
GORUN := $(GOCMD) run
GOTEST := $(GOCMD) test
GOCLEAN := $(GOCMD) clean
GOGET := $(GOCMD) get
GOMOD := $(GOCMD) mod
BINARY_NAME := lumora
MAIN_DIR = ./cmd/lumora
# Test variables
TEST_DIR := ./tests
MODULE_NAME ?= all
.PHONY: tmp
# Main target
all: clean build test
# Build your Go application
build:
$(GOBUILD) -o $(BINARY_NAME) $(MAIN_DIR)
# Run you Go application
run:
$(GORUN) $(MAIN_DIR)
# Test the application
test:
ifeq ($(MODULE_NAME), all)
$(GOTEST) ./tests/...
else
$(GOTEST) ./tests/...$(MODULE_NAME)
endif
# Clean the workspace
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
# Get all dependencies
get:
$(GOGET)
# Update go modules
update:
$(GOMOD) tidy
init:
./scripts/init.sh
clear:
./scripts/clear.sh -y
tmp:
rm -r ./tmp/*