| Josh Bleecher Snyder | 1c18ec9 | 2025-07-08 10:55:54 -0700 | [diff] [blame] | 1 | # Makefile for building sketch with embedded assets |
| 2 | # |
| 3 | # Two-layer architecture: |
| 4 | # 1. Linux binary ("innie") - runs in container, embeds webui assets |
| 5 | # 2. Native binary ("outie") - runs on user's machine, embeds innie |
| 6 | |
| Josh Bleecher Snyder | 6ae637a | 2025-07-09 12:41:56 -0700 | [diff] [blame] | 7 | # Allow overriding some env vars, used by GoReleaser |
| 8 | BUILT_BY ?= make |
| 9 | SKETCH_VERSION ?= |
| Josh Bleecher Snyder | 973413b | 2025-07-08 19:35:05 +0000 | [diff] [blame] | 10 | GOOS ?= $(shell go env GOOS) |
| 11 | GOARCH ?= $(shell go env GOARCH) |
| 12 | |
| Josh Bleecher Snyder | 6ae637a | 2025-07-09 12:41:56 -0700 | [diff] [blame] | 13 | export BUILT_BY |
| 14 | export SKETCH_VERSION |
| 15 | export GOOS |
| 16 | export GOARCH |
| 17 | export LDFLAGS := -X main.builtBy=$(BUILT_BY) -X main.release=$(SKETCH_VERSION) |
| 18 | |
| 19 | .PHONY: all clean outie innie webui |
| Josh Bleecher Snyder | 1c18ec9 | 2025-07-08 10:55:54 -0700 | [diff] [blame] | 20 | |
| 21 | all: outie |
| 22 | |
| 23 | outie: innie |
| Josh Bleecher Snyder | 6ae637a | 2025-07-09 12:41:56 -0700 | [diff] [blame] | 24 | ./build/outie.sh |
| Josh Bleecher Snyder | 1c18ec9 | 2025-07-08 10:55:54 -0700 | [diff] [blame] | 25 | |
| Josh Bleecher Snyder | 6ae637a | 2025-07-09 12:41:56 -0700 | [diff] [blame] | 26 | innie: webui |
| 27 | ./build/innie.sh |
| Josh Bleecher Snyder | 1c18ec9 | 2025-07-08 10:55:54 -0700 | [diff] [blame] | 28 | |
| Josh Bleecher Snyder | 6ae637a | 2025-07-09 12:41:56 -0700 | [diff] [blame] | 29 | webui: |
| 30 | ./build/webui.sh |
| Josh Bleecher Snyder | 1c18ec9 | 2025-07-08 10:55:54 -0700 | [diff] [blame] | 31 | |
| 32 | clean: |
| Josh Bleecher Snyder | 6ae637a | 2025-07-09 12:41:56 -0700 | [diff] [blame] | 33 | ./build/clean.sh |