blob: 2d0e134412ee566f726aa3e997e3c28d5e0e900e [file] [log] [blame]
Josh Bleecher Snyder1c18ec92025-07-08 10:55:54 -07001# 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 Snyder6ae637a2025-07-09 12:41:56 -07007# Allow overriding some env vars, used by GoReleaser
8BUILT_BY ?= make
9SKETCH_VERSION ?=
Josh Bleecher Snyder973413b2025-07-08 19:35:05 +000010GOOS ?= $(shell go env GOOS)
11GOARCH ?= $(shell go env GOARCH)
12
Josh Bleecher Snyder6ae637a2025-07-09 12:41:56 -070013export BUILT_BY
14export SKETCH_VERSION
15export GOOS
16export GOARCH
17export LDFLAGS := -X main.builtBy=$(BUILT_BY) -X main.release=$(SKETCH_VERSION)
18
19.PHONY: all clean outie innie webui
Josh Bleecher Snyder1c18ec92025-07-08 10:55:54 -070020
21all: outie
22
23outie: innie
Josh Bleecher Snyder6ae637a2025-07-09 12:41:56 -070024 ./build/outie.sh
Josh Bleecher Snyder1c18ec92025-07-08 10:55:54 -070025
Josh Bleecher Snyder6ae637a2025-07-09 12:41:56 -070026innie: webui
27 ./build/innie.sh
Josh Bleecher Snyder1c18ec92025-07-08 10:55:54 -070028
Josh Bleecher Snyder6ae637a2025-07-09 12:41:56 -070029webui:
30 ./build/webui.sh
Josh Bleecher Snyder1c18ec92025-07-08 10:55:54 -070031
32clean:
Josh Bleecher Snyder6ae637a2025-07-09 12:41:56 -070033 ./build/clean.sh