Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Dynamically find the current XCode and SDK #17

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
IOS_CC = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc
XCODE_PATH = $(shell xcode-select --print-path)
IOS_CC = $(XCODE_PATH)/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc
SDK_PATH = $(shell find $(XCODE_PATH)/Platforms/iPhoneOS.platform -name "iPhoneOS*sdk" | sort -rn | head -1)

all: demo.app fruitstrap

Expand All @@ -9,16 +11,17 @@ demo.app: demo Info.plist
codesign -f -s "iPhone Developer" --entitlements Entitlements.plist demo.app

demo: demo.c
$(IOS_CC) -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -framework CoreFoundation -o demo demo.c
echo $(SDK_PATH)
$(IOS_CC) -arch armv7 -isysroot $(SDK_PATH) -framework CoreFoundation -o demo demo.c

fruitstrap: fruitstrap.c
gcc -o fruitstrap -framework CoreFoundation -framework MobileDevice -F/System/Library/PrivateFrameworks fruitstrap.c

install: all
./fruitstrap demo.app
./fruitstrap -b demo.app

debug: all
./fruitstrap -d demo.app
./fruitstrap -d -b demo.app

clean:
rm -rf *.app demo fruitstrap