-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
266 lines (241 loc) · 10.3 KB
/
Makefile
File metadata and controls
266 lines (241 loc) · 10.3 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# flutter_vst3 Toolkit Makefile
# Builds VST® 3 plugins with Flutter UI and pure Dart audio processing
.PHONY: all build test clean clean-native clean-plugin help dart-deps flutter-deps reverb-vst install reverb reverb-build-only echo echo-vst echo-build-only echo-deps
# Default target - build the Flutter Reverb VST® 3 plugin
all: reverb
# Build all components (host, graph, and reverb VST)
build: native plugin dart-deps flutter-deps reverb-vst
# Build the Flutter Reverb VST® 3 plugin
reverb: reverb-deps
@echo "Building Flutter Reverb VST® 3 plugin..."
@mkdir -p vsts/flutter_reverb/build
@cd vsts/flutter_reverb/build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j$(shell nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 1)
@echo "✅ VST® 3 plugin built: vsts/flutter_reverb/build/VST3/Release/flutter_reverb.vst3"
# Alias for reverb
reverb-vst: reverb
# Build reverb VST® 3 without installing (explicit build-only target)
reverb-build-only: reverb
# Build the Echo VST® 3 plugin
echo: echo-deps
@echo "Building Echo VST® 3 plugin..."
@mkdir -p vsts/echo/build
@cd vsts/echo/build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j$(shell nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 1)
@echo "✅ VST® 3 plugin built: vsts/echo/build/VST3/Release/echo.vst3"
# Alias for echo
echo-vst: echo
# Build echo VST® 3 without installing (explicit build-only target)
echo-build-only: echo
# Run all tests
test: build
@echo "Running flutter_vst3 tests..."
cd flutter_vst3 && dart test || true
@echo "Running flutter_reverb tests..."
cd vsts/flutter_reverb && dart test || true
@echo "Running echo tests..."
cd vsts/echo && dart test || true
@echo "Running dart_vst_host tests..."
cd dart_vst_host && dart test
@echo "Running dart_vst_graph tests..."
cd dart_vst_graph && dart test
# Build native libraries (required for all Dart components)
native: clean-native
@echo "Building native libraries..."
@if [ -z "$(VST3_SDK_DIR)" ]; then \
if [ -d "vst3sdk" ]; then \
export VST3_SDK_DIR="$(shell pwd)/vst3sdk"; \
echo "Using VST3 SDK from $(shell pwd)/vst3sdk"; \
elif [ -d "/workspace/vst3sdk" ]; then \
export VST3_SDK_DIR="/workspace/vst3sdk"; \
echo "Using VST3 SDK from /workspace/vst3sdk"; \
else \
echo "Error: VST3_SDK_DIR environment variable not set"; \
echo "Please set it to the root of Steinberg VST3 SDK or run setup.sh first"; \
exit 1; \
fi; \
fi
@echo "Building dart_vst_host library..."
@if [ -d "/workspace" ]; then \
mkdir -p /workspace/dart_vst_host/native/build; \
cd /workspace/dart_vst_host/native/build && VST3_SDK_DIR=$${VST3_SDK_DIR:-/workspace/vst3sdk} cmake .. && make; \
cp /workspace/dart_vst_host/native/build/libdart_vst_host.* /workspace/ 2>/dev/null || true; \
cp /workspace/dart_vst_host/native/build/libdart_vst_host.* /workspace/dart_vst_host/ 2>/dev/null || true; \
else \
mkdir -p dart_vst_host/native/build; \
cd dart_vst_host/native/build && VST3_SDK_DIR=$${VST3_SDK_DIR:-$(shell pwd)/vst3sdk} cmake .. && make; \
cp dart_vst_host/native/build/libdart_vst_host.* . 2>/dev/null || true; \
cp dart_vst_host/native/build/libdart_vst_host.* dart_vst_host/ 2>/dev/null || true; \
fi
@echo "Building dart_vst_graph library..."
@if [ -d "/workspace" ]; then \
mkdir -p /workspace/dart_vst_graph/native/build; \
cd /workspace/dart_vst_graph/native/build && VST3_SDK_DIR=$${VST3_SDK_DIR:-/workspace/vst3sdk} cmake .. && make; \
cp /workspace/dart_vst_graph/native/build/libdart_vst_graph.* /workspace/ 2>/dev/null || true; \
cp /workspace/dart_vst_graph/native/build/libdart_vst_graph.* /workspace/dart_vst_graph/ 2>/dev/null || true; \
else \
mkdir -p dart_vst_graph/native/build; \
cd dart_vst_graph/native/build && VST3_SDK_DIR=$${VST3_SDK_DIR:-$(shell pwd)/vst3sdk} cmake .. && make; \
cp dart_vst_graph/native/build/libdart_vst_graph.* . 2>/dev/null || true; \
cp dart_vst_graph/native/build/libdart_vst_graph.* dart_vst_graph/ 2>/dev/null || true; \
fi
@echo "Native libraries built and copied to required locations"
# Build all VST® 3 plugins
plugin: native clean-plugin
@echo "Building all VST® 3 plugins..."
@for plugin in vsts/*/; do \
if [ -f "$$plugin/CMakeLists.txt" ]; then \
echo "Building $$plugin"; \
cd "$$plugin" && mkdir -p build && cd build && cmake .. && make && cd ../../../; \
fi; \
done
# Install Dart dependencies for all packages
dart-deps:
@echo "Installing flutter_vst3 dependencies..."
@if [ -d "/workspace" ]; then \
dart pub get --directory=/workspace/flutter_vst3; \
dart pub get --directory=/workspace/dart_vst_host; \
dart pub get --directory=/workspace/dart_vst_graph; \
else \
dart pub get --directory=flutter_vst3; \
dart pub get --directory=dart_vst_host; \
dart pub get --directory=dart_vst_graph; \
fi
# Install reverb plugin dependencies
reverb-deps:
@echo "Installing Flutter Reverb dependencies..."
@if [ -d "/workspace" ]; then \
dart pub get --directory=/workspace/flutter_vst3; \
dart pub get --directory=/workspace/vsts/flutter_reverb; \
else \
dart pub get --directory=flutter_vst3; \
dart pub get --directory=vsts/flutter_reverb; \
fi
# Install echo plugin dependencies
echo-deps:
@echo "Installing Echo plugin dependencies..."
@if [ -d "/workspace" ]; then \
dart pub get --directory=/workspace/flutter_vst3; \
dart pub get --directory=/workspace/vsts/echo; \
else \
dart pub get --directory=flutter_vst3; \
dart pub get --directory=vsts/echo; \
fi
# Install Flutter dependencies
flutter-deps:
@echo "Installing Flutter dependencies..."
@if [ -d "/workspace" ]; then \
flutter pub get --directory=/workspace/flutter_ui; \
else \
flutter pub get --directory=flutter_ui; \
fi
# Install VST® 3 plugin to system location (macOS/Linux)
install: reverb-vst
@echo "Installing flutter_reverb.vst3..."
@if [ "$$(uname)" = "Darwin" ]; then \
mkdir -p ~/Library/Audio/Plug-Ins/VST3/; \
cp -r vsts/flutter_reverb/build/VST3/Release/flutter_reverb.vst3 ~/Library/Audio/Plug-Ins/VST3/; \
echo "✅ Installed to ~/Library/Audio/Plug-Ins/VST3/"; \
elif [ "$$(uname)" = "Linux" ]; then \
mkdir -p ~/.vst3/; \
cp -r vsts/flutter_reverb/build/VST3/Release/flutter_reverb.vst3 ~/.vst3/; \
echo "✅ Installed to ~/.vst3/"; \
else \
echo "⚠️ Manual installation required on this platform"; \
fi
# Clean all build artifacts
clean: clean-native clean-plugin
@echo "Removing native libraries from all locations..."
rm -f libdart_vst_host.*
rm -f *.dylib *.so *.dll
rm -f dart_vst_host/libdart_vst_host.*
rm -f dart_vst_graph/libdart_vst_graph.*
# Clean native library builds
clean-native:
@echo "Cleaning native builds..."
@if [ -d "/workspace" ]; then \
rm -rf /workspace/dart_vst_host/native/build; \
rm -rf /workspace/dart_vst_graph/native/build; \
else \
rm -rf dart_vst_host/native/build; \
rm -rf dart_vst_graph/native/build; \
fi
# Clean plugin builds
clean-plugin:
@echo "Cleaning all VST plugin builds..."
@for plugin in vsts/*/; do \
if [ -d "$$plugin/build" ]; then \
echo "Cleaning $$plugin"; \
rm -rf "$$plugin/build"; \
fi; \
done
# Run Flutter app
run-flutter: flutter-deps
cd flutter_ui && flutter run
# Run dart_vst_host tests only
test-host: native dart-deps
cd dart_vst_host && dart test
# Run dart_vst_graph tests only
test-graph: native dart-deps
cd dart_vst_graph && dart test
# Check environment
check-env:
@echo "Checking environment..."
@test -n "$(VST3_SDK_DIR)" && echo "✅ VST3_SDK_DIR = $(VST3_SDK_DIR)" || echo "❌ VST3_SDK_DIR not set"
@command -v cmake >/dev/null 2>&1 && echo "✅ CMake available" || echo "❌ CMake not found"
@command -v dart >/dev/null 2>&1 && echo "✅ Dart available" || echo "❌ Dart not found"
@command -v flutter >/dev/null 2>&1 && echo "✅ Flutter available" || echo "❌ Flutter not found"
# Help
help:
@echo "Dart VST3 Toolkit Build System"
@echo "==============================="
@echo ""
@echo "🎯 PRIMARY TARGET:"
@echo " all (default) - Build Flutter Dart Reverb VST3 plugin"
@echo ""
@echo "🎛️ PLUGIN TARGETS:"
@echo " reverb-vst - Build Flutter Dart Reverb VST3 plugin"
@echo " reverb-build-only - Build Flutter Dart Reverb VST3 plugin (no install)"
@echo " reverb-deps - Install reverb plugin dependencies only"
@echo " echo-vst - Build Echo VST3 plugin"
@echo " echo-build-only - Build Echo VST3 plugin (no install)"
@echo " echo-deps - Install echo plugin dependencies only"
@echo " install - Build and install VST3 plugin to system"
@echo ""
@echo "🏗️ BUILD TARGETS:"
@echo " build - Build all components (host, graph, reverb)"
@echo " native - Build native library with VST3 bridge"
@echo " plugin - Build generic VST3 plugin (old)"
@echo ""
@echo "📦 DEPENDENCY TARGETS:"
@echo " dart-deps - Install all Dart package dependencies"
@echo " flutter-deps - Install Flutter UI dependencies"
@echo ""
@echo "🧪 TESTING TARGETS:"
@echo " test - Run all tests (bridge, reverb, host, graph)"
@echo " test-host - Run dart_vst_host tests only"
@echo " test-graph - Run dart_vst_graph tests only"
@echo ""
@echo "🧹 CLEANUP TARGETS:"
@echo " clean - Clean all build artifacts"
@echo " clean-native - Clean native library build only"
@echo " clean-plugin - Clean plugin build only"
@echo ""
@echo "🔧 UTILITY TARGETS:"
@echo " run-flutter - Run Flutter UI application"
@echo " check-env - Check build environment setup"
@echo " help - Show this help message"
@echo ""
@echo "📋 EXAMPLES:"
@echo " make # Build FlutterDartReverb.vst3"
@echo " make clean reverb-vst # Clean build and rebuild reverb VST"
@echo " make install # Build and install to DAW plugins folder"
@echo ""
@echo "🔧 PREREQUISITES:"
@echo " • Set VST3_SDK_DIR environment variable (or use bundled SDK)"
@echo " • Install CMake 3.20+, Dart SDK 3.0+, and Flutter"
@echo ""
@echo "📁 PACKAGES:"
@echo " • dart_vst3_bridge/ - FFI bridge for any Dart VST3 plugin"
@echo " • vsts/flutter_reverb/ - Pure Dart reverb VST3 implementation"
@echo " • vsts/echo/ - Pure Dart echo VST3 implementation"
@echo " • dart_vst_host/ - VST3 hosting for Dart applications"
@echo " • dart_vst_graph/ - Audio graph system with VST routing"