-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·1709 lines (1621 loc) · 82.1 KB
/
Makefile
File metadata and controls
executable file
·1709 lines (1621 loc) · 82.1 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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#! /bin/bash
# MACH1 SPATIAL SYSTEM MakeFile
.PHONY: help show-arch
help:
@echo "MACH1 SPATIAL SYSTEM - Available Commands:"
@echo ""
@echo "Version Management:"
@echo " make update-version VERSION=<version> - Update central version and regenerate all components"
@echo " make update-versions - Regenerate component versions from current base"
@echo ""
@echo "Development:"
@echo " make dev - Setup development environment for all components"
@echo " make clean - Clean all build directories"
@echo " make configure - Configure for release build"
@echo " make build - Build all components"
@echo " make build-vlc - Build VLC from source (for m1-player)"
@echo ""
@echo "Cross-compilation (macOS only - requires x86_64 Homebrew at /usr/local):"
@echo " make dev-player-x86 - Configure m1-player for x86_64 (dev build)"
@echo " make configure-player-x86 - Configure m1-player for x86_64 (release build)"
@echo " make build-player-x86 - Build m1-player for x86_64"
@echo " make show-arch - Show current build architecture info"
@echo ""
@echo "Packaging:"
@echo " make package - Full local build (configure, build, codesign, notarize, installer)"
@echo " make package-from-ci VERSION=x.x.x - Download CI builds, sign AAX locally, create installer"
@echo " make package-from-ci COMMIT=abc123 - Same as above, but by commit SHA"
@echo " make list-ci-builds - List available CI builds in S3"
@echo " make installer-pkg - Build installer packages only"
@echo ""
@echo "CI/CD Testing (local simulation):"
@echo " make test-ci-build - Simulate full CI build locally"
@echo " make test-ci-build-player-only - Test just m1-player build (fastest)"
@echo " make test-ci-yaml - Validate workflow YAML syntax"
@echo " make test-ci-act-arm - Run macOS ARM64 job with act"
@echo " make test-ci-act-arm DRYRUN=1 - Dry-run (show what would run)"
@echo ""
@echo "Code Signing:"
@echo " make codesign - Sign all binaries (macOS/Windows)"
@echo " make codesign-vst3 - Sign VST3 plugins only"
@echo " make codesign-apps - Sign applications only"
@echo " make test-azure-signing - Test Azure Trusted Signing setup (Windows)"
@echo " make verify-win-signing - Verify all Windows signatures including installer"
@echo ""
@echo "For more details, see the Makefile or run individual commands with --help"
# Show current build architecture (useful for CI/CD and distribution)
show-arch:
ifeq ($(detected_OS),Darwin)
@echo "=== Build Architecture Information ==="
@echo "Host OS: macOS"
@echo "Host Architecture: $$(uname -m)"
@if [ "$$(uname -m)" = "arm64" ]; then \
echo "Target: Apple Silicon (ARM64)"; \
echo "Homebrew: /opt/homebrew"; \
echo "Deployment Target: macOS 11.0+"; \
else \
echo "Target: Intel (x86_64)"; \
echo "Homebrew: /usr/local"; \
echo "Deployment Target: macOS 10.14+"; \
fi
@echo ""
@echo "NOTE: m1-player builds for HOST architecture only."
@echo " For distribution, build on each target platform separately."
else ifeq ($(detected_OS),Windows)
@echo "=== Build Architecture Information ==="
@echo "Host OS: Windows"
@if "%PROCESSOR_ARCHITECTURE%"=="AMD64" echo "Architecture: x86_64 (64-bit)"
@if "%PROCESSOR_ARCHITECTURE%"=="x86" echo "Architecture: x86 (32-bit)"
else
@echo "=== Build Architecture Information ==="
@echo "Host OS: $(detected_OS)"
@echo "Architecture: $$(uname -m)"
endif
# Auto-generate Makefile.variables from example if it doesn't exist
Makefile.variables:
@if [ ! -f "Makefile.variables" ] && [ -f "Makefile.variables.example" ]; then \
echo "Makefile.variables not found, creating from example..."; \
cp Makefile.variables.example Makefile.variables; \
echo "Created Makefile.variables from example"; \
echo " Please review and update Makefile.variables with your actual values"; \
elif [ ! -f "Makefile.variables.example" ]; then \
echo " Neither Makefile.variables nor Makefile.variables.example found"; \
exit 1; \
fi
# Make sure you fill all the needed variables and paths
-include ./Makefile.variables
# getting OS type
ifeq ($(OS),Windows_NT)
detected_OS := Windows
else
detected_OS := $(shell uname)
endif
.PHONY: update-versions update-versions-internal
update-versions:
ifneq ($(detected_OS),Windows)
@chmod +x ./installer/generate_version.sh
@./installer/generate_version.sh --commit-version
endif
update-versions-internal:
ifneq ($(detected_OS),Windows)
@chmod +x ./installer/generate_version.sh
@./installer/generate_version.sh
endif
.PHONY: update-version
update-version:
ifneq ($(detected_OS),Windows)
@if [ -z "$(VERSION)" ]; then \
echo "Usage: make update-version VERSION=<new_version>"; \
echo "Example: make update-version VERSION=2.1"; \
echo "Current version: $$(cat VERSION)"; \
echo ""; \
echo "This command updates the central VERSION file and regenerates all component versions."; \
exit 1; \
fi
@echo "Updating central version from $$(cat VERSION) to $(VERSION)"
@echo "$(VERSION)" > VERSION
@echo "Regenerating all component versions..."
@chmod +x ./installer/generate_version.sh
@./installer/generate_version.sh --commit-version
@echo "Version update complete!"
@echo "Current versions:"
@echo "Central: $$(cat VERSION)"
@echo "m1-panner: $$(cat m1-panner/VERSION)"
@echo "m1-monitor: $$(cat m1-monitor/VERSION)"
@echo "m1-player: $$(cat m1-player/VERSION)"
@echo "m1-orientationmanager: $$(cat m1-orientationmanager/VERSION)"
@echo "m1-system-helper: $$(cat services/m1-system-helper/VERSION)"
@echo "m1-transcoder: $$(cat m1-transcoder/VERSION)"
@echo ""
@echo "Installer versions updated:"
@echo "macOS: $$(grep -c "$(VERSION)" installer/osx/Mach1\ Spatial\ System\ Installer.pkgproj) packages"
@echo "Windows: $$(grep AppVersion installer/win/installer.iss)"
else
@echo "Version updates are not supported on Windows"
endif
.PHONY: test-aax-monitor test-aax-panner test-aax-plugins test-aax-release
.PHONY: verify-aax-signing diagnose-aax
.PHONY: test-ci-build test-ci-build-player-only test-ci-yaml
.PHONY: test-ci-act-arm
.PHONY: package-from-ci download-ci-artifacts install-arch-artifacts sign-aax-local installer-pkg-from-ci
pull:
git pull --recurse-submodules
git-submodule-clean:
git submodule foreach --recursive git clean -x -f -d
make pull
git-nuke:
@echo "WARNING: This will completely nuke and re-fetch ALL submodules!"
@echo "This is intended for users who have old submodule histories after a rewrite."
@echo "Press Ctrl+C now if you want to cancel..."
@sleep 3
@echo " Deinitializing all submodules..."
git submodule deinit --all --force || true
@echo "Removing .git/modules to clear cached submodule references..."
rm -rf .git/modules
@echo " Removing submodule directories..."
git submodule foreach --recursive 'rm -rf "$$PWD"' || true
@echo "Re-initializing and updating all submodules from scratch..."
git submodule update --init --recursive --force
@echo "All submodules have been nuked and re-fetched successfully!"
@echo "TIP: You may want to run 'make clean' and 'make setup' after this."
setup:
ifeq ($(detected_OS),Darwin)
# Assumes you have installed Homebrew package manager
brew install yasm cmake p7zip ninja act pre-commit launchcontrol
# VLC 3.x build dependencies (use FFmpeg 6.x for compatibility)
brew install autoconf automake libtool pkg-config
brew install ffmpeg@6 && brew link ffmpeg@6
npm install -g nodemon
cd m1-transcoder && ./scripts/setup.sh
cd m1-panner && pre-commit install
cd m1-monitor && pre-commit install
else ifeq ($(detected_OS),Windows)
@choco version >nul || (echo "chocolately is not working or installed" && exit 1)
@echo "choco is installed and working"
@choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' --apply-install-arguments-to-dependencies
@choco install pkgconfiglite autoconf automake libtool
@pip3 install meson
@if not exist "$(pip show pre-commit)" (pip install pre-commit)
npm install -g nodemon
cd m1-panner && pre-commit install
cd m1-monitor && pre-commit install
endif
setup-codeisgning:
ifeq ($(detected_OS),Darwin)
security find-identity -p basic -v
xcrun notarytool store-credentials 'notarize-app' --apple-id $(APPLE_USERNAME) --team-id $(APPLE_TEAM_CODE) --password $(ALTOOL_APPPASS)
endif
setup-services: clean-services
ifeq ($(detected_OS),Darwin)
sudo mkdir -p /Library/Application\ Support/Mach1
sudo cp m1-orientationmanager/Resources/settings.json /Library/Application\ Support/Mach1/settings.json
sudo cp m1-orientationmanager/Resources/com.mach1.spatial.orientationmanager.plist /Library/LaunchAgents/com.mach1.spatial.orientationmanager.plist
sudo cp services/m1-system-helper/com.mach1.spatial.helper.plist /Library/LaunchAgents/com.mach1.spatial.helper.plist
endif
clean-services:
ifeq ($(detected_OS),Darwin)
sudo rm -f /Library/Application\ Support/Mach1/settings.json
sudo rm -f /Library/LaunchAgents/com.mach1.spatial.orientationmanager.plist
sudo rm -f /Library/LaunchAgents/com.mach1.spatial.helper.plist
killall m1-system-helper || true
killall m1-orientationmanager || true
endif
clean:
ifeq ($(detected_OS),Darwin)
rm -rf installer/osx/build
endif
ifeq ($(detected_OS),Windows)
@if exist m1-monitor\\build (rmdir /s /q m1-monitor\\build)
@if exist m1-panner\\build (rmdir /s /q m1-panner\\build)
@if exist m1-player\\build (rmdir /s /q m1-player\\build)
@if exist m1-transcoder\\dist (rmdir /s /q m1-transcoder\\dist)
@if exist m1-orientationmanager\\build (rmdir /s /q m1-orientationmanager\\build)
@if exist services\\m1-system-helper\\build (rmdir /s /q services\\m1-system-helper\\build)
else
rm -rf m1-monitor/build
rm -rf m1-panner/build
rm -rf m1-player/build
rm -rf m1-transcoder/dist
rm -rf m1-orientationmanager/build
rm -rf services/m1-system-helper/build
endif
clean-dev:
ifeq ($(detected_OS),Darwin)
rm -rf installer/osx/build
endif
ifeq ($(detected_OS),Windows)
@if exist m1-monitor\\build-dev (rmdir /s /q m1-monitor\\build-dev)
@if exist m1-panner\\build-dev (rmdir /s /q m1-panner\\build-dev)
@if exist m1-player\\build-dev (rmdir /s /q m1-player\\build-dev)
@if exist m1-transcoder\\dist (rmdir /s /q m1-transcoder\\dist)
@if exist m1-orientationmanager\\build-dev (rmdir /s /q m1-orientationmanager\\build-dev)
@if exist services\\m1-system-helper\\build-dev (rmdir /s /q services\\m1-system-helper\\build-dev)
else
rm -rf m1-monitor/build-dev
rm -rf m1-panner/build-dev
rm -rf m1-player/build-dev
rm -rf m1-transcoder/dist
rm -rf m1-orientationmanager/build-dev
rm -rf services/m1-system-helper/build-dev
endif
clean-installs:
ifeq ($(detected_OS),Darwin)
sudo rm -rf /Applications/Mach1\ Spatial\ System
sudo rm -rf /Applications/Mach1
sudo rm -rf /Library/LaunchAgents/com.mach1.spatial.orientationmanager.plist
sudo rm -rf /Library/LaunchAgents/com.mach1.spatial.helper.plist
sudo rm -rf /Library/Application\ Support/Mach1
# removing global
sudo rm -rf "/Library/Application Support/Avid/Audio/Plug-Ins/M1-Monitor.aaxplugin"
sudo rm -rf "/Library/Application Support/Avid/Audio/Plug-Ins/M1-Panner.aaxplugin"
sudo rm -rf "/Library/Audio/Plug-Ins/VST/M1-Monitor.vst"
sudo rm -rf "/Library/Audio/Plug-Ins/VST/M1-Panner.vst"
sudo rm -rf "/Library/Audio/Plug-Ins/VST3/M1-Monitor.vst3"
sudo rm -rf "/Library/Audio/Plug-Ins/VST3/M1-Panner.vst3"
sudo rm -rf "/Library/Audio/Plug-Ins/Components/M1-Monitor.component"
sudo rm -rf "/Library/Audio/Plug-Ins/Components/M1-Panner.component"
# removing local user
rm -rf ~/Library/Application\ Support/Avid/Audio/Plug-Ins/M1-Monitor.aaxplugin
rm -rf ~/Library/Application\ Support/Avid/Audio/Plug-Ins/M1-Panner.aaxplugin
rm -rf ~/Library/Audio/Plug-Ins/VST/M1-Monitor.vst
rm -rf ~/Library/Audio/Plug-Ins/VST/M1-Panner.vst
rm -rf ~/Library/Audio/Plug-Ins/VST3/M1-Monitor.vst3
rm -rf ~/Library/Audio/Plug-Ins/VST3/M1-Panner.vst3
rm -rf ~/Library/Audio/Plug-Ins/Components/M1-Monitor.component
rm -rf ~/Library/Audio/Plug-Ins/Components/M1-Panner.component
else ifeq ($(detected_OS),Windows)
@echo "WARNING: You must run this command as Administrator to remove system files!"
@takeown /f "$(ProgramFiles)\Mach1" /r /d y >nul 2>&1
@icacls "$(ProgramFiles)\Mach1" /grant %USERNAME%:F /t >nul 2>&1
@if exist "$(ProgramFiles)\Mach1" (rmdir /s /q "$(ProgramFiles)\Mach1")
@takeown /f "$(ProgramFiles)\Common Files\Avid\Audio\Plug-Ins\M1-Monitor.aaxplugin" /r /d y >nul 2>&1
@icacls "$(ProgramFiles)\Common Files\Avid\Audio\Plug-Ins\M1-Monitor.aaxplugin" /grant %USERNAME%:F /t >nul 2>&1
@if exist "$(ProgramFiles)\Common Files\Avid\Audio\Plug-Ins\M1-Monitor.aaxplugin" (rmdir /s /q "$(ProgramFiles)\Common Files\Avid\Audio\Plug-Ins\M1-Monitor.aaxplugin")
@takeown /f "$(ProgramFiles)\Common Files\Avid\Audio\Plug-Ins\M1-Panner.aaxplugin" /r /d y >nul 2>&1
@icacls "$(ProgramFiles)\Common Files\Avid\Audio\Plug-Ins\M1-Panner.aaxplugin" /grant %USERNAME%:F /t >nul 2>&1
@if exist "$(ProgramFiles)\Common Files\Avid\Audio\Plug-Ins\M1-Panner.aaxplugin" (rmdir /s /q "$(ProgramFiles)\Common Files\Avid\Audio\Plug-Ins\M1-Panner.aaxplugin")
@takeown /f "$(ProgramFiles)\Steinberg\VstPlugins\M1-Monitor.dll" /d y >nul 2>&1
@icacls "$(ProgramFiles)\Steinberg\VstPlugins\M1-Monitor.dll" /grant %USERNAME%:F >nul 2>&1
@if exist "$(ProgramFiles)\Steinberg\VstPlugins\M1-Monitor.dll" (del /f /q "$(ProgramFiles)\Steinberg\VstPlugins\M1-Monitor.dll")
@takeown /f "$(ProgramFiles)\Steinberg\VstPlugins\M1-Panner.dll" /d y >nul 2>&1
@icacls "$(ProgramFiles)\Steinberg\VstPlugins\M1-Panner.dll" /grant %USERNAME%:F >nul 2>&1
@if exist "$(ProgramFiles)\Steinberg\VstPlugins\M1-Panner.dll" (del /f /q "$(ProgramFiles)\Steinberg\VstPlugins\M1-Panner.dll")
@takeown /f "$(ProgramFiles)\Common Files\VST3\M1-Monitor.vst3" /r /d y >nul 2>&1
@icacls "$(ProgramFiles)\Common Files\VST3\M1-Monitor.vst3" /grant %USERNAME%:F /t >nul 2>&1
@if exist "$(ProgramFiles)\Common Files\VST3\M1-Monitor.vst3" (rmdir /s /q "$(ProgramFiles)\Common Files\VST3\M1-Monitor.vst3")
@takeown /f "$(ProgramFiles)\Common Files\VST3\M1-Panner.vst3" /r /d y >nul 2>&1
@icacls "$(ProgramFiles)\Common Files\VST3\M1-Panner.vst3" /grant %USERNAME%:F /t >nul 2>&1
@if exist "$(ProgramFiles)\Common Files\VST3\M1-Panner.vst3" (rmdir /s /q "$(ProgramFiles)\Common Files\VST3\M1-Panner.vst3")
@takeown /f "$(ProgramData)\Mach1" /r /d y >nul 2>&1
@icacls "$(ProgramData)\Mach1" /grant %USERNAME%:F /t >nul 2>&1
@if exist "$(ProgramData)\Mach1" (rmdir /s /q "$(ProgramData)\Mach1")
endif
# Add these helper functions at the top of the Makefile
define kill_port
@lsof -ti:$(1) | xargs kill -9 2>/dev/null || true
endef
# Force target to always run
FORCE:
clean-docs-ports:
ifeq ($(detected_OS),Darwin)
@lsof -ti:$(docs_port) | xargs kill -9 2>/dev/null || true
else ifeq ($(detected_OS),Windows)
@for /f "tokens=5" %%a in ('netstat -aon ^| findstr :$(docs_port)') do taskkill /PID %%a /F 2>nul || exit 0
else
@lsof -ti:$(docs_port) | xargs kill -9 2>/dev/null || true
endif
clean-docs-dist:
ifeq ($(detected_OS),Windows)
@if exist installer\resources\docs\dist (rmdir /s /q installer\resources\docs\dist)
else
@echo "Cleaning documentation dist folder..."
rm -rf installer/resources/docs/dist
endif
# Documentation deployment commands
docs-build: clean-docs-dist FORCE
@echo "Building documentation..."
ifeq ($(detected_OS),Windows)
cd installer\resources\docs && node build-docs.js
else
cd installer/resources/docs && node build-docs.js
endif
docs-deploy: docs-build
@echo "Deploying documentation to spatialsystem.mach1.tech..."
aws s3 sync installer/resources/docs/dist/ s3://$(docs_s3_bucket_name)/ \
--cache-control "public, max-age=3600"
@echo "Invalidating CloudFront cache..."
@aws cloudfront create-invalidation \
--distribution-id $(docs_cloudfront_id) \
--paths "/*" \
--output json \
--query 'Invalidation.{Status:Status,CreateTime:CreateTime,Id:Id}' || (echo "CloudFront invalidation failed" && exit 1)
@echo "Documentation deployed to spatialsystem.mach1.tech"
docs-stage: docs-build
@echo "Deploying documentation to staging..."
aws s3 sync installer/resources/docs/dist/ s3://$(docs_s3_stage_bucket_name)/ \
--cache-control "no-cache"
@echo "Invalidating CloudFront cache..."
@aws cloudfront create-invalidation \
--distribution-id $(docs_stage_cloudfront_id) \
--paths "/*" \
--output json \
--query 'Invalidation.{Status:Status,CreateTime:CreateTime,Id:Id}' || (echo "CloudFront invalidation failed" && exit 1)
@echo "Documentation deployed to staging.spatialsystem.mach1.tech"
docs-local: clean-docs-ports docs-build
@echo "Starting local documentation server..."
cd installer/resources/docs/dist && python3 -m http.server $(docs_port)
@echo "Documentation available at http://localhost:$(docs_port)"
docs-verify:
@echo "🔍 Verifying documentation deployment..."
@echo "Testing CloudFront direct URL..."
@curl -I -s https://$(shell aws cloudfront get-distribution --id $(docs_cloudfront_id) --query 'Distribution.DomainName' --output text) | head -1
@echo "Testing custom domain URL..."
@curl -I -s https://spatialsystem.mach1.tech | head -1 || echo "Custom domain not accessible"
@echo "DNS lookup for spatialsystem.mach1.tech:"
@dig spatialsystem.mach1.tech CNAME +short || nslookup spatialsystem.mach1.tech
# configure for debug and setup dev envs with common IDEs
dev: clean-dev dev-monitor dev-panner dev-player dev-orientationmanager dev-system-helper dev-transcoder
dev-monitor:
ifeq ($(detected_OS),Darwin)
cmake m1-monitor -Bm1-monitor/build-dev -G "Xcode" -DJUCE_COPY_PLUGIN_AFTER_BUILD=ON -DBUILD_VST3=ON -DBUILD_AAX=ON -DBUILD_AU=ON -DBUILD_VST=ON -DVST2_PATH=$(VST2_PATH) -DBUILD_STANDALONE=ON
else
cmake m1-monitor -Bm1-monitor/build-dev -DJUCE_COPY_PLUGIN_AFTER_BUILD=ON -DBUILD_VST3=ON -DBUILD_STANDALONE=ON
endif
dev-panner:
ifeq ($(detected_OS),Darwin)
cmake m1-panner -Bm1-panner/build-dev -G "Xcode" -DJUCE_COPY_PLUGIN_AFTER_BUILD=ON -DBUILD_VST3=ON -DBUILD_AAX=ON -DBUILD_AU=ON -DBUILD_VST=ON -DVST2_PATH=$(VST2_PATH) -DBUILD_STANDALONE=ON
else
cmake m1-panner -Bm1-panner/build-dev -DJUCE_COPY_PLUGIN_AFTER_BUILD=ON -DBUILD_VST3=ON -DBUILD_AAX=ON -DBUILD_STANDALONE=ON
endif
dev-player:
ifeq ($(detected_OS),Darwin)
@echo "Configuring m1-player (dev)..."
cmake m1-player -Bm1-player/build-dev -G "Xcode" -DLIBVLC_BUILD_FROM_SOURCE=ON -DLIBVLC_STATIC=OFF || true
@if [ ! -f "m1-player/build-dev/vlc-install/lib/libvlc.dylib" ]; then \
echo ""; \
echo "VLC libraries not found. Building VLC from source..."; \
echo ""; \
cd m1-player && ./build_vlc.sh build-dev && \
echo "" && \
echo "VLC build complete! Reconfiguring CMake..." && \
echo "" && \
cd .. && cmake m1-player -Bm1-player/build-dev -G "Xcode" -DLIBVLC_BUILD_FROM_SOURCE=ON -DLIBVLC_STATIC=OFF; \
fi
else ifeq ($(detected_OS),Windows)
@echo "Configuring m1-player (dev)..."
-cmake m1-player -Bm1-player/build-dev -DLIBVLC_BUILD_FROM_SOURCE=ON -DLIBVLC_STATIC=OFF
@if not exist "m1-player\build-dev\vlc-install\lib\libvlc.lib" ( \
echo. & \
echo VLC libraries not found. Run build_vlc.ps1 to download VLC SDK... & \
echo. & \
powershell -ExecutionPolicy Bypass -File m1-player\build_vlc.ps1 -BuildDir build-dev & \
echo. & \
echo VLC setup complete! Reconfiguring CMake... & \
echo. & \
cmake m1-player -Bm1-player/build-dev -DLIBVLC_BUILD_FROM_SOURCE=ON -DLIBVLC_STATIC=OFF \
)
else
@echo "Configuring m1-player (dev)..."
cmake m1-player -Bm1-player/build-dev -DLIBVLC_BUILD_FROM_SOURCE=ON -DLIBVLC_STATIC=OFF || true
@if [ ! -f "m1-player/build-dev/vlc-install/lib/libvlc.lib" ] && [ ! -f "m1-player/build-dev/vlc-install/lib/libvlc.dll.a" ]; then \
echo ""; \
echo "VLC libraries not found. Building VLC from source..."; \
echo "This will take 20-40 minutes..."; \
echo ""; \
cd m1-player && ./build_vlc.sh build-dev && \
echo "" && \
echo "VLC build complete! Reconfiguring CMake..." && \
echo "" && \
cd .. && cmake m1-player -Bm1-player/build-dev -DLIBVLC_BUILD_FROM_SOURCE=ON -DLIBVLC_STATIC=OFF; \
fi
endif
# Cross-compile m1-player for x86_64 on Apple Silicon (via Rosetta 2)
# Requires x86_64 Homebrew installed at /usr/local with all VLC dependencies
dev-player-x86:
ifeq ($(detected_OS),Darwin)
@echo "Configuring m1-player for x86_64 (cross-compilation via Rosetta)..."
@if [ ! -d "/usr/local/bin" ]; then \
echo "ERROR: x86_64 Homebrew not found at /usr/local"; \
echo "Install it with:"; \
echo " arch -x86_64 /bin/bash -c \"\$$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\""; \
exit 1; \
fi
arch -x86_64 cmake m1-player -Bm1-player/build-dev-x86 -G "Xcode" \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DLIBVLC_BUILD_FROM_SOURCE=ON -DLIBVLC_STATIC=OFF || true
@if [ ! -f "m1-player/build-dev-x86/vlc-install/lib/libvlc.dylib" ]; then \
echo ""; \
echo "VLC libraries not found. Building VLC for x86_64..."; \
echo ""; \
cd m1-player && arch -x86_64 ./build_vlc.sh build-dev-x86 && \
echo "" && \
echo "VLC build complete! Reconfiguring CMake..." && \
echo "" && \
cd .. && arch -x86_64 cmake m1-player -Bm1-player/build-dev-x86 -G "Xcode" \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DLIBVLC_BUILD_FROM_SOURCE=ON -DLIBVLC_STATIC=OFF; \
fi
else
@echo "ERROR: dev-player-x86 is only available on macOS"
@exit 1
endif
dev-orientationmanager:
ifeq ($(detected_OS),Darwin)
cmake m1-orientationmanager -Bm1-orientationmanager/build-dev -G "Xcode" -DENABLE_DEBUG_EMULATOR_DEVICE=ON -DCMAKE_INSTALL_PREFIX="/Library/Application Support/Mach1"
sudo mkdir -p /Library/Application\ Support/Mach1
sudo cp m1-orientationmanager/Resources/settings.json /Library/Application\ Support/Mach1/settings.json
else ifeq ($(detected_OS),Windows)
cmake m1-orientationmanager -Bm1-orientationmanager/build-dev -DENABLE_DEBUG_EMULATOR_DEVICE=ON -DCMAKE_INSTALL_PREFIX="\Documents and Settings\All Users\Application Data\Mach1"
else
cmake m1-orientationmanager -Bm1-orientationmanager/build-dev -DENABLE_DEBUG_EMULATOR_DEVICE=ON -DCMAKE_INSTALL_PREFIX="/opt/Mach1"
endif
dev-oscclient:
ifeq ($(detected_OS),Darwin)
cmake m1-orientationmanager/osc_client -Bm1-orientationmanager/osc_client/build-dev -G "Xcode"
else
cmake m1-orientationmanager/osc_client -Bm1-orientationmanager/osc_client/build-dev
endif
dev-system-helper:
ifeq ($(detected_OS),Darwin)
cmake services/m1-system-helper -Bservices/m1-system-helper/build-dev -G "Xcode" -DCMAKE_INSTALL_PREFIX="/Library/Application Support/Mach1"
sudo mkdir -p /Library/Application\ Support/Mach1
sudo cp m1-orientationmanager/Resources/settings.json /Library/Application\ Support/Mach1/settings.json
else ifeq ($(detected_OS),Windows)
cmake services/m1-system-helper -Bservices/m1-system-helper/build-dev -DCMAKE_INSTALL_PREFIX="\Documents and Settings\All Users\Application Data\Mach1"
else
cmake services/m1-system-helper -Bservices/m1-system-helper/build-dev -DCMAKE_INSTALL_PREFIX="/opt/Mach1"
endif
dev-transcoder:
ifeq ($(detected_OS),Windows)
cd m1-transcoder && scripts\setup.sh && npm install
else
cd m1-transcoder && ./scripts/setup.sh && npm install
endif
dev-transcoder-plugin:
ifeq ($(detected_OS),Darwin)
cmake m1-transcoder/juce_plugin -Bm1-transcoder/juce_plugin/build-dev -G "Xcode" -DJUCE_COPY_PLUGIN_AFTER_BUILD=ON -DBUILD_VST3=ON -DBUILD_AAX=ON -DBUILD_AU=ON -DBUILD_VST=ON -DVST2_PATH=$(VST2_PATH) -DBUILD_STANDALONE=ON
else
cmake m1-transcoder/juce_plugin -Bm1-transcoder/juce_plugin/build-dev -DJUCE_COPY_PLUGIN_AFTER_BUILD=ON -DBUILD_VST3=ON -DBUILD_AAX=ON -DBUILD_STANDALONE=ON
endif
overlay-debug:
cd m1-panner/Resources/overlay_debug && ./run_simulator.sh --title "Avid Video Engine"
# =============================================================================
# Release Packaging
# =============================================================================
# Full local build: configure → build → sign → notarize → installer
package: update-versions-internal build docs-build codesign notarize installer-pkg
# =============================================================================
# Hybrid CI/CD Release (Recommended)
# =============================================================================
# Downloads pre-built artifacts from CI/CD, then signs AAX locally and creates installer.
# This is the recommended workflow since AAX signing requires a physical USB iLok dongle.
#
# Usage:
# make package-from-ci VERSION=2.1 # By version tag
# make package-from-ci COMMIT=abc12345 # By commit SHA
#
# Prerequisites:
# - AWS CLI configured with access to mach1-build-artifacts bucket
# - USB iLok dongle connected for AAX signing
# - Apple Developer certificate in keychain for macOS
#
ARTIFACTS_BUCKET ?= mach1-build-artifacts
CI_ARTIFACTS_DIR ?= ci-artifacts
# Release artifact path resolution
# CI packaging preserves the native contents of each *_artefacts directory, while
# local builds may emit app/binary payloads at slightly different depths depending
# on generator and target type. Resolve the paths once so signing/notarization and
# package-from-ci can use the same locations.
MAC_PLAYER_APP_PATH := $(or $(firstword $(wildcard m1-player/build/M1-Player_artefacts/Release/M1-Player.app)),m1-player/build/M1-Player_artefacts/Release/M1-Player.app)
MAC_PLAYER_APP_DIR := $(patsubst %/,%,$(dir $(MAC_PLAYER_APP_PATH)))
MAC_ORIENTATION_BIN_PATH := $(or $(firstword $(wildcard m1-orientationmanager/build/m1-orientationmanager_artefacts/m1-orientationmanager)),m1-orientationmanager/build/m1-orientationmanager_artefacts/Release/m1-orientationmanager)
MAC_HELPER_APP_PATH := $(or $(firstword $(wildcard services/m1-system-helper/build/m1-system-helper_artefacts/m1-system-helper.app)),services/m1-system-helper/build/m1-system-helper_artefacts/Release/m1-system-helper.app)
MAC_MONITOR_ENTITLEMENTS := m1-monitor/Resources/entitlements.mac.plist
MAC_PANNER_ENTITLEMENTS := m1-panner/Resources/entitlements.mac.plist
WIN_PLAYER_EXE_PATH := $(or $(firstword $(wildcard m1-player/build/M1-Player_artefacts/Release/M1-Player.exe)),m1-player/build/M1-Player_artefacts/M1-Player.exe)
WIN_ORIENTATION_EXE_PATH := $(or $(firstword $(wildcard m1-orientationmanager/build/m1-orientationmanager_artefacts/Release/m1-orientationmanager.exe)),m1-orientationmanager/build/m1-orientationmanager_artefacts/m1-orientationmanager.exe)
WIN_HELPER_EXE_PATH := $(or $(firstword $(wildcard services/m1-system-helper/build/m1-system-helper_artefacts/Release/m1-system-helper.exe)),services/m1-system-helper/build/m1-system-helper_artefacts/m1-system-helper.exe)
package-from-ci: download-ci-artifacts sign-aax-local installer-pkg-from-ci
@echo ""
@echo "========================================"
@echo "Release Complete!"
@echo "========================================"
ifeq ($(detected_OS),Darwin)
@echo ""
@echo "macOS installers ready:"
@ls -la installer/osx/build/signed/*.pkg
endif
@echo ""
download-ci-artifacts: clean-ci-artifacts
@echo "========================================"
@echo "Downloading CI Build Artifacts"
@echo "========================================"
ifeq ($(detected_OS),Darwin)
@if [ -z "$(VERSION)" ] && [ -z "$(COMMIT)" ]; then \
echo "ERROR: Specify VERSION or COMMIT"; \
echo " make package-from-ci VERSION=2.1"; \
echo " make package-from-ci COMMIT=abc12345"; \
exit 1; \
fi
@mkdir -p $(CI_ARTIFACTS_DIR)
@# Download BOTH macOS architectures
@if [ -n "$(VERSION)" ]; then \
echo "Downloading version $(VERSION) artifacts (both architectures)..."; \
echo ""; \
echo "Downloading ARM64 (Apple Silicon) builds..."; \
aws s3 cp "s3://$(ARTIFACTS_BUCKET)/builds/$(VERSION)/macos-arm64-builds.tar.gz" \
"$(CI_ARTIFACTS_DIR)/macos-arm64-builds.tar.gz" --region us-east-1 || \
(echo "ERROR: ARM64 artifacts not found for version $(VERSION)" && exit 1); \
echo ""; \
echo "Downloading x86_64 (Intel) builds..."; \
aws s3 cp "s3://$(ARTIFACTS_BUCKET)/builds/$(VERSION)/macos-x86-builds.tar.gz" \
"$(CI_ARTIFACTS_DIR)/macos-x86-builds.tar.gz" --region us-east-1 || \
(echo "ERROR: x86_64 artifacts not found for version $(VERSION)" && exit 1); \
elif [ -n "$(COMMIT)" ]; then \
echo "Downloading commit $(COMMIT) artifacts (both architectures)..."; \
echo ""; \
echo "Downloading ARM64 (Apple Silicon) builds..."; \
aws s3 cp "s3://$(ARTIFACTS_BUCKET)/commits/$(COMMIT)/macos-arm64-builds.tar.gz" \
"$(CI_ARTIFACTS_DIR)/macos-arm64-builds.tar.gz" --region us-east-1 || \
(echo "ERROR: ARM64 artifacts not found for commit $(COMMIT)" && exit 1); \
echo ""; \
echo "Downloading x86_64 (Intel) builds..."; \
aws s3 cp "s3://$(ARTIFACTS_BUCKET)/commits/$(COMMIT)/macos-x86-builds.tar.gz" \
"$(CI_ARTIFACTS_DIR)/macos-x86-builds.tar.gz" --region us-east-1 || \
(echo "ERROR: x86_64 artifacts not found for commit $(COMMIT)" && exit 1); \
fi
@echo ""
@echo "Extracting artifacts..."
@cd $(CI_ARTIFACTS_DIR) && tar -xzf macos-arm64-builds.tar.gz
@cd $(CI_ARTIFACTS_DIR) && tar -xzf macos-x86-builds.tar.gz
@echo ""
@echo "Both architectures downloaded:"
@echo " - $(CI_ARTIFACTS_DIR)/macos-arm64/"
@echo " - $(CI_ARTIFACTS_DIR)/macos-x86/"
else ifeq ($(detected_OS),Windows)
@echo "Downloading Windows artifacts..."
@if not defined VERSION if not defined COMMIT ( \
echo ERROR: Specify VERSION or COMMIT && \
echo make package-from-ci VERSION=2.1 && \
echo make package-from-ci COMMIT=abc12345 && \
exit 1 \
)
@if not exist $(CI_ARTIFACTS_DIR) mkdir $(CI_ARTIFACTS_DIR)
@if defined VERSION ( \
aws s3 cp "s3://$(ARTIFACTS_BUCKET)/builds/$(VERSION)/windows-builds.zip" \
"$(CI_ARTIFACTS_DIR)\windows-builds.zip" --region us-east-1 \
) else ( \
aws s3 cp "s3://$(ARTIFACTS_BUCKET)/commits/$(COMMIT)/windows-builds.zip" \
"$(CI_ARTIFACTS_DIR)\windows-builds.zip" --region us-east-1 \
)
@7z x -y "$(CI_ARTIFACTS_DIR)\windows-builds.zip" -o"$(CI_ARTIFACTS_DIR)"
@echo Artifacts downloaded and extracted
endif
# Helper to install artifacts for a specific architecture
# Usage: make install-arch-artifacts ARCH=arm64
# Note: CI packages artifacts without the _artefacts suffix, but installer expects it
install-arch-artifacts:
ifeq ($(detected_OS),Darwin)
@if [ -z "$(ARCH)" ]; then \
echo "ERROR: Specify ARCH (arm64 or x86)"; \
exit 1; \
fi
@if [ "$(ARCH)" = "arm64" ]; then \
ARCH_DIR="macos-arm64"; \
else \
ARCH_DIR="macos-x86"; \
fi; \
echo "Installing $$ARCH_DIR artifacts to build directories..."; \
rm -rf m1-monitor/build m1-panner/build m1-player/build; \
rm -rf m1-orientationmanager/build services/m1-system-helper/build; \
mkdir -p m1-monitor/build/M1-Monitor_artefacts; \
mkdir -p m1-panner/build/M1-Panner_artefacts; \
mkdir -p m1-player/build/M1-Player_artefacts; \
mkdir -p m1-orientationmanager/build/m1-orientationmanager_artefacts; \
mkdir -p services/m1-system-helper/build/m1-system-helper_artefacts; \
if [ -d "$(CI_ARTIFACTS_DIR)/$$ARCH_DIR/M1-Monitor" ]; then \
ditto "$(CI_ARTIFACTS_DIR)/$$ARCH_DIR/M1-Monitor" "m1-monitor/build/M1-Monitor_artefacts"; \
fi; \
if [ -d "$(CI_ARTIFACTS_DIR)/$$ARCH_DIR/M1-Panner" ]; then \
ditto "$(CI_ARTIFACTS_DIR)/$$ARCH_DIR/M1-Panner" "m1-panner/build/M1-Panner_artefacts"; \
fi; \
if [ -d "$(CI_ARTIFACTS_DIR)/$$ARCH_DIR/M1-Player" ]; then \
ditto "$(CI_ARTIFACTS_DIR)/$$ARCH_DIR/M1-Player" "m1-player/build/M1-Player_artefacts"; \
fi; \
if [ -d "$(CI_ARTIFACTS_DIR)/$$ARCH_DIR/m1-orientationmanager" ]; then \
ditto "$(CI_ARTIFACTS_DIR)/$$ARCH_DIR/m1-orientationmanager" "m1-orientationmanager/build/m1-orientationmanager_artefacts"; \
fi; \
if [ -d "$(CI_ARTIFACTS_DIR)/$$ARCH_DIR/m1-system-helper" ]; then \
ditto "$(CI_ARTIFACTS_DIR)/$$ARCH_DIR/m1-system-helper" "services/m1-system-helper/build/m1-system-helper_artefacts"; \
fi; \
if [ -d "$(MAC_PLAYER_APP_PATH)" ]; then \
codesign --verify --deep --strict --verbose=2 "$(MAC_PLAYER_APP_PATH)"; \
fi; \
echo "Artifacts installed for $$ARCH_DIR"
endif
sign-aax-local:
@echo ""
@echo "========================================"
@echo "Signing AAX Plugins (USB iLok Required)"
@echo "========================================"
ifeq ($(detected_OS),Darwin)
@echo "Ensure your USB iLok dongle is connected..."
@echo ""
@if [ -d "m1-monitor/build/M1-Monitor_artefacts/AAX" ] || [ -d "m1-monitor/build/AAX" ]; then \
echo "Signing M1-Monitor AAX..."; \
AAX_PATH=$$(find m1-monitor/build -name "M1-Monitor.aaxplugin" -type d | head -1); \
if [ -n "$$AAX_PATH" ]; then \
codesign --force --sign $(APPLE_CODESIGN_CODE) --entitlements $(MAC_MONITOR_ENTITLEMENTS) --timestamp "$$AAX_PATH"; \
$(WRAPTOOL) sign --verbose --account $(PACE_ACCOUNT) --wcguid "$(MONITOR_FREE_GUID)" \
--signid $(APPLE_CODESIGN_ID) --in "$$AAX_PATH" --out "$$AAX_PATH" --autoinstall on; \
echo "M1-Monitor AAX signed"; \
else \
echo "M1-Monitor.aaxplugin not found"; \
fi; \
fi
@if [ -d "m1-panner/build/M1-Panner_artefacts/AAX" ] || [ -d "m1-panner/build/AAX" ]; then \
echo "Signing M1-Panner AAX..."; \
AAX_PATH=$$(find m1-panner/build -name "M1-Panner.aaxplugin" -type d | head -1); \
if [ -n "$$AAX_PATH" ]; then \
codesign --force --sign $(APPLE_CODESIGN_CODE) --entitlements $(MAC_PANNER_ENTITLEMENTS) --timestamp "$$AAX_PATH"; \
$(WRAPTOOL) sign --verbose --account $(PACE_ACCOUNT) --wcguid "$(PANNER_FREE_GUID)" \
--signid $(APPLE_CODESIGN_ID) --in "$$AAX_PATH" --out "$$AAX_PATH" --autoinstall on; \
echo "M1-Panner AAX signed"; \
else \
echo "M1-Panner.aaxplugin not found"; \
fi; \
fi
@echo ""
@echo "AAX signing complete!"
else ifeq ($(detected_OS),Windows)
@echo "Signing AAX plugins on Windows..."
@echo "Ensure iLok License Manager is running..."
@if exist "m1-monitor\build\M1-Monitor_artefacts\Release\AAX\M1-Monitor.aaxplugin" ( \
set SIGNTOOL_PATH=$(WIN_SIGNTOOL_PATH) && \
set ACS_DLIB=$(AZURE_DLIB_PATH) && \
set ACS_JSON=$(AZURE_METADATA_PATH) && \
set AZURE_TENANT_ID=$(AZURE_TENANT_ID) && \
set AZURE_CLIENT_ID=$(AZURE_CLIENT_ID) && \
set AZURE_SECRET_ID=$(AZURE_CLIENT_SECRET) && \
$(WRAPTOOL) sign --signtool "$(CURDIR)/installer/win/aax-signtool.bat" --signid 1 --verbose \
--installedbinaries --account $(PACE_ACCOUNT) --wcguid "$(MONITOR_FREE_GUID)" \
--in m1-monitor\build\M1-Monitor_artefacts\Release\AAX\M1-Monitor.aaxplugin \
--out m1-monitor\build\M1-Monitor_artefacts\Release\AAX\M1-Monitor.aaxplugin \
)
@if exist "m1-panner\build\M1-Panner_artefacts\Release\AAX\M1-Panner.aaxplugin" ( \
set SIGNTOOL_PATH=$(WIN_SIGNTOOL_PATH) && \
set ACS_DLIB=$(AZURE_DLIB_PATH) && \
set ACS_JSON=$(AZURE_METADATA_PATH) && \
set AZURE_TENANT_ID=$(AZURE_TENANT_ID) && \
set AZURE_CLIENT_ID=$(AZURE_CLIENT_ID) && \
set AZURE_SECRET_ID=$(AZURE_CLIENT_SECRET) && \
$(WRAPTOOL) sign --signtool "$(CURDIR)/installer/win/aax-signtool.bat" --signid 1 --verbose \
--installedbinaries --account $(PACE_ACCOUNT) --wcguid "$(PANNER_FREE_GUID)" \
--in m1-panner\build\M1-Panner_artefacts\Release\AAX\M1-Panner.aaxplugin \
--out m1-panner\build\M1-Panner_artefacts\Release\AAX\M1-Panner.aaxplugin \
)
endif
installer-pkg-from-ci: sign-aax-local
@echo ""
@echo "========================================"
@echo "Creating Installer Packages"
@echo "========================================"
ifeq ($(detected_OS),Darwin)
@echo "Building installers for BOTH macOS architectures..."
@echo ""
@# === ARM64 (Apple Silicon) ===
@echo "========================================"
@echo "Building ARM64 (Apple Silicon) Installer"
@echo "========================================"
@$(MAKE) install-arch-artifacts ARCH=arm64
@$(MAKE) sign-aax-local
@echo "Building installer package..."
packagesbuild -v installer/osx/Mach1\ Spatial\ System\ Installer.pkgproj
codesign --force --sign $(APPLE_CODESIGN_CODE) --timestamp installer/osx/build/Mach1\ Spatial\ System\ Installer.pkg
mkdir -p installer/osx/build/signed
productsign --sign $(APPLE_CODESIGN_INSTALLER_ID) \
"installer/osx/build/Mach1 Spatial System Installer.pkg" \
"installer/osx/build/signed/Mach1 Spatial System Installer.pkg"
@echo "Notarizing ARM64 installer..."
@NOTARY_JSON=$$(mktemp); \
if ! xcrun notarytool submit --wait --output-format json --keychain-profile 'notarize-app' \
--apple-id $(APPLE_USERNAME) --password $(ALTOOL_APPPASS) --team-id $(APPLE_TEAM_CODE) \
"installer/osx/build/signed/Mach1 Spatial System Installer.pkg" > "$$NOTARY_JSON" 2>&1; then \
cat "$$NOTARY_JSON"; \
rm -f "$$NOTARY_JSON"; \
echo "Notarization did not complete successfully; skipping stapling."; \
exit 1; \
fi; \
cat "$$NOTARY_JSON"; \
NOTARY_STATUS=$$(/usr/bin/python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["status"])' "$$NOTARY_JSON"); \
rm -f "$$NOTARY_JSON"; \
if [ "$$NOTARY_STATUS" != "Accepted" ]; then \
echo "Notarization status was $$NOTARY_STATUS; skipping stapling."; \
exit 1; \
fi; \
xcrun stapler staple "installer/osx/build/signed/Mach1 Spatial System Installer.pkg"
@# Rename to include architecture
mv "installer/osx/build/signed/Mach1 Spatial System Installer.pkg" \
"installer/osx/build/signed/Mach1 Spatial System Installer-arm64.pkg"
@echo "ARM64 installer complete!"
@echo ""
@# === x86_64 (Intel) ===
@echo "========================================"
@echo "Building x86_64 (Intel) Installer"
@echo "========================================"
@rm -rf installer/osx/build/Mach1\ Spatial\ System\ Installer.pkg
@$(MAKE) install-arch-artifacts ARCH=x86
@$(MAKE) sign-aax-local
@echo "Building installer package..."
packagesbuild -v installer/osx/Mach1\ Spatial\ System\ Installer.pkgproj
codesign --force --sign $(APPLE_CODESIGN_CODE) --timestamp installer/osx/build/Mach1\ Spatial\ System\ Installer.pkg
productsign --sign $(APPLE_CODESIGN_INSTALLER_ID) \
"installer/osx/build/Mach1 Spatial System Installer.pkg" \
"installer/osx/build/signed/Mach1 Spatial System Installer.pkg"
@echo "Notarizing x86_64 installer..."
@NOTARY_JSON=$$(mktemp); \
if ! xcrun notarytool submit --wait --output-format json --keychain-profile 'notarize-app' \
--apple-id $(APPLE_USERNAME) --password $(ALTOOL_APPPASS) --team-id $(APPLE_TEAM_CODE) \
"installer/osx/build/signed/Mach1 Spatial System Installer.pkg" > "$$NOTARY_JSON" 2>&1; then \
cat "$$NOTARY_JSON"; \
rm -f "$$NOTARY_JSON"; \
echo "Notarization did not complete successfully; skipping stapling."; \
exit 1; \
fi; \
cat "$$NOTARY_JSON"; \
NOTARY_STATUS=$$(/usr/bin/python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["status"])' "$$NOTARY_JSON"); \
rm -f "$$NOTARY_JSON"; \
if [ "$$NOTARY_STATUS" != "Accepted" ]; then \
echo "Notarization status was $$NOTARY_STATUS; skipping stapling."; \
exit 1; \
fi; \
xcrun stapler staple "installer/osx/build/signed/Mach1 Spatial System Installer.pkg"
@# Rename to include architecture
mv "installer/osx/build/signed/Mach1 Spatial System Installer.pkg" \
"installer/osx/build/signed/Mach1 Spatial System Installer-x86_64.pkg"
@echo "x86_64 installer complete!"
@echo ""
@echo "========================================"
@echo "Both installers created:"
@echo " - installer/osx/build/signed/Mach1 Spatial System Installer-arm64.pkg"
@echo " - installer/osx/build/signed/Mach1 Spatial System Installer-x86_64.pkg"
@echo "========================================"
else ifeq ($(detected_OS),Windows)
@echo "Building Windows installer..."
$(WIN_INNO_PATH) "${CURDIR}/installer/win/installer.iss"
@echo "Signing installer..."
powershell -ExecutionPolicy Bypass -File installer\win\sign-file.ps1 \
-FilePath "installer\win\Output\Mach1 Spatial System Installer.exe"
@echo "Installer created at: installer\win\Output\Mach1 Spatial System Installer.exe"
endif
# List available CI builds
list-ci-builds:
@echo "Available builds in S3:"
@echo ""
@echo "By Version:"
@aws s3 ls "s3://$(ARTIFACTS_BUCKET)/builds/" --region us-east-1 2>/dev/null || echo " (none or access denied)"
@echo ""
@echo "By Commit (recent):"
@aws s3 ls "s3://$(ARTIFACTS_BUCKET)/commits/" --region us-east-1 2>/dev/null | tail -10 || echo " (none or access denied)"
# Clean CI artifacts
clean-ci-artifacts:
@echo "Cleaning CI artifacts..."
ifeq ($(detected_OS),Windows)
@if exist "$(CI_ARTIFACTS_DIR)" rmdir /s /q "$(CI_ARTIFACTS_DIR)"
else
rm -rf "$(CI_ARTIFACTS_DIR)"
endif
@echo "CI artifacts cleaned"
# =============================================================================
# CI/CD Testing (Local Simulation)
# =============================================================================
# Simulates what CI/CD does, but runs locally. Useful for testing before push.
#
# Usage:
# make test-ci-build - Simulate full CI build
# make test-ci-build-player-only - Just build m1-player (fastest test)
#
test-ci-build:
@echo "========================================"
@echo "Simulating CI/CD Build Locally"
@echo "========================================"
@echo ""
@echo "This simulates what GitHub Actions does:"
@echo " 1. Clean build"
@echo " 2. Configure all projects"
@echo " 3. Build all projects"
@echo " 4. Sign non-AAX plugins"
@echo " 5. Package artifacts"
@echo ""
@echo "Press Ctrl+C to cancel, or wait 5 seconds..."
ifeq ($(detected_OS),Windows)
@powershell -NoProfile -Command "Start-Sleep -Seconds 5"
else
@sleep 5
endif
@echo ""
$(MAKE) clean
$(MAKE) configure
$(MAKE) build
$(MAKE) codesign-vst3 || true
$(MAKE) codesign-au || true
$(MAKE) codesign-apps || true
@echo ""
@echo "========================================"
@echo "CI Build Simulation Complete!"
@echo "========================================"
@echo ""
@echo "Next steps to test full release flow:"
@echo " 1. Connect USB iLok"
@echo " 2. Run: make sign-aax-local"
@echo " 3. Run: make installer-pkg"
test-ci-build-player-only:
@echo "========================================"
@echo "Testing m1-player Build (CI Simulation)"
@echo "========================================"
@echo ""
@echo "This tests the VLC build + m1-player compilation"
@echo "which is the most complex part of CI/CD."
@echo ""
ifeq ($(detected_OS),Darwin)
rm -rf m1-player/build-test
cmake m1-player -Bm1-player/build-test -G "Xcode" \
-DLIBVLC_BUILD_FROM_SOURCE=ON -DLIBVLC_STATIC=OFF || true
@if [ ! -f "m1-player/build-test/vlc-install/lib/libvlc.dylib" ]; then \
echo "Building VLC from source..."; \
cd m1-player && ./build_vlc.sh build-test && cd ..; \
cmake m1-player -Bm1-player/build-test -G "Xcode" \
-DLIBVLC_BUILD_FROM_SOURCE=ON -DLIBVLC_STATIC=OFF; \
fi
cmake --build m1-player/build-test --config Release
@echo ""
@echo "m1-player build test complete!"
@echo " Output: m1-player/build-test/M1-Player_artefacts/"
else
@echo "This test is currently macOS-only"
endif
# Validate workflow YAML syntax
test-ci-yaml:
@echo "Validating GitHub Actions workflow syntax..."
@if command -v actionlint >/dev/null 2>&1; then \
actionlint .github/workflows/*.yml; \
echo "Workflow YAML is valid"; \
elif command -v act >/dev/null 2>&1; then \
act -l > /dev/null 2>&1 && echo "Workflow YAML is valid (act)"; \
else \
echo "Install actionlint or act for YAML validation:"; \
echo " brew install actionlint"; \
echo " brew install act"; \
fi
# clean and configure for release
configure: clean update-versions-internal
cmake m1-monitor -Bm1-monitor/build -DBUILD_VST3=ON -DBUILD_AAX=ON -DBUILD_AU=ON -DBUILD_VST=ON -DVST2_PATH=$(VST2_PATH) -DJUCE_COPY_PLUGIN_AFTER_BUILD=OFF
cmake m1-panner -Bm1-panner/build -DBUILD_VST3=ON -DBUILD_AAX=ON -DBUILD_AU=ON -DBUILD_VST=ON -DVST2_PATH=$(VST2_PATH) -DJUCE_COPY_PLUGIN_AFTER_BUILD=OFF
ifeq ($(detected_OS),Darwin)
@echo "Configuring m1-player (release)..."
cmake m1-player -Bm1-player/build -G "Xcode" -DLIBVLC_BUILD_FROM_SOURCE=ON -DLIBVLC_STATIC=OFF || true
@if [ ! -f "m1-player/build/vlc-install/lib/libvlc.dylib" ]; then \
echo ""; \
echo "VLC libraries not found. Building VLC from source..."; \
echo "This will take 20-40 minutes..."; \
echo ""; \
cd m1-player && ./build_vlc.sh build && \
echo "" && \
echo "VLC build complete! Reconfiguring CMake..." && \
echo "" && \
cd .. && cmake m1-player -Bm1-player/build -G "Xcode" -DLIBVLC_BUILD_FROM_SOURCE=ON -DLIBVLC_STATIC=OFF; \
fi
else ifeq ($(detected_OS),Windows)
@echo "Configuring m1-player (release)..."
-cmake m1-player -Bm1-player/build -DLIBVLC_BUILD_FROM_SOURCE=ON -DLIBVLC_STATIC=OFF
@if not exist "m1-player\build\vlc-install\lib\libvlc.lib" ( \
echo. & \
echo VLC libraries not found. Run build_vlc.ps1 to download VLC SDK... & \
echo. & \
powershell -ExecutionPolicy Bypass -File m1-player\build_vlc.ps1 -BuildDir build & \
echo. & \
echo VLC setup complete! Reconfiguring CMake... & \
echo. & \
cmake m1-player -Bm1-player/build -DLIBVLC_BUILD_FROM_SOURCE=ON -DLIBVLC_STATIC=OFF \
)
else
@echo "Configuring m1-player (release)..."
cmake m1-player -Bm1-player/build -DLIBVLC_BUILD_FROM_SOURCE=ON -DLIBVLC_STATIC=OFF || true
@if [ ! -f "m1-player/build/vlc-install/lib/libvlc.lib" ] && [ ! -f "m1-player/build/vlc-install/lib/libvlc.dll.a" ]; then \
echo ""; \
echo "VLC libraries not found. Building VLC from source..."; \
echo "This will take 20-40 minutes..."; \
echo ""; \
cd m1-player && ./build_vlc.sh build && \
echo "" && \
echo "VLC build complete! Reconfiguring CMake..." && \
echo "" && \
cd .. && cmake m1-player -Bm1-player/build -DLIBVLC_BUILD_FROM_SOURCE=ON -DLIBVLC_STATIC=OFF; \
fi
endif
cmake m1-orientationmanager -Bm1-orientationmanager/build
cmake services/m1-system-helper -Bservices/m1-system-helper/build
ifeq ($(detected_OS),Darwin)
cd m1-transcoder && ./scripts/setup.sh && npm install
else ifeq ($(detected_OS),Windows)
cd m1-transcoder && npm install
endif
# Build targets for individual components
build-monitor:
cmake --build m1-monitor/build --config "Release"