aboutsummaryrefslogtreecommitdiff
path: root/make/AppleBI.mk
diff options
context:
space:
mode:
Diffstat (limited to 'make/AppleBI.mk')
-rw-r--r--make/AppleBI.mk46
1 files changed, 42 insertions, 4 deletions
diff --git a/make/AppleBI.mk b/make/AppleBI.mk
index d3d4771309c4..b236152158ff 100644
--- a/make/AppleBI.mk
+++ b/make/AppleBI.mk
@@ -12,10 +12,14 @@ else
ProjObjRoot := $(ProjSrcRoot)
endif
-ifeq (,$(SDKROOT))
+ifeq (,$(RC_PURPLE))
INSTALL_TARGET = install-MacOSX
else
- INSTALL_TARGET = install-iOS
+ ifeq (,$(RC_INDIGO))
+ INSTALL_TARGET = install-iOS
+ else
+ INSTALL_TARGET = install-iOS-Simulator
+ endif
endif
@@ -61,9 +65,9 @@ $(OBJROOT)/libcompiler_rt-%.dylib : $(OBJROOT)/darwin_bni/Release/%/libcompiler_
-Wl,-upward-lunwind \
-Wl,-upward-lsystem_m \
-Wl,-upward-lsystem_c \
+ -Wl,-upward-lsystem_kernel \
-Wl,-upward-lsystem_platform \
-Wl,-ldyld \
- -Wl,-lsystem_kernel \
-L$(SDKROOT)/usr/lib/system \
$(DYLIB_FLAGS) -Wl,-force_load,$^ -o $@
@@ -88,7 +92,6 @@ install-iOS: $(SYMROOT)/libcompiler_rt-static.a \
$(call GetCNAVar,STRIP,Platform.darwin_bni,Release,) -S $(SYMROOT)/libcompiler_rt.dylib \
-o $(DSTROOT)/usr/lib/system/libcompiler_rt.dylib
-
# Rule to make fat archive
$(SYMROOT)/libcompiler_rt-static.a : $(foreach arch,$(RC_ARCHS), \
$(OBJROOT)/darwin_bni/Static/$(arch)/libcompiler_rt.a)
@@ -109,3 +112,38 @@ $(SYMROOT)/libcompiler_rt-dyld.a : $(foreach arch,$(RC_ARCHS), \
$(OBJROOT)/libcompiler_rt-dyld-$(arch).a)
$(call GetCNAVar,LIPO,Platform.darwin_bni,Release,) -create $^ -o $@
+
+
+# Copy results to DSTROOT.
+install-iOS-Simulator: $(SYMROOT)/libcompiler_rt_sim.dylib \
+ $(SYMROOT)/libcompiler_rt-dyld.a
+ mkdir -p $(DSTROOT)/$(SDKROOT)/usr/lib/system
+ $(call GetCNAVar,STRIP,Platform.darwin_bni,Release,) -S $(SYMROOT)/libcompiler_rt_sim.dylib \
+ -o $(DSTROOT)/$(SDKROOT)/usr/lib/system/libcompiler_rt_sim.dylib
+ mkdir -p $(DSTROOT)/$(SDKROOT)/usr/local/lib/dyld
+ cp $(SYMROOT)/libcompiler_rt-dyld.a \
+ $(DSTROOT)/$(SDKROOT)/usr/local/lib/dyld/libcompiler_rt.a
+
+# Rule to make fat dylib
+$(SYMROOT)/libcompiler_rt_sim.dylib: $(foreach arch,$(RC_ARCHS), \
+ $(OBJROOT)/libcompiler_rt_sim-$(arch).dylib)
+ $(call GetCNAVar,LIPO,Platform.darwin_bni,Release,) -create $^ -o $@
+ $(call GetCNAVar,DSYMUTIL,Platform.darwin_bni,Release,) $@
+
+# Rule to make each dylib slice
+$(OBJROOT)/libcompiler_rt_sim-%.dylib : $(OBJROOT)/darwin_bni/Release/%/libcompiler_rt.a
+ echo "const char vers[] = \"@(#) $(RC_ProjectName)-$(RC_ProjectSourceVersion)\"; " > $(OBJROOT)/version.c
+ $(call GetCNAVar,CC,Platform.darwin_bni,Release,$*) \
+ $(OBJROOT)/version.c -arch $* -dynamiclib \
+ -install_name /usr/lib/system/libcompiler_rt_sim.dylib \
+ -compatibility_version 1 -current_version $(RC_ProjectSourceVersion) \
+ -Wl,-unexported_symbol,___enable_execute_stack \
+ -nostdlib \
+ -Wl,-upward-lunwind_sim \
+ -Wl,-upward-lsystem_sim_m \
+ -Wl,-upward-lsystem_sim_c \
+ -ldyld_sim \
+ -Wl,-upward-lSystem \
+ -umbrella System -Wl,-no_implicit_dylibs -L$(SDKROOT)/usr/lib/system -dead_strip \
+ $(DYLIB_FLAGS) -Wl,-force_load,$^ -o $@
+