summaryrefslogtreecommitdiff
path: root/makima/ios/Makefile
blob: 8d2a23cc7fe1d61457e4cf7a69a6ae7f3a70a909 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Makima iOS — build shortcuts
# Requires: xcodegen (brew install xcodegen), Xcode 16+
# Run `make xcgen` after editing project.yml.

SCHEME       := Makima
WORKSPACE    := Makima.xcodeproj
SIM_DEVICE   := iPhone 16 Pro

.PHONY: help bootstrap xcgen ios-sim-fast ios-device-fast clean test lint

help:
	@echo "Targets:"
	@echo "  bootstrap       install xcodegen if missing"
	@echo "  xcgen           (re)generate Makima.xcodeproj from project.yml"
	@echo "  ios-sim-fast    build for simulator ($(SIM_DEVICE))"
	@echo "  ios-device-fast build for generic iOS device"
	@echo "  test            run unit tests on simulator"
	@echo "  clean           remove generated project + DerivedData"
	@echo "  lint            swift format lint (if installed)"

bootstrap:
	@command -v xcodegen >/dev/null || (echo "Installing xcodegen..." && brew install xcodegen)

xcgen: bootstrap
	xcodegen generate

ios-sim-fast: xcgen
	set -o pipefail; xcodebuild \
	  -project $(WORKSPACE) \
	  -scheme $(SCHEME) \
	  -destination 'platform=iOS Simulator,name=$(SIM_DEVICE)' \
	  -configuration Debug \
	  build | xcbeautify || true

ios-device-fast: xcgen
	set -o pipefail; xcodebuild \
	  -project $(WORKSPACE) \
	  -scheme $(SCHEME) \
	  -destination 'generic/platform=iOS' \
	  -configuration Debug \
	  build | xcbeautify || true

test: xcgen
	set -o pipefail; xcodebuild \
	  -project $(WORKSPACE) \
	  -scheme $(SCHEME) \
	  -destination 'platform=iOS Simulator,name=$(SIM_DEVICE)' \
	  test | xcbeautify || true

clean:
	rm -rf Makima.xcodeproj DerivedData build

lint:
	@command -v swift-format >/dev/null && swift-format lint -r Sources Tests || echo "swift-format not installed, skipping"