-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
171 lines (151 loc) · 6.65 KB
/
Copy pathMakefile
File metadata and controls
171 lines (151 loc) · 6.65 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# SoundBridge Development Makefile
# Shortcuts for building, testing, and running SoundBridge
.PHONY: help clean build run dev reset bundle install-deps test sign verify release test-release quick rebuild dmg full-release changelog update-version
# Default target - show help
help:
@echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
@echo " SoundBridge Development Commands"
@echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
@echo ""
@echo " Development:"
@echo " make dev - Start from scratch (reset + build + run with onboarding)"
@echo " make run - Run app without onboarding (keeps existing state)"
@echo " make reset - Reset onboarding + uninstall driver"
@echo ""
@echo " Building:"
@echo " make build - Build all components (DSP, driver, host, app)"
@echo " make bundle - Create .app bundle in dist/"
@echo " make clean - Clean all build artifacts"
@echo " make rebuild - Full clean + rebuild"
@echo " make update-version - Update all component versions from git tag"
@echo ""
@echo " Release (Code Signing):"
@echo " make release - Build, sign, and verify for distribution"
@echo " make sign - Code sign the .app bundle"
@echo " make verify - Verify all code signatures"
@echo " make test-release - Test the signed release build"
@echo ""
@echo " Distribution:"
@echo " make dmg - Create DMG with drag-to-Applications layout"
@echo " make full-release - Complete pipeline (build + sign + DMG)"
@echo ""
@echo " Other:"
@echo " make test - Run DSP tests"
@echo " make install-deps - Install build dependencies"
@echo " make changelog - Update CHANGELOG.md (optional: VERSION=vX.Y.Z)"
@echo ""
@echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
# Start from scratch - full developer workflow with onboarding
dev: reset build bundle
@echo ""
@echo "Starting SoundBridge with onboarding..."
@echo ""
@open dist/SoundBridge.app
# Run app normally without resetting onboarding
run:
@echo "Starting SoundBridge..."
@if [ -d "dist/SoundBridge.app" ]; then \
open dist/SoundBridge.app; \
else \
echo "❌ App bundle not found. Run 'make bundle' first."; \
exit 1; \
fi
# Update version from git tags
update-version:
@echo "Updating version from git tags..."
@./tools/update_versions.sh
@echo "✓ Version updated"
# Build all components
build: update-version
@echo "Building all components..."
@./tools/build_release.sh
# Create .app bundle
bundle:
@echo "Creating .app bundle..."
@./tools/create_app_bundle.sh
# Clean all build artifacts
clean:
@echo "Cleaning build artifacts..."
@rm -rf packages/dsp/build
@rm -rf packages/driver/build
@rm -rf packages/host/.build
@rm -rf apps/mac/SoundBridgeApp/.build
@rm -rf dist
@echo "✓ Clean complete"
# Reset onboarding and uninstall driver (for testing onboarding flow)
reset:
@echo "Resetting SoundBridge for fresh start..."
@pkill -f "SoundBridgeApp|SoundBridgeHost" 2>/dev/null || true
@./tools/uninstall_driver.sh || echo "No driver to uninstall (this is fine)"
@defaults delete com.soundbridge.menubar hasCompletedOnboarding 2>/dev/null || true
@defaults delete com.soundbridge.menubar onboardingVersion 2>/dev/null || true
@defaults delete com.soundbridge.menubar driverInstallDate 2>/dev/null || true
@sleep 2
@echo "✓ Reset complete - next launch will show onboarding"
# Install build dependencies
install-deps:
@echo "Checking build dependencies..."
@which cmake > /dev/null || (echo "❌ CMake not found. Install with: brew install cmake" && exit 1)
@which swift > /dev/null || (echo "❌ Swift not found. Install Xcode." && exit 1)
@echo "✓ All dependencies installed"
# Run DSP tests
test:
@echo "Running DSP tests..."
@cd packages/dsp && \
mkdir -p build && \
cd build && \
cmake .. && \
cmake --build . && \
./soundbridge_dsp_tests
# Quick rebuild (for when you only changed Swift code)
quick:
@echo "Quick rebuild (Swift only, universal)..."
@cd apps/mac/SoundBridgeApp && swift build -c release --triple arm64-apple-macosx && swift build -c release --triple x86_64-apple-macosx && mkdir -p .build/universal/release && lipo -create -output .build/universal/release/SoundBridgeApp .build/arm64-apple-macosx/release/SoundBridgeApp .build/x86_64-apple-macosx/release/SoundBridgeApp
@cd packages/host && swift build -c release --triple arm64-apple-macosx && swift build -c release --triple x86_64-apple-macosx && mkdir -p .build/universal/release && lipo -create -output .build/universal/release/SoundBridgeHost .build/arm64-apple-macosx/release/SoundBridgeHost .build/x86_64-apple-macosx/release/SoundBridgeHost
@./tools/create_app_bundle.sh
@echo "✓ Quick rebuild complete (universal)"
# Full clean + rebuild
rebuild: clean build bundle
@echo "✓ Full rebuild complete"
# Code signing targets
sign:
@echo "Code signing SoundBridge.app..."
@./tools/codesign.sh
verify:
@echo "Verifying signatures..."
@./tools/verify_signatures.sh
# Build and sign (for release)
release: build bundle sign verify
@echo ""
@echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
@echo " Release Build Complete!"
@echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
@echo ""
@echo "Signed app: dist/SoundBridge.app"
@echo ""
@echo "Next steps:"
@echo " • Test: make test-release"
@echo " • Notarize: ./tools/notarize.sh (Phase 2)"
@echo " • Package DMG: ./tools/create_dmg.sh (Phase 3)"
@echo ""
# Test the signed release build
test-release:
@echo " Testing signed release build..."
@open dist/SoundBridge.app
# Create DMG for distribution
dmg:
@echo "Creating DMG..."
@./tools/create_dmg.sh
# Full release pipeline (build, sign, create DMG)
full-release: build bundle sign verify dmg
@echo ""
@echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
@echo " Full Release Build Complete!"
@echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
@echo ""
@ls -lh dist/*.dmg
# Update changelog
changelog:
@echo "Updating CHANGELOG.md..."
@./tools/generate_changelog.sh $(if $(VERSION),--tag $(VERSION),)
@echo "✓ CHANGELOG.md updated"