Skip to content

Commit 5663ccf

Browse files
committed
update makefile
1 parent 828e0fa commit 5663ccf

File tree

1 file changed

+50
-4
lines changed

1 file changed

+50
-4
lines changed

Makefile

+50-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,58 @@
11
all: build
2-
# Build the project
2+
3+
# Version and application information
4+
VERSION := 1.0.0
5+
APPNAME := mcp-monitor
6+
BUILDDIR := ./bin
7+
8+
# Build for current platform
39
build:
4-
go build -o ./bin/mcp-monitor main.go
10+
mkdir -p $(BUILDDIR)
11+
go build -o $(BUILDDIR)/$(APPNAME) main.go
512

613
# Run the project
714
run: build
8-
./bin/mcp-monitor
15+
$(BUILDDIR)/$(APPNAME)
916

1017
# Clean the project
1118
clean:
12-
rm -f ./bin/mcp-monitor
19+
rm -rf $(BUILDDIR)
20+
21+
# Create output directory
22+
.PHONY: init
23+
init:
24+
mkdir -p $(BUILDDIR)
25+
26+
# Cross-platform build - Windows
27+
.PHONY: build-windows-amd64
28+
build-windows-amd64: init
29+
GOOS=windows GOARCH=amd64 go build -o $(BUILDDIR)/$(APPNAME)_windows_amd64.exe main.go
30+
31+
# Cross-platform build - macOS (Intel)
32+
.PHONY: build-darwin-amd64
33+
build-darwin-amd64: init
34+
GOOS=darwin GOARCH=amd64 go build -o $(BUILDDIR)/$(APPNAME)_darwin_amd64 main.go
35+
36+
# Cross-platform build - macOS (Apple Silicon)
37+
.PHONY: build-darwin-arm64
38+
build-darwin-arm64: init
39+
GOOS=darwin GOARCH=arm64 go build -o $(BUILDDIR)/$(APPNAME)_darwin_arm64 main.go
40+
41+
# Cross-platform build - All platforms
42+
.PHONY: build-all
43+
build-all: build-windows-amd64 build-darwin-amd64 build-darwin-arm64
44+
@echo "All platforms built successfully"
45+
@ls -la $(BUILDDIR)
46+
47+
# Help information
48+
.PHONY: help
49+
help:
50+
@echo "Usage:"
51+
@echo " make - Build for current platform"
52+
@echo " make run - Build and run"
53+
@echo " make clean - Clean build outputs"
54+
@echo " make build-windows-amd64 - Build for Windows (amd64)"
55+
@echo " make build-darwin-amd64 - Build for macOS (Intel)"
56+
@echo " make build-darwin-arm64 - Build for macOS (Apple Silicon)"
57+
@echo " make build-all - Build for all platforms"
58+
@echo " make help - Show this help information"

0 commit comments

Comments
 (0)