2015-09-02 15:54:59 +00:00
|
|
|
HEADER_PATHS := `find download/JavaScriptCore -name '*.h' | xargs -I{} dirname {} | uniq | xargs -I{} echo "-I {}"`
|
|
|
|
|
|
|
|
SDK_PATH = /Applications/Xcode.app/Contents/Developer/Platforms/$1.platform/Developer/SDKs/$1.sdk
|
|
|
|
|
|
|
|
SDK_VERSION = $(shell plutil -convert json -o - $(call SDK_PATH,iPhoneOS)/SDKSettings.plist | awk -f parseSDKVersion.awk)
|
|
|
|
|
2015-09-08 13:44:28 +00:00
|
|
|
CERT ?= iPhone Developer
|
2015-07-20 16:14:53 +00:00
|
|
|
|
2015-09-02 15:54:59 +00:00
|
|
|
ARCHS = x86_64 arm64 armv7 i386
|
|
|
|
|
|
|
|
PLATFORM = \
|
|
|
|
if [[ "$*" = "x86_64" || "$*" = "i386" ]]; then \
|
|
|
|
PLATFORM=iPhoneSimulator; \
|
|
|
|
else \
|
|
|
|
PLATFORM=iPhoneOS; \
|
|
|
|
fi;
|
|
|
|
|
|
|
|
SYSROOT = -isysroot $(call SDK_PATH,$${PLATFORM})
|
|
|
|
|
2015-09-10 16:03:03 +00:00
|
|
|
IOS8_LIBS = download/WebCore/WebCore-7600.1.25 download/WTF/WTF-7600.1.24 download/JavaScriptCore/JavaScriptCore-7600.1.17 download/JavaScriptCore/JavaScriptCore-7600.1.17/Bytecodes.h
|
2015-09-02 15:54:59 +00:00
|
|
|
|
|
|
|
ios8: RCTJSCProfiler.ios8.dylib /tmp/RCTJSCProfiler
|
2015-08-24 21:27:17 +00:00
|
|
|
ifneq ($(SDK_VERSION), 8)
|
|
|
|
$(error "Expected to be compiled with iOS SDK version 8, found $(SDK_VERSION)")
|
2015-09-02 15:54:59 +00:00
|
|
|
else
|
|
|
|
cp $^
|
2015-08-24 21:27:17 +00:00
|
|
|
endif
|
|
|
|
|
2015-09-08 13:44:23 +00:00
|
|
|
/tmp/RCTJSCProfiler:
|
2015-09-02 15:54:59 +00:00
|
|
|
mkdir -p $@
|
2015-07-20 16:14:53 +00:00
|
|
|
|
2015-09-02 15:54:59 +00:00
|
|
|
RCTJSCProfiler.ios8.dylib: RCTJSCProfiler_unsigned.ios8.dylib
|
|
|
|
cp $< $@
|
2015-09-08 13:44:28 +00:00
|
|
|
codesign -f -s "${CERT}" $@
|
2015-07-20 16:14:53 +00:00
|
|
|
|
2015-09-02 15:54:59 +00:00
|
|
|
.PRECIOUS: RCTJSCProfiler_unsigned.ios8.dylib
|
|
|
|
RCTJSCProfiler_unsigned.ios8.dylib: $(patsubst %,RCTJSCProfiler_%.ios8.dylib,$(ARCHS))
|
|
|
|
lipo -create -output $@ $^
|
2015-07-20 16:14:53 +00:00
|
|
|
|
2015-09-02 15:54:59 +00:00
|
|
|
.PRECIOUS: RCTJSCProfiler_%.ios8.dylib
|
|
|
|
RCTJSCProfiler_%.ios8.dylib: $(IOS8_LIBS)
|
|
|
|
$(PLATFORM) \
|
|
|
|
clang -w -dynamiclib -o RCTJSCProfiler_$*.ios8.dylib -std=c++11 \
|
|
|
|
-arch $* \
|
2015-07-20 16:14:53 +00:00
|
|
|
-install_name RCTJSCProfiler.ios8.dylib \
|
2015-09-02 15:54:59 +00:00
|
|
|
-include ./download/JavaScriptCore/JavaScriptCore-7600.1.17/config.h \
|
|
|
|
-I download \
|
|
|
|
-I download/WebCore/WebCore-7600.1.25/icu \
|
|
|
|
-I download/WTF/WTF-7600.1.24 \
|
2015-07-20 16:14:53 +00:00
|
|
|
-DNDEBUG=1\
|
|
|
|
-miphoneos-version-min=8.0 \
|
2015-09-02 15:54:59 +00:00
|
|
|
$(SYSROOT) \
|
|
|
|
$(HEADER_PATHS) \
|
2015-07-20 16:14:53 +00:00
|
|
|
-undefined dynamic_lookup \
|
2015-09-10 16:03:03 +00:00
|
|
|
JSCLegacyProfiler.mm
|
2015-07-20 16:14:53 +00:00
|
|
|
|
2015-09-02 15:54:59 +00:00
|
|
|
.PRECIOUS: %/Bytecodes.h
|
|
|
|
%/Bytecodes.h:
|
|
|
|
python $*/generate-bytecode-files --bytecodes_h $@ $*/bytecode/BytecodeList.json
|
2015-07-20 16:14:53 +00:00
|
|
|
|
2015-09-02 15:54:59 +00:00
|
|
|
.PRECIOUS: download/%
|
|
|
|
download/%: download/%.tar.gz
|
2015-09-08 13:44:28 +00:00
|
|
|
tar -zxvf $< -C `dirname $@` > /dev/null
|
2015-09-02 15:54:59 +00:00
|
|
|
|
|
|
|
.PRECIOUS: %.tar.gz
|
|
|
|
%.tar.gz:
|
|
|
|
mkdir -p `dirname $@`
|
|
|
|
curl -o $@ http://www.opensource.apple.com/tarballs/$(patsubst download/%,%,$@)
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2015-09-10 16:03:03 +00:00
|
|
|
-rm -rf $(wildcard *.dylib)
|
|
|
|
-rm -rf $(wildcard *.a)
|
|
|
|
-rm -rf download
|