From 8fc04ad75669ab275d2eab6b43ebb5d6035fac80 Mon Sep 17 00:00:00 2001 From: snarshad Date: Mon, 4 Feb 2013 17:45:27 -0800 Subject: [PATCH 1/3] Dynamically find path to XCode, and earliest installed SDK --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bd6beb41..160a7a5f 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -9,7 +11,8 @@ 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 SDKPATH: $(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 From bd5481c926308309f6c7c2eaee94d91674cdff1f Mon Sep 17 00:00:00 2001 From: snarshad Date: Mon, 4 Feb 2013 17:55:08 -0800 Subject: [PATCH 2/3] Add -b parameter; remove an echo --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 160a7a5f..763ad263 100644 --- a/Makefile +++ b/Makefile @@ -11,17 +11,16 @@ demo.app: demo Info.plist codesign -f -s "iPhone Developer" --entitlements Entitlements.plist demo.app demo: demo.c - echo SDKPATH: $(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 \ No newline at end of file From 5b18844ef7a26684231f28bae8829094a7eae307 Mon Sep 17 00:00:00 2001 From: snarshad Date: Mon, 4 Feb 2013 18:12:52 -0800 Subject: [PATCH 3/3] Fix typo --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 763ad263..e1da3ee0 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,8 @@ demo.app: demo Info.plist codesign -f -s "iPhone Developer" --entitlements Entitlements.plist demo.app demo: demo.c - $(IOS_CC) -arch armv7 -isysroot $SDK_PATH -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