-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
85 lines (74 loc) · 4.79 KB
/
Copy pathMakefile
File metadata and controls
85 lines (74 loc) · 4.79 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
# Mach1 plugin build and codesign
# local paths are in this file
include ./Makefile.variables
# getting OS type
ifeq ($(OS),Windows_NT)
detected_OS := Windows
else
detected_OS := $(shell uname)
endif
# Extract VERSION - prefer VERSION file, fallback to workflow.yml
ifeq ($(detected_OS),Windows)
# Windows: read from VERSION file using PowerShell (handles newlines properly)
VERSION := $(shell powershell -NoProfile -Command "(Get-Content VERSION -Raw -ErrorAction SilentlyContinue).Trim()" 2>NUL || echo 1.1.0)
# Windows: default BUNDLE_ID (can be overridden via environment variable or Makefile.variables)
BUNDLEID := com.mach1.notepad
else
# Unix/Linux/macOS: use VERSION file if available, otherwise parse workflow.yml
VERSION := $(shell if [ -f VERSION ]; then cat VERSION | tr -d '\r\n '; else grep VERSION: .github/workflows/workflow.yml 2>/dev/null | cut -d ':' -f 2 | cut -d ' ' -f 2 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' || echo 1.1.0; fi)
BUNDLEID := $(shell grep BUNDLE_ID: .github/workflows/workflow.yml 2>/dev/null | head -n 1 | cut -d ':' -f 2 | cut -d ' ' -f 2 || echo com.mach1.notepad)
endif
clean:
ifeq ($(detected_OS),Windows)
@powershell -NoProfile -Command "if (Test-Path build) { Remove-Item -Recurse -Force build }"
else
rm -rf build
endif
setup-codesigning:
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
configure: clean
ifeq ($(detected_OS),Darwin)
cmake . -Bbuild -G "Xcode" -DJUCE_COPY_PLUGIN_AFTER_BUILD=ON
else
cmake . -Bbuild -DJUCE_COPY_PLUGIN_AFTER_BUILD=ON
endif
build: configure
cmake --build build --config "Release"
codesign:
ifeq ($(detected_OS),Darwin)
/usr/bin/codesign --timestamp --force --deep -s "Developer ID Application" build/M1-Notepad_artefacts/Release/AU/M1-Notepad.component -v
/usr/bin/codesign --timestamp --force --deep -s "Developer ID Application" build/M1-Notepad_artefacts/Release/VST3/M1-Notepad.vst3 -v
/usr/bin/codesign --timestamp --force --deep -s "Developer ID Application" build/M1-Notepad_artefacts/Release/AAX/M1-Notepad.aaxplugin -v
$(WRAPTOOL) sign --verbose --account $(PACE_ID) --wcguid $(WRAP_GUID) --signid $(APPLE_CODESIGN_ID) --in build/M1-Notepad_artefacts/Release/AAX/M1-Notepad.aaxplugin --out build/M1-Notepad_artefacts/Release/AAX/M1-Notepad.aaxplugin
else ifeq ($(detected_OS),Windows)
$(WRAPTOOL) sign --verbose --account $(PACE_ID) --wcguid "$(WRAP_GUID)" --signid $(WIN_SIGNTOOL_ID) --in build/M1-Notepad_artefacts/Release/AAX/M1-Notepad.aaxplugin --out build/M1-Notepad_artefacts/Release/AAX/M1-Notepad.aaxplugin
endif
package: get_bundle_id get_version build codesign
ifeq ($(detected_OS),Darwin)
pkgbuild --identifier $(BUNDLE_ID).au --version $(VERSION) --component build/M1-Notepad_artefacts/Release/AU/M1-Notepad.component \
--install-location "/Library/Audio/Plug-Ins/Components" build/M1-Notepad_artefacts/Release/M1-Notepad.au.pkg
pkgbuild --identifier $(BUNDLE_ID).vst3 --version $(VERSION) --component build/M1-Notepad_artefacts/Release/VST3/M1-Notepad.vst3 \
--install-location "/Library/Audio/Plug-Ins/VST3" build/M1-Notepad_artefacts/Release/M1-Notepad.vst3.pkg
pkgbuild --identifier $(BUNDLE_ID).aaxplugin --version $(VERSION) --component build/M1-Notepad_artefacts/Release/AAX/M1-Notepad.aaxplugin \
--install-location "/Library/Application Support/Avid/Audio/Plug-Ins" build/M1-Notepad_artefacts/Release/M1-Notepad.aaxplugin.pkg
productbuild --synthesize \
--package "build/M1-Notepad_artefacts/Release/M1-Notepad.au.pkg" \
--package "build/M1-Notepad_artefacts/Release/M1-Notepad.vst3.pkg" \
--package "build/M1-Notepad_artefacts/Release/M1-Notepad.aaxplugin.pkg" \
distribution.xml
productbuild --sign "Developer ID Installer" --distribution distribution.xml --package-path build/M1-Notepad_artefacts/Release build/M1-Notepad_artefacts/Release/M1-Notepad.pkg
codesign --force --sign $(APPLE_CODESIGN_CODE) --timestamp build/M1-Notepad_artefacts/Release/M1-Notepad.pkg
mkdir -p build/M1-Notepad_artefacts/Release/signed
productsign --sign $(APPLE_CODESIGN_INSTALLER_ID) "build/M1-Notepad_artefacts/Release/M1-Notepad.pkg" "build/M1-Notepad_artefacts/Release/signed/M1-Notepad.pkg"
xcrun notarytool submit --wait --keychain-profile 'notarize-app' --apple-id $(APPLE_USERNAME) --password $(ALTOOL_APPPASS) --team-id $(APPLE_TEAM_CODE) "build/M1-Notepad_artefacts/Release/signed/M1-Notepad.pkg"
xcrun stapler staple build/M1-Notepad_artefacts/Release/signed/M1-Notepad.pkg
else ifeq ($(detected_OS),Windows)
$(WIN_INNO_PATH) "-Ssigntool=$(WIN_SIGNTOOL_PATH) sign -f $(WIN_CODESIGN_CERT_PATH) -p $(WIN_SIGNTOOL_PASS) -t http://timestamp.digicert.com $$f" "${CURDIR}/Resources/InnoSetup.iss"
endif
get_bundle_id:
echo "-- Using $(BUNDLEID)"
get_version:
echo "-- Building version: $(VERSION)"