-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
101 lines (89 loc) · 3.17 KB
/
Makefile
File metadata and controls
101 lines (89 loc) · 3.17 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
93
94
95
96
97
98
99
100
101
# Makefile: Volume Control build rules
UID := $(shell id -u)
BUILD_DIR := /tmp/VolumeControl-$(UID)/build
CONFIGURATION_BUILD_DIR := $(BUILD_DIR)/target
DESTINATION_X86_64 := "platform=macOS,arch=x86_64"
DESTINATION_ARM64 := "platform=macOS,arch=arm64"
PROJECT := Volume Control.xcodeproj
SCHEME := Volume Control
.PHONY: debug-arm64 debug-x86_64 release \
clean-arm64 clean-x86_64 run generate-db
Q ?= @ # quiet by default; override with `make Q=`
# Debug build for ARM64
debug-arm64:
$(Q)xcrun xcodebuild \
-project "$(PROJECT)" \
-scheme "$(SCHEME)" \
-configuration Debug \
-destination "${DESTINATION_ARM64}" \
BUILD_DIR="$(BUILD_DIR)/debug" \
CONFIGURATION_BUILD_DIR="$(CONFIGURATION_BUILD_DIR)/debug" \
build | xcpretty
# Debug build for x86_64
debug-x86_64:
$(Q)xcrun xcodebuild \
-project "$(PROJECT)" \
-scheme "$(SCHEME)" \
-configuration Debug \
-destination "${DESTINATION_X86_64}" \
BUILD_DIR="$(BUILD_DIR)/debug" \
CONFIGURATION_BUILD_DIR="$(CONFIGURATION_BUILD_DIR)/debug" \
build | xcpretty
# Release build for distribution (both archs)
release:
$(Q)xcrun xcodebuild \
-project "$(PROJECT)" \
-scheme "$(SCHEME)" \
-configuration Release \
ARCHS="arm64 x86_64" \
ONLY_ACTIVE_ARCH=NO \
BUILD_DIR="$(BUILD_DIR)/release" \
CONFIGURATION_BUILD_DIR="$(CONFIGURATION_BUILD_DIR)/release" \
build | xcpretty
# Clean targets
clean-arm64:
$(Q)xcrun xcodebuild \
-project "$(PROJECT)" \
-scheme "$(SCHEME)" \
-configuration Debug \
-destination "${DESTINATION_ARM64}" \
BUILD_DIR="$(BUILD_DIR)/debug" \
CONFIGURATION_BUILD_DIR="$(CONFIGURATION_BUILD_DIR)/debug" \
clean | xcpretty
clean-x86_64:
$(Q)xcrun xcodebuild \
-project "$(PROJECT)" \
-scheme "$(SCHEME)" \
-configuration Debug \
-destination "${DESTINATION_ARM64}" \
BUILD_DIR="$(BUILD_DIR)/debug" \
CONFIGURATION_BUILD_DIR="$(CONFIGURATION_BUILD_DIR)/debug" \
clean | xcpretty
# Run the app (after debug build)
run:
$(Q)open "$(CONFIGURATION_BUILD_DIR)/debug/Volume Control.app"
command log stream --process "Volume Control" --predicate 'eventMessage CONTAINS "[DEBUG]"'
run:
$(Q)killall -15 "Volume Control" 2>/dev/null || true
$(Q)open "$(CONFIGURATION_BUILD_DIR)/debug/Volume Control.app"
echo "Waiting for logs from Volume Control..."
$(Q)command log stream --process "Volume Control"
# Generate compile_commands.json for LSP-clangd server
generate-db-x86_64:
$(Q)xcrun xcodebuild \
-project "$(PROJECT)" \
-scheme "$(SCHEME)" \
-configuration Debug \
-destination "${DESTINATION_X86_64}" \
BUILD_DIR="$(BUILD_DIR)" \
CONFIGURATION_BUILD_DIR="$(CONFIGURATION_BUILD_DIR)/debug" \
clean build | xcpretty -r json-compilation-database -o compile_commands_x86_64.json
generate-db-arm64:
$(Q)xcrun xcodebuild \
-project "$(PROJECT)" \
-scheme "$(SCHEME)" \
-configuration Debug \
-destination "${DESTINATION_ARM64}" \
BUILD_DIR="$(BUILD_DIR)" \
CONFIGURATION_BUILD_DIR="$(CONFIGURATION_BUILD_DIR)/debug" \
clean build | xcpretty -r json-compilation-database -o compile_commands_arm64.json