Files
zeekay 1b367e2b62 chore: rebase the tree onto upstream master
The tree was a debranded snapshot of upstream taken around 2026-02-20, and
upstream has moved about five months since. This replaces it with upstream
master, mechanically re-derived: bin/debrand does the rename, and the
pipeline and squashed migrations are restored from the shipped tree.

Not a merge. The previous import replaced the tree wholesale in a single
commit, so there is no shared content history to merge against. Reproducing
the rename on the new tree is what actually converges.

What survives: .hanzo/workflows, the Dockerfiles and bin/docker* entrypoints,
compose files, LLM.md, and insights/migrations. The squashed initial
migration is load-bearing — the live database records it by name, so
upstream's ~918 individual migrations cannot come back.

Nine products are dropped as unreferenced. Twenty-one more that we do not run
are kept anyway because the core app still imports them; unpicking those is a
refactor and does not belong in a rebase.

This base does not build yet, and the reasons are not in the rename:
upstream now wants Python 3.13.13 against our 3.12.12 and Django 5.2 against
our 4.2, and the dependency manifests still name upstream packages that we
republish under our own names. Those are decisions, not renames.
2026-08-01 15:44:40 -07:00

56 lines
1.8 KiB
Makefile

.PHONY: build build-linux-amd64 build-linux-arm64 build-darwin-amd64 build-darwin-arm64 build-all clean deps test
BINARY_NAME=phrocs
DIST_DIR=dist
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOMOD=$(GOCMD) mod
VERSION ?= dev
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS = -ldflags '-s -w -X main.Version=$(VERSION) -X main.Commit=$(COMMIT) -X main.BuildDate=$(DATE)'
# Track every .go file plus the module manifests so `make build` becomes a
# no-op when nothing has changed. The Flox on-activate hook calls `make
# build` on every shell activation; without proper dependency tracking the
# .PHONY target would re-run `go build` from scratch each time (~3-5s per
# shell), and downstream AMI bakes wouldn't get to reuse the cached binary.
SOURCES := $(shell find . -type f -name '*.go' -not -path './$(DIST_DIR)/*') go.mod go.sum
build: $(DIST_DIR)/$(BINARY_NAME)
$(DIST_DIR)/$(BINARY_NAME): $(SOURCES) | $(DIST_DIR)
$(GOBUILD) $(LDFLAGS) -o $@ .
$(DIST_DIR):
mkdir -p $@
build-linux-amd64:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) $(LDFLAGS) -o $(DIST_DIR)/$(BINARY_NAME)-linux-amd64 .
build-linux-arm64:
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 $(GOBUILD) $(LDFLAGS) -o $(DIST_DIR)/$(BINARY_NAME)-linux-arm64 .
build-darwin-amd64:
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 $(GOBUILD) $(LDFLAGS) -o $(DIST_DIR)/$(BINARY_NAME)-darwin-amd64 .
build-darwin-arm64:
CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 $(GOBUILD) $(LDFLAGS) -o $(DIST_DIR)/$(BINARY_NAME)-darwin-arm64 .
build-all: deps build-linux-amd64 build-linux-arm64 build-darwin-amd64 build-darwin-arm64
clean:
$(GOCLEAN)
rm -rf $(DIST_DIR)
deps:
mkdir -p $(DIST_DIR)
$(GOMOD) download
test:
$(GOTEST) -v ./...