C++ ports of the Kotlin effects, checked against audio the Kotlin code renders (25 scenarios, IosGoldenExport); an Objective-C++ AUv3 wrapper checked on the Mac against the core (parameters, presets, saved state); a container app that checks each plugin on the device. Built as a TrollStore .ipa. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
134 lines
6.9 KiB
Makefile
134 lines
6.9 KiB
Makefile
# Sizzle for iOS/iPadOS — build entrypoint (separate from the Android Makefile).
|
|
#
|
|
# app/ the Sizzle app (cc.tiredsysadmin.ios.sizzle): Sizzle's devices as AUv3
|
|
# plugins for hosts like AUM, installed with TrollStore. iOS/iPadOS 15+.
|
|
# core/ the C++ DSP core those plugins run: a port of the Android app's Kotlin
|
|
# DSP, checked sample by sample against audio the Kotlin code renders.
|
|
# spike/ the TrollStore AUv3 feasibility spike (kept for reference).
|
|
#
|
|
# make help what each target does
|
|
# make golden export DeviceSpecs.gen.hpp + Kotlin reference audio (needs the
|
|
# Android toolchain; runs IosGoldenExport in ../app)
|
|
# make core-test build the C++ core and compare it with the reference audio
|
|
# (TYPES="FILTER EQ10" limits it to some devices)
|
|
# make au-test macOS check of the AUv3 wrapper: every effect through AVAudioEngine
|
|
# must match the core, plus parameters, presets and saved state
|
|
# make project generate app/Sizzle.xcodeproj (components + XcodeGen)
|
|
# make ipa unsigned device build, ad-hoc signed with entitlements, packed as
|
|
# dist/cc.tiredsysadmin.ios.sizzle_<versionCode>.ipa for TrollStore
|
|
# make bump-minor new feature -> x.(y+1).0, versionCode +1 (also bump-patch/-major)
|
|
# make spike-ipa the spike's .ipa (dist/cc.tiredsysadmin.ios.sizzlespike_<build>.ipa)
|
|
# make clean remove build/ and dist/
|
|
#
|
|
# Needs Xcode and XcodeGen (brew install xcodegen). Builds stay local (CLAUDE.md).
|
|
|
|
SHELL := /bin/sh
|
|
VERSIONS := ../versions.properties
|
|
VERSION := $(shell sed -n 's/^ios.versionName[[:space:]]*=[[:space:]]*//p' $(VERSIONS) | tr -d ' ')
|
|
BUILD_NO := $(shell sed -n 's/^ios.versionCode[[:space:]]*=[[:space:]]*//p' $(VERSIONS) | tr -d ' ')
|
|
|
|
APP_ID := cc.tiredsysadmin.ios.sizzle
|
|
PROJECT := app/Sizzle.xcodeproj
|
|
APP_SRC := $(shell find app core/src core/include -type f -not -path '*.xcodeproj/*')
|
|
DEV_APP := build/dev/Build/Products/Release-iphoneos/Sizzle.app
|
|
IPA := dist/$(APP_ID)_$(BUILD_NO).ipa
|
|
|
|
# C++ DSP core: reference audio lives in core/golden/ (regenerated, not committed).
|
|
CORE_SRC := $(wildcard core/src/*.cpp core/src/fx/*.cpp)
|
|
CORE_HDR := $(wildcard core/include/sizzle/*.hpp core/src/fx/*.hpp)
|
|
CXX ?= c++
|
|
CXXFLAGS := -std=c++17 -O2 -Wall -Wextra -Icore/include -Icore/src/fx
|
|
GOLDEN := core/golden
|
|
SPECS_GEN := core/include/sizzle/DeviceSpecs.gen.hpp
|
|
# Gradle needs the Android SDK; same default location as the Android Makefile.
|
|
ANDROID_SDK ?= $(or $(ANDROID_HOME),$(HOME)/Library/Android/sdk)
|
|
|
|
SPIKE_PROJ := spike/SizzleSpike.xcodeproj
|
|
SPIKE_SRC := $(shell find spike -type f -not -path '*.xcodeproj/*')
|
|
SPIKE_NO := $(shell sed -n 's/^ *CURRENT_PROJECT_VERSION: *"\(.*\)"/\1/p' spike/project.yml)
|
|
SPIKE_IPA := dist/cc.tiredsysadmin.ios.sizzlespike_$(SPIKE_NO).ipa
|
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
help:
|
|
@sed -n 's/^# //p' Makefile
|
|
@echo ""
|
|
@echo "current: $(APP_ID) $(VERSION) (build $(BUILD_NO))"
|
|
|
|
# ------------------------------------------------------------------ core
|
|
golden:
|
|
cd .. && ANDROID_HOME=$(ANDROID_SDK) SIZZLE_GOLDEN_DIR=$(CURDIR)/$(GOLDEN) \
|
|
SIZZLE_SPECS_OUT=$(CURDIR)/$(SPECS_GEN) \
|
|
./gradlew -q :app:testDebugUnitTest --tests '*IosGoldenExport*' --rerun
|
|
@ls $(GOLDEN)/*.scn | wc -l | xargs echo "reference scenarios:"
|
|
|
|
build/core/golden_test: $(CORE_SRC) $(CORE_HDR) core/tests/golden_test.cpp
|
|
mkdir -p build/core
|
|
$(CXX) $(CXXFLAGS) -o $@ $(CORE_SRC) core/tests/golden_test.cpp
|
|
|
|
core-test: build/core/golden_test
|
|
@test -f $(GOLDEN)/input.f32 || $(MAKE) --no-print-directory golden
|
|
build/core/golden_test $(GOLDEN) $(TYPES)
|
|
|
|
# ------------------------------------------------------------------ app
|
|
build/core/au_test: app/FX/SizzleEffectAU.mm app/FX/SizzleEffectAU.h app/FX/Components.gen.h app/tests/au_test.mm $(CORE_SRC) $(CORE_HDR)
|
|
mkdir -p build/core
|
|
$(CXX) $(CXXFLAGS) -Wno-deprecated-declarations -fobjc-arc -Iapp/FX -o $@ app/FX/SizzleEffectAU.mm app/tests/au_test.mm $(CORE_SRC) \
|
|
-framework AVFoundation -framework AudioToolbox -framework Foundation
|
|
|
|
au-test: build/core/au_test
|
|
@test -f $(GOLDEN)/input.f32 || $(MAKE) --no-print-directory golden
|
|
build/core/au_test $(GOLDEN)/input.f32
|
|
|
|
app/FX/Info.plist app/FX/Components.gen.h: app/components.txt tools/gen_components.py
|
|
python3 tools/gen_components.py app/components.txt app/FX/Info.plist app/FX/Components.gen.h
|
|
|
|
project: $(PROJECT)/project.pbxproj
|
|
$(PROJECT)/project.pbxproj: app/project.yml app/FX/Info.plist
|
|
cd app && xcodegen generate --spec project.yml --quiet
|
|
|
|
# Device: build without signing, then ad-hoc sign inside-out (extension first) with
|
|
# each target's entitlements. TrollStore re-signs at install and keeps them.
|
|
ipa: $(IPA)
|
|
$(IPA): $(PROJECT)/project.pbxproj $(APP_SRC) $(VERSIONS)
|
|
xcodebuild -quiet -project $(PROJECT) -scheme Sizzle -configuration Release \
|
|
-sdk iphoneos -derivedDataPath build/dev CODE_SIGNING_ALLOWED=NO \
|
|
MARKETING_VERSION=$(VERSION) CURRENT_PROJECT_VERSION=$(BUILD_NO) build
|
|
rm -rf build/Payload && mkdir -p build/Payload dist
|
|
cp -R $(DEV_APP) build/Payload/
|
|
codesign -f -s - --entitlements app/FX/FX.entitlements build/Payload/Sizzle.app/PlugIns/SizzleFX.appex
|
|
codesign -f -s - --entitlements app/Host/Host.entitlements build/Payload/Sizzle.app
|
|
rm -f $@ && cd build && zip -qr ../$@ Payload
|
|
@echo "wrote $@"
|
|
|
|
# ------------------------------------------------------------------ versions
|
|
bump-major: ; @$(MAKE) --no-print-directory bump FIELD=1
|
|
bump-minor: ; @$(MAKE) --no-print-directory bump FIELD=2
|
|
bump-patch: ; @$(MAKE) --no-print-directory bump FIELD=3
|
|
bump:
|
|
@new=$$(echo $(VERSION) | awk -F. -v f=$(FIELD) '{ if (f==1) {$$1++; $$2=0; $$3=0} else if (f==2) {$$2++; $$3=0} else {$$3++} print $$1"."$$2"."$$3 }'); \
|
|
code=$$(( $(BUILD_NO) + 1 )); \
|
|
sed -i '' -e "s/^ios.versionName .*/ios.versionName = $$new/" -e "s/^ios.versionCode .*/ios.versionCode = $$code/" $(VERSIONS); \
|
|
echo "ios $$new (build $$code)"
|
|
|
|
# ------------------------------------------------------------------ spike
|
|
$(SPIKE_PROJ)/project.pbxproj: spike/project.yml
|
|
cd spike && xcodegen generate --spec project.yml --quiet
|
|
|
|
spike-ipa: $(SPIKE_IPA)
|
|
$(SPIKE_IPA): $(SPIKE_PROJ)/project.pbxproj $(SPIKE_SRC)
|
|
xcodebuild -quiet -project $(SPIKE_PROJ) -scheme SizzleSpike -configuration Release \
|
|
-sdk iphoneos -derivedDataPath build/spike CODE_SIGNING_ALLOWED=NO build
|
|
rm -rf build/SpikePayload && mkdir -p build/SpikePayload/Payload dist
|
|
cp -R build/spike/Build/Products/Release-iphoneos/SizzleSpike.app build/SpikePayload/Payload/
|
|
codesign -f -s - --entitlements spike/AU/AU.entitlements \
|
|
build/SpikePayload/Payload/SizzleSpike.app/PlugIns/SizzleSpikeAU.appex
|
|
codesign -f -s - --entitlements spike/App/App.entitlements build/SpikePayload/Payload/SizzleSpike.app
|
|
rm -f $@ && cd build/SpikePayload && zip -qr ../../$@ Payload
|
|
@echo "wrote $@"
|
|
|
|
clean:
|
|
rm -rf build dist
|
|
|
|
.PHONY: help golden core-test au-test project ipa bump-major bump-minor bump-patch bump spike-ipa clean
|