1- .PHONY : 3rdparty audiofile libgcrypt clean-3rdparty
1+ .PHONY : 3rdparty audiofile libgcrypt FuseGenerator FuseImporter mbedtls clean-3rdparty list-teams fusex archive dist dmg clean
22
3- 3rdparty : audiofile libgcrypt
3+ # Signing parameters (can be overridden from command line)
4+ # Example: make 3rdparty DEVELOPMENT_TEAM="ABC123DEFG" CODE_SIGN_IDENTITY="Apple Development"
5+ DEVELOPMENT_TEAM ?=
6+ CODE_SIGN_IDENTITY ?=
7+ CODE_SIGN_STYLE ?= Automatic
8+ PROVISIONING_PROFILE_SPECIFIER ?=
9+
10+ # Archive path (can be overridden from command line)
11+ # Example: make archive ARCHIVE_PATH=./build/FuseX.xcarchive
12+ ARCHIVE_PATH ?= ./build/FuseX.xcarchive
13+
14+ # Automatically set CODE_SIGN_STYLE=Manual if Developer ID identity is specified
15+ ifneq ($(CODE_SIGN_IDENTITY ) ,)
16+ ifeq ($(findstring Developer ID,$(CODE_SIGN_IDENTITY ) ) ,Developer ID)
17+ CODE_SIGN_STYLE := Manual
18+ endif
19+ endif
20+
21+ # Build common xcodebuild arguments for signing
22+ XCODEBUILD_SIGN_ARGS :=
23+ ifneq ($(DEVELOPMENT_TEAM ) ,)
24+ XCODEBUILD_SIGN_ARGS += DEVELOPMENT_TEAM="$(DEVELOPMENT_TEAM)"
25+ endif
26+ ifneq ($(CODE_SIGN_IDENTITY ) ,)
27+ XCODEBUILD_SIGN_ARGS += CODE_SIGN_IDENTITY="$(CODE_SIGN_IDENTITY)"
28+ XCODEBUILD_SIGN_ARGS += CODE_SIGN_IDENTITY_ALL="$(CODE_SIGN_IDENTITY)"
29+ endif
30+ ifneq ($(CODE_SIGN_STYLE ) ,)
31+ XCODEBUILD_SIGN_ARGS += CODE_SIGN_STYLE="$(CODE_SIGN_STYLE)"
32+ endif
33+ ifneq ($(PROVISIONING_PROFILE_SPECIFIER ) ,)
34+ XCODEBUILD_SIGN_ARGS += PROVISIONING_PROFILE_SPECIFIER="$(PROVISIONING_PROFILE_SPECIFIER)"
35+ endif
36+
37+ all : 3rdparty
38+
39+ fusepb :
40+ cd fusepb && make clean && make
41+
42+ 3rdparty : audiofile libgcrypt FuseGenerator FuseImporter mbedtls
443
544audiofile :
645 @echo " Building audiofile Framework..."
@@ -10,7 +49,8 @@ audiofile:
1049 -configuration Deployment \
1150 SYMROOT=build \
1251 BUILD_DIR=build \
13- CONFIGURATION_BUILD_DIR=build/Deployment
52+ CONFIGURATION_BUILD_DIR=build/Deployment \
53+ $(XCODEBUILD_SIGN_ARGS )
1454
1555libgcrypt :
1656 @echo " Building gcrypt Framework..."
@@ -20,9 +60,134 @@ libgcrypt:
2060 -configuration Deployment \
2161 SYMROOT=build \
2262 BUILD_DIR=build \
23- CONFIGURATION_BUILD_DIR=build/Deployment
63+ CONFIGURATION_BUILD_DIR=build/Deployment \
64+ $(XCODEBUILD_SIGN_ARGS )
65+
66+ FuseGenerator :
67+ @echo " Building FuseGenerator Framework..."
68+ cd 3rdparty/FuseGenerator && \
69+ xcodebuild -project FuseGenerator.xcodeproj \
70+ -target " FuseGenerator" \
71+ -configuration Deployment \
72+ SYMROOT=build \
73+ BUILD_DIR=build \
74+ CONFIGURATION_BUILD_DIR=build/Deployment \
75+ $(XCODEBUILD_SIGN_ARGS )
76+
77+ FuseImporter :
78+ @echo " Building FuseImporter Framework..."
79+ cd 3rdparty/FuseImporter && \
80+ xcodebuild -project FuseImporter.xcodeproj \
81+ -target " FuseImporter" \
82+ -configuration Deployment \
83+ SYMROOT=build \
84+ BUILD_DIR=build \
85+ CONFIGURATION_BUILD_DIR=build/Deployment \
86+ $(XCODEBUILD_SIGN_ARGS )
87+
88+ mbedtls :
89+ @echo " Building mbedtls Framework..."
90+ cd 3rdparty/mbedtls && \
91+ xcodebuild -project mbedtls.xcodeproj \
92+ -target " mbedtls" \
93+ -configuration Deployment \
94+ SYMROOT=build \
95+ BUILD_DIR=build \
96+ CONFIGURATION_BUILD_DIR=build/Deployment \
97+ $(XCODEBUILD_SIGN_ARGS )
98+
99+ list-teams :
100+ @echo " Available code signing identities and development teams:"
101+ @echo " "
102+ @if security find-identity -v -p codesigning 2> /dev/null | grep -q " valid identities found" ; then \
103+ echo " Unique Development Team IDs:" ; \
104+ security find-identity -v -p codesigning 2> /dev/null | \
105+ grep -oE ' \([A-Z0-9]{10}\)' | \
106+ sed ' s/[()]//g' | \
107+ sort -u | \
108+ while read team; do \
109+ echo " $$ team" ; \
110+ done ; \
111+ echo " " ; \
112+ echo " Full identity list:" ; \
113+ security find-identity -v -p codesigning 2> /dev/null; \
114+ else \
115+ echo " No code signing identities found. Make sure you have certificates installed in your keychain." ; \
116+ fi
117+
118+ fusex : 3rdparty fusepb
119+ @echo " Building FuseX app..."
120+ cd fusepb && \
121+ xcodebuild -project FuseX.xcodeproj \
122+ -target FuseX \
123+ -configuration Deployment \
124+ SYMROOT=build \
125+ BUILD_DIR=build \
126+ CONFIGURATION_BUILD_DIR=build/Deployment \
127+ $(XCODEBUILD_SIGN_ARGS )
128+
129+ archive : 3rdparty fusepb
130+ @echo " Archiving FuseX app..."
131+ @mkdir -p build
132+ cd fusepb && \
133+ xcodebuild archive \
134+ -project FuseX.xcodeproj \
135+ -scheme FuseX \
136+ -configuration Deployment \
137+ -archivePath " $( CURDIR) /$( ARCHIVE_PATH) " \
138+ SYMROOT=build \
139+ BUILD_DIR=build \
140+ CONFIGURATION_BUILD_DIR=build/Deployment \
141+ $(XCODEBUILD_SIGN_ARGS )
142+ @echo " Archive created at: $( ARCHIVE_PATH) "
143+
144+ dist :
145+ @echo " Checking for dist/FuseX.app..."
146+ @if [ ! -d " dist/FuseX.app" ]; then \
147+ echo " Error: dist/FuseX.app not found. Please copy FuseX.app to dist/ first." ; \
148+ exit 1; \
149+ fi
150+ @echo " dist/FuseX.app found."
151+
152+ dmg : dist
153+ @echo " Creating FuseX.dmg..."
154+ @if ! command -v create-dmg > /dev/null 2>&1 ; then \
155+ echo " Error: create-dmg is not installed. Install it with: brew install create-dmg" ; \
156+ exit 1; \
157+ fi
158+ @rm -f FuseX.dmg
159+ @if create-dmg \
160+ --volname " FuseX" \
161+ --window-pos 200 120 \
162+ --window-size 600 300 \
163+ --icon-size 100 \
164+ --icon " FuseX.app" 175 120 \
165+ --hide-extension " FuseX.app" \
166+ --app-drop-link 425 120 \
167+ FuseX.dmg \
168+ dist/; then \
169+ if [ -f " FuseX.dmg" ]; then \
170+ echo " DMG created successfully: FuseX.dmg" ; \
171+ else \
172+ echo " Error: DMG file was not created" ; \
173+ exit 1; \
174+ fi \
175+ else \
176+ echo " Error: create-dmg failed" ; \
177+ exit 1; \
178+ fi
24179
25180clean-3rdparty :
26181 @echo " Cleaning 3rdparty build artifacts..."
27182 rm -rf 3rdparty/audiofile/build
28183 rm -rf 3rdparty/libgcrypt/build
184+ rm -rf 3rdparty/FuseGenerator/build
185+ rm -rf 3rdparty/FuseImporter/build
186+ rm -rf 3rdparty/mbedtls/build
187+
188+ clean : clean-3rdparty
189+ @echo " Cleaning FuseX build artifacts..."
190+ rm -rf fusepb/build
191+ rm -rf build
192+ rm -rf dist
193+ rm -f FuseX.dmg
0 commit comments