1 2 # 3 # Make rules to build compiler_rt in Apple B&I infrastructure 4 # 5 6 # set ProjSrcRoot appropriately 7 ProjSrcRoot := $(SRCROOT) 8 # set ProjObjRoot appropriately 9 ifdef OBJROOT 10 ProjObjRoot := $(OBJROOT) 11 else 12 ProjObjRoot := $(ProjSrcRoot) 13 endif 14 15 # Log full compile lines in B&I logs and omit summary lines. 16 Verb := 17 Summary := @true 18 19 # List of functions needed for each architecture. 20 21 # Copies any public headers to DSTROOT. 22 installhdrs: 23 24 25 # Copies source code to SRCROOT. 26 installsrc: 27 cp -r . $(SRCROOT) 28 29 30 # Copy results to DSTROOT. 31 install: $(SYMROOT)/usr/local/lib/system/libcompiler_rt.a 32 mkdir -p $(DSTROOT)/usr/local/lib/system 33 cp $(SYMROOT)/usr/local/lib/system/libcompiler_rt.a \ 34 $(DSTROOT)/usr/local/lib/system/libcompiler_rt.a 35 cd $(DSTROOT)/usr/local/lib/system; \ 36 ln -s libcompiler_rt.a libcompiler_rt_profile.a; \ 37 ln -s libcompiler_rt.a libcompiler_rt_debug.a 38 39 40 # Rule to make fat libcompiler_rt.a. 41 $(SYMROOT)/usr/local/lib/system/libcompiler_rt.a : $(foreach arch,$(RC_ARCHS), \ 42 $(OBJROOT)/$(arch)-pruned.a) 43 mkdir -p $(SYMROOT)/usr/local/lib/system 44 lipo -create $^ -o $@ 45 46 47 # Rule to add project info so that "what /usr/lib/libSystem.B.dylib" will work. 48 $(OBJROOT)/%-pruned.a : $(OBJROOT)/darwin_bni/Release/%/libcompiler_rt.a 49 mkdir -p $(OBJROOT)/$*.tmp 50 cd $(OBJROOT)/$*.tmp; \ 51 /Developer/Makefiles/bin/version.pl $(RC_ProjectName) > $(OBJROOT)/version.c; \ 52 gcc -arch $* -c ${OBJROOT}/version.c -o version.o; \ 53 ar -x $<; \ 54 libtool -static *.o -o $@ 55