-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (33 loc) · 1.01 KB
/
Copy pathMakefile
File metadata and controls
59 lines (33 loc) · 1.01 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
BINARY_NAME=tasker
SRC_DIR=./
MODULE_NAME=github.com/NukeDev/Tasker
VERSION=$(shell git describe --tags --always)
LDFLAGS=-ldflags "-X main.Version=$(VERSION)"
.PHONY: all build run clean release
all: build
build:
@echo "Building $(BINARY_NAME)..."
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY_NAME) $(SRC_DIR)
run: build
@echo "Running $(BINARY_NAME)..."
./$(BINARY_NAME)
clean:
@echo "Cleaning up..."
rm -f $(BINARY_NAME)
release: clean
@echo "Creating release..."
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY_NAME)-$(VERSION)-linux-amd64 $(SRC_DIR)
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY_NAME)-$(VERSION)-darwin-amd64 $(SRC_DIR)
GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY_NAME)-$(VERSION)-windows-amd64.exe $(SRC_DIR)
test:
@echo "Running tests..."
go test ./...
deps:
@echo "Downloading dependencies..."
go mod tidy
docker-up:
@echo "Starting compose..."
docker compose up -d
docker-down:
@echo "Stopping compose..."
docker compose down