Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
92 lines (68 loc) · 2.61 KB
/
Copy pathMakefile
File metadata and controls
92 lines (68 loc) · 2.61 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
.PHONY: build build-release test clean rust-build rust-release rust-test rust-lint rust-fmt swift-build swift-test generate build-app build-app-release build-app-store run-app cli-helper cli-helper-universal sign-cli-helper install app-store-archive app-store-export app-store-upload app-store-wait app-store-build-info app-store-submit test-app-store-release-tasks
CLI_NAME := pprofessor
CLI_HELPER_DIR := target/cli-helper
CLI_HELPER := $(CLI_HELPER_DIR)/$(CLI_NAME)
MACOS_DEPLOYMENT_TARGET ?= 14.0
SIGN_IDENTITY ?= -
build: rust-build swift-build
build-release: rust-release swift-build-release
test: rust-test swift-test
clean:
cargo clean
$(MAKE) -C apps/macos clean
rm -rf $(CLI_HELPER_DIR)
rust-build:
cargo build
rust-release:
cargo build --release
rust-test:
cargo test
rust-lint:
cargo clippy --all-targets -- -D warnings
rust-fmt:
cargo fmt
swift-build:
$(MAKE) -C apps/macos build
swift-build-release:
$(MAKE) -C apps/macos build-release
swift-test:
$(MAKE) -C apps/macos test
generate:
$(MAKE) -C apps/macos generate
build-app:
$(MAKE) -C apps/macos build-app
build-app-release:
$(MAKE) -C apps/macos build-app-release
build-app-store:
$(MAKE) -C apps/macos build-app-store
app-store-archive app-store-export app-store-upload app-store-wait app-store-build-info app-store-submit:
$(MAKE) -C apps/macos $@
test-app-store-release-tasks:
bash tests/app_store_release_tasks.sh
run-app:
$(MAKE) -C apps/macos run-app
install:
$(MAKE) -C apps/macos install
cli-helper:
@mkdir -p $(CLI_HELPER_DIR)
MACOSX_DEPLOYMENT_TARGET=$(MACOS_DEPLOYMENT_TARGET) cargo build --target aarch64-apple-darwin
MACOSX_DEPLOYMENT_TARGET=$(MACOS_DEPLOYMENT_TARGET) cargo build --target x86_64-apple-darwin
lipo -create \
target/aarch64-apple-darwin/debug/$(CLI_NAME) \
target/x86_64-apple-darwin/debug/$(CLI_NAME) \
-output $(CLI_HELPER)
@chmod 755 $(CLI_HELPER)
codesign --force --options runtime --entitlements entitlements.plist --sign "$(SIGN_IDENTITY)" $(CLI_HELPER)
@echo "Built $(CLI_HELPER)"
cli-helper-universal:
@mkdir -p $(CLI_HELPER_DIR)
MACOSX_DEPLOYMENT_TARGET=$(MACOS_DEPLOYMENT_TARGET) cargo build --release --target aarch64-apple-darwin
MACOSX_DEPLOYMENT_TARGET=$(MACOS_DEPLOYMENT_TARGET) cargo build --release --target x86_64-apple-darwin
lipo -create \
target/aarch64-apple-darwin/release/$(CLI_NAME) \
target/x86_64-apple-darwin/release/$(CLI_NAME) \
-output $(CLI_HELPER)
chmod 755 $(CLI_HELPER)
@echo "Built universal $(CLI_HELPER)"
sign-cli-helper: cli-helper-universal
codesign --force --options runtime --timestamp --entitlements entitlements.plist --sign "$(SIGN_IDENTITY)" $(CLI_HELPER)