1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-08 12:39:19 +00:00

chore: restructure windows branch (move windows/ content to root, remove macos files)

This commit is contained in:
Tw93
2026-01-10 13:23:29 +08:00
parent e84a457c2f
commit edf5ed09a9
140 changed files with 1472 additions and 34059 deletions

View File

@@ -1,40 +1,44 @@
# Makefile for Mole
# Mole Windows - Makefile
# Build Go tools for Windows
.PHONY: all build clean release
# Output directory
BIN_DIR := bin
# Binaries
ANALYZE := analyze
STATUS := status
# Source directories
ANALYZE_SRC := ./cmd/analyze
STATUS_SRC := ./cmd/status
# Build flags
LDFLAGS := -s -w
.PHONY: all build clean analyze status
# Default target
all: build
# Local build (current architecture)
build:
@echo "Building for local architecture..."
go build -ldflags="$(LDFLAGS)" -o $(BIN_DIR)/$(ANALYZE)-go $(ANALYZE_SRC)
go build -ldflags="$(LDFLAGS)" -o $(BIN_DIR)/$(STATUS)-go $(STATUS_SRC)
# Build both tools
build: analyze status
# Release build targets (run on native architectures for CGO support)
release-amd64:
@echo "Building release binaries (amd64)..."
GOOS=darwin GOARCH=amd64 go build -ldflags="$(LDFLAGS)" -o $(BIN_DIR)/$(ANALYZE)-darwin-amd64 $(ANALYZE_SRC)
GOOS=darwin GOARCH=amd64 go build -ldflags="$(LDFLAGS)" -o $(BIN_DIR)/$(STATUS)-darwin-amd64 $(STATUS_SRC)
# Build analyze tool
analyze:
@echo "Building analyze..."
@go build -o bin/analyze.exe ./cmd/analyze/
release-arm64:
@echo "Building release binaries (arm64)..."
GOOS=darwin GOARCH=arm64 go build -ldflags="$(LDFLAGS)" -o $(BIN_DIR)/$(ANALYZE)-darwin-arm64 $(ANALYZE_SRC)
GOOS=darwin GOARCH=arm64 go build -ldflags="$(LDFLAGS)" -o $(BIN_DIR)/$(STATUS)-darwin-arm64 $(STATUS_SRC)
# Build status tool
status:
@echo "Building status..."
@go build -o bin/status.exe ./cmd/status/
# Clean build artifacts
clean:
@echo "Cleaning binaries..."
rm -f $(BIN_DIR)/$(ANALYZE)-* $(BIN_DIR)/$(STATUS)-* $(BIN_DIR)/$(ANALYZE)-go $(BIN_DIR)/$(STATUS)-go
@echo "Cleaning..."
@rm -f bin/analyze.exe bin/status.exe
# Install (copy to PATH)
install: build
@echo "Installing to $(USERPROFILE)/bin..."
@mkdir -p "$(USERPROFILE)/bin"
@cp bin/analyze.exe "$(USERPROFILE)/bin/"
@cp bin/status.exe "$(USERPROFILE)/bin/"
# Run tests
test:
@go test -v ./...
# Format code
fmt:
@go fmt ./...
# Vet code
vet:
@go vet ./...