-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (31 loc) · 1.37 KB
/
Copy pathMakefile
File metadata and controls
38 lines (31 loc) · 1.37 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
.PHONY: build clean install run
# Build the binary
build:
go mod download
go build -o devil main.go
# Clean build artifacts
clean:
rm -f devil
# Install to /usr/local/bin (requires sudo)
install: build
sudo cp devil /usr/local/bin/
# Build for multiple platforms
build-all:
@echo "Building for all platforms..."
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -o bin/devil-darwin-amd64 -ldflags="-s -w" main.go
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -o bin/devil-darwin-arm64 -ldflags="-s -w" main.go
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o bin/devil-linux-amd64 -ldflags="-s -w" main.go
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build -o bin/devil-linux-arm64 -ldflags="-s -w" main.go
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o bin/devil-windows-amd64.exe -ldflags="-s -w" main.go
GOOS=windows GOARCH=arm64 CGO_ENABLED=0 go build -o bin/devil-windows-arm64.exe -ldflags="-s -w" main.go
@echo "✅ All platforms built successfully in bin/ directory"
# Build for Windows only
build-windows:
@echo "Building for Windows..."
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -o devil.exe -ldflags="-s -w" main.go
@echo "✅ Windows build complete: devil.exe"
# Build for Linux only
build-linux:
@echo "Building for Linux..."
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o devil-linux -ldflags="-s -w" main.go
@echo "✅ Linux build complete: devil-linux"