-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
49 lines (40 loc) · 1021 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
# Simple Makefile for a Go project
# Build the application
all: build
build:
@echo "Building..."
@make arm64
arm64:
@echo "Building for macos-arm64..."
@GOOS=darwin GOARCH=arm64 go build -o main-macos-arm64 cmd/blastoise/main.go
linux:
@echo "Building for linux..."
@GOOS=linux GOARCH=amd64 go build -o main-linux cmd/blastoise/main.go
# Run the application
run:
@go run cmd/blastoise/main.go
# Test the application
test:
@echo "Testing..."
@go test ./...
# Clean the binary
clean:
@echo "Cleaning..."
@rm -f main
# Live Reload
watch:
@if [ -x "$(GOPATH)/bin/air" ]; then \
"$(GOPATH)/bin/air"; \
@echo "Watching...";\
else \
read -p "air is not installed. Do you want to install it now? (y/n) " choice; \
if [ "$$choice" = "y" ]; then \
go install github.com/cosmtrek/air@latest; \
"$(GOPATH)/bin/air"; \
@echo "Watching...";\
else \
echo "You chose not to install air. Exiting..."; \
exit 1; \
fi; \
fi
.PHONY: all build run test clean