Skip to content

Add Makefile for universal binary builds#80

Open
manavponnekanti wants to merge 2 commits intodrgrib:masterfrom
manavponnekanti:universal-binary
Open

Add Makefile for universal binary builds#80
manavponnekanti wants to merge 2 commits intodrgrib:masterfrom
manavponnekanti:universal-binary

Conversation

@manavponnekanti
Copy link
Copy Markdown

@manavponnekanti manavponnekanti commented Feb 8, 2026

Summary

  • Adds pre-built universal (x86_64 + arm64) binaries for all 7 executables
  • Adds a Makefile for rebuilding universal binaries and packaging the .alfredworkflow
  • Enables the workflow to run natively on both Intel and Apple Silicon Macs without Rosetta

What changed

  • 7 universal binaries committed (previously gitignored): search, csearch, create, setcursor, wiki-link, link, toc
  • Makefile added with targets: make (build all), make workflow (build + package), make clean
  • .gitignore updated: removed binary exclusions (now tracked), added *.alfredworkflow (build artifact)

How the binaries are built

Each executable is compiled twice via Go cross-compilation with CGO enabled (needed for go-sqlite3), then merged into a universal binary with lipo:

CGO_ENABLED=1 GOARCH=arm64 go build -o name-arm64 ./cmd/name/
CGO_ENABLED=1 GOARCH=amd64 CC="clang -arch x86_64" go build -o name-amd64 ./cmd/name/
lipo -create -output name name-arm64 name-amd64

Tested on

  • macOS (Apple Silicon M3) with Go 1.25
  • All 7 binaries verified as Mach-O universal binary with 2 architectures: [x86_64] [arm64]
  • Workflow tested in Alfred — bs, bn, bcs commands working correctly

To release

After merging, package and upload to GitHub Releases:

make workflow  # produces alfred-bear.alfredworkflow

🤖 Generated with Claude Code

manavponnekanti and others added 2 commits February 8, 2026 19:54
Adds a Makefile that builds universal macOS binaries using lipo,
enabling the workflow to run natively on both Intel and Apple Silicon
Macs without requiring Rosetta translation.

Targets:
- `make` or `make all`: builds all universal binaries
- `make workflow`: builds binaries and packages .alfredworkflow
- `make clean`: removes build artifacts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Commit the 7 compiled universal binaries so the workflow can be
packaged and distributed without requiring users to have Go installed.
Remove binaries from .gitignore so they are tracked in the repo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant