2015-07-20 09:14:53 -07:00
HEADER_PATHS := ` find ./tmp/JavaScriptCore -name '*.h' | xargs -I{ } dirname { } | uniq | xargs -I{ } echo "-I {}" `
2015-08-24 14:27:17 -07:00
SDK_VERSION = $( shell plutil -convert json -o - /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/SDKSettings.plist | awk -f parseSDKVersion.awk)
2015-07-20 09:14:53 -07:00
CERT ?= "iPhone Developer"
2015-08-24 14:27:17 -07:00
i f n e q ( $( SDK_VERSION ) , 8 )
all :
$( error " Expected to be compiled with iOS SDK version 8, found $( SDK_VERSION) " )
e n d i f
2015-07-20 09:14:53 -07:00
ios8 : prepare build generate
prepare : clean create download
build : x 86_ 64 arm 64 armv 7
generate : lipo codesign
clean :
@rm -rf tmp/ /tmp/RCTJSCProfiler
lipo :
lipo -create -output /tmp/RCTJSCProfiler/RCTJSCProfiler.ios8.dylib ./tmp/RCTJSCProfiler_x86_64 ./tmp/RCTJSCProfiler_arm64 ./tmp/RCTJSCProfiler_armv7
codesign :
codesign -f -s ${ CERT } /tmp/RCTJSCProfiler/RCTJSCProfiler.ios8.dylib
create :
mkdir -p ./tmp /tmp/RCTJSCProfiler/ ./tmp/CoreFoundation ./tmp/Foundation
for file in ./tmp/CoreFoundation/CFUserNotification.h ./tmp/CoreFoundation/CFXMLNode.h ./tmp/CoreFoundation/CFXMLParser.h ./tmp/Foundation/Foundation.h; do echo '' > " $$ file " ; done
download : wtf jsc webcore yajl
wtf :
curl -o tmp/WTF.tar.gz http://www.opensource.apple.com/tarballs/WTF/WTF-7600.1.24.tar.gz
tar -zxvf tmp/WTF.tar.gz -C tmp
jsc :
curl -o tmp/JSC.tar.gz http://www.opensource.apple.com/tarballs/JavaScriptCore/JavaScriptCore-7600.1.17.tar.gz
tar -zxvf tmp/JSC.tar.gz -C tmp
mv ./tmp/JavaScriptCore-7600.1.17 ./tmp/JavaScriptCore
python ./tmp/JavaScriptCore/generate-bytecode-files --bytecodes_h ./tmp/JavaScriptCore/Bytecodes.h ./tmp/JavaScriptCore/bytecode/BytecodeList.json
webcore :
curl -o tmp/WebCore.tar.gz http://www.opensource.apple.com/tarballs/WebCore/WebCore-7600.1.25.tar.gz
tar -zxvf tmp/WebCore.tar.gz -C tmp
yajl :
curl -o tmp/yajl.tar.gz https://codeload.github.com/lloyd/yajl/tar.gz/2.1.0
tar -zxvf tmp/yajl.tar.gz -C tmp
mkdir -p ./tmp/yajl-2.1.0/build && cd ./tmp/yajl-2.1.0/build && cmake .. && make
echo ` find . -name '*.c' `
cd ./tmp/yajl-2.1.0/src && \
clang -arch arm64 -arch armv7 -std= c99 \
2015-08-24 14:27:17 -07:00
-I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/ \
-I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/machine \
2015-07-20 09:14:53 -07:00
-I ../build/yajl-2.1.0/include \
-c ` find . -name '*.c' `
libtool -static -o ./tmp/yajl.a ` find ./tmp/yajl-2.1.0/src/ -name '*.o' `
x86_64 :
clang -w -dynamiclib -o ./tmp/RCTJSCProfiler_x86_64 -std= c++11 \
-install_name RCTJSCProfiler.ios8.dylib \
-include ./tmp/JavaScriptCore/config.h \
-I ./tmp \
-I ./tmp/WebCore-7600.1.25/icu \
-I ./tmp/WTF-7600.1.24 \
-I ./tmp/yajl-2.1.0/build/yajl-2.1.0/include \
-DNDEBUG= 1\
-miphoneos-version-min= 8.0 \
-L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib \
-L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/lib/system \
${ HEADER_PATHS } \
-undefined dynamic_lookup \
./JSCLegacyProfiler.mm ./tmp/yajl-2.1.0/build/yajl-2.1.0/lib/libyajl_s.a
arm64 :
echo $( HEADER_PATHS)
clang -w -dynamiclib -o ./tmp/RCTJSCProfiler_arm64 -std= c++11 \
-install_name RCTJSCProfiler.ios8.dylib \
-arch arm64 \
-include ./tmp/JavaScriptCore/config.h \
-I ./tmp \
-I ./tmp/WebCore-7600.1.25/icu \
-I ./tmp/WTF-7600.1.24 \
-I ./tmp/yajl-2.1.0/build/yajl-2.1.0/include \
2015-08-24 14:27:17 -07:00
-I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include \
-I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/machine \
2015-07-20 09:14:53 -07:00
-DNDEBUG= 1\
-miphoneos-version-min= 8.0 \
2015-08-24 14:27:17 -07:00
-L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib \
-L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/system \
2015-07-20 09:14:53 -07:00
${ HEADER_PATHS } \
-undefined dynamic_lookup \
./JSCLegacyProfiler.mm ./tmp/yajl.a
armv7 :
clang -w -dynamiclib -o ./tmp/RCTJSCProfiler_armv7 -std= c++11 \
-install_name RCTJSCProfiler.ios8.dylib \
-arch armv7 \
-include ./tmp/JavaScriptCore/config.h \
-I ./tmp \
-I ./tmp/WebCore-7600.1.25/icu \
-I ./tmp/WTF-7600.1.24 \
-I ./tmp/yajl-2.1.0/build/yajl-2.1.0/include \
2015-08-24 14:27:17 -07:00
-I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include \
2015-07-20 09:14:53 -07:00
-DNDEBUG= 1\
-miphoneos-version-min= 8.0 \
2015-08-24 14:27:17 -07:00
-L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib \
-L /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/system \
2015-07-20 09:14:53 -07:00
${ HEADER_PATHS } \
-undefined dynamic_lookup \
./JSCLegacyProfiler.mm ./tmp/yajl.a
.PHONY : ios 8