Add build and make scripts

This commit is contained in:
2025-10-24 11:05:03 -04:00
parent 321fd4a372
commit 109516c185
6 changed files with 187 additions and 43 deletions

38
Makefile Normal file
View File

@ -0,0 +1,38 @@
# Makefile
# Project name / binary name
BINARY_NAME := cloudcover
# Default target
all: build
# Run go app from CLI
run:
go run .
install-linux:
sudo apt install libopencv-dev
install-macos:
brew install opencv
# Build for the host system
build:
go build -o build/$(BINARY_NAME) .
# Cross-compile for macOS ARM64
build-macos-arm64:
GOOS=darwin GOARCH=arm64 go build -o build/$(BINARY_NAME)-macos-arm64 .
# Cross-compile for Linux AMD64
build-linux-amd64:
GOOS=linux GOARCH=amd64 go build -o build/$(BINARY_NAME)-linux-amd64 .
# Build all targets
build-all: build-macos-arm64 build-linux-amd64
# Clean build artifacts
clean:
rm -rf build
.PHONY: all build build-macos-arm64 build-linux-amd64 build-all clean