eb63d8cbc1
Replaces imapdown.py with a multi-file Go implementation using github.com/emersion/go-imap/v2. All features preserved: SSL/STARTTLS, incremental UID-based downloads, attachment extraction to zip, modified UTF-7 folder name decoding, and full-mode safety checks. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
33 lines
782 B
Makefile
33 lines
782 B
Makefile
.PHONY: build build-all clean test install
|
|
|
|
# Binary name
|
|
BINARY=imapdown
|
|
|
|
# Build flags for smaller binaries
|
|
LDFLAGS=-ldflags="-s -w"
|
|
|
|
# Build for current platform
|
|
build:
|
|
go build $(LDFLAGS) -o $(BINARY)
|
|
|
|
# Cross-compile for multiple platforms
|
|
build-all:
|
|
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY)-linux-amd64
|
|
GOOS=linux GOARCH=arm64 go build $(LDFLAGS) -o $(BINARY)-linux-arm64
|
|
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY)-darwin-amd64
|
|
GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o $(BINARY)-darwin-arm64
|
|
GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o $(BINARY)-windows-amd64.exe
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
rm -f $(BINARY)
|
|
rm -f $(BINARY)-*
|
|
|
|
# Run tests
|
|
test:
|
|
go test -v ./...
|
|
|
|
# Install to $GOPATH/bin
|
|
install:
|
|
go install $(LDFLAGS)
|