-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (52 loc) · 1.74 KB
/
Makefile
File metadata and controls
62 lines (52 loc) · 1.74 KB
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
55
56
57
58
59
60
61
62
SHELL := /bin/bash
.PHONY: help format lint test build imsg clean build-dylib docs-site
help:
@printf "%s\n" \
"make format - swift format in-place" \
"make lint - swift format lint + swiftlint" \
"make test - sync version, patch deps, run swift test" \
"make build - universal release build into bin/" \
"make build-dylib - build injectable dylib for Messages.app" \
"make imsg - clean rebuild + run debug binary (ARGS=...)" \
"make docs-site - build the imsg.sh docs site into dist/docs-site" \
"make clean - swift package clean"
format:
swift format --in-place --recursive Sources Tests
lint:
swift format lint --recursive Sources Tests
swiftlint
test:
scripts/generate-version.sh
swift package resolve
scripts/patch-deps.sh
swift test
build:
scripts/generate-version.sh
swift package resolve
scripts/patch-deps.sh
scripts/build-universal.sh
# Build injectable dylib for Messages.app (DYLD_INSERT_LIBRARIES).
# Uses arm64e architecture to match Messages.app on Apple Silicon.
# Requires SIP disabled on the target machine to inject into system apps.
build-dylib:
@echo "Building imsg-bridge-helper.dylib (injectable)..."
@mkdir -p .build/release
@clang -dynamiclib -arch arm64e -fobjc-arc \
-Wno-arc-performSelector-leaks \
-framework Foundation \
-o .build/release/imsg-bridge-helper.dylib \
Sources/IMsgHelper/IMsgInjected.m
@echo "Built .build/release/imsg-bridge-helper.dylib"
imsg:
scripts/generate-version.sh
swift package resolve
scripts/patch-deps.sh
swift package clean
swift build -c debug --product imsg
./.build/debug/imsg $(ARGS)
docs-site:
node scripts/build-docs-site.mjs
clean:
swift package clean
@rm -f .build/release/imsg-bridge-helper.dylib
@rm -rf dist/docs-site