1 ##---------------------------------------------------------------------
2 # Makefile for Libsystem
3 # Call Makefile to do the work, but for the install case, we need to
4 # call Makefile for each arch separately, and create fat dylibs at the
5 # end. This is because the comm page symbols are added as a special segment,
6 # which the linker will not thin, so we have to build thin and combine.
7 ##---------------------------------------------------------------------
13 ##---------------------------------------------------------------------
14 # For each arch, we setup the independent OBJROOT and DSTROOT, and adjust
15 # the other flags. After all the archs are built, we ditto over one on
16 # time (for the non-dylib files), and then call lipo to create fat files
17 # for the three dylibs.
18 ##---------------------------------------------------------------------
19 ALLARCHS = hppa i386 m68k ppc sparc
20 NARCHS = $(words $(RC_ARCHS))
24 ditto $(OBJROOT)/$(word 1,$(RC_ARCHS))/dstroot $(DSTROOT)
26 @for i in libSystem.B.dylib libSystem.B_debug.dylib libSystem.B_profile.dylib; do \
27 echo rm -f $(DSTROOT)$(USRLIB)/$$i; \
28 rm -f $(DSTROOT)$(USRLIB)/$$i; \
29 echo lipo -create -o $(DSTROOT)$(USRLIB)/$$i $(foreach ARCH,$(RC_ARCHS),$(OBJROOT)/$(ARCH)/dstroot$(USRLIB)/$$i); \
30 lipo -create -o $(DSTROOT)$(USRLIB)/$$i $(foreach ARCH,$(RC_ARCHS),$(OBJROOT)/$(ARCH)/dstroot$(USRLIB)/$$i); \
35 mkdir -p $(OBJROOT)/$@/objroot $(OBJROOT)/$@/dstroot
36 $(MAKE) -f Makefile install \
37 OBJROOT='$(OBJROOT)/$@/objroot' \
38 DSTROOT='$(OBJROOT)/$@/dstroot' \
39 RC_CFLAGS='-arch $@ $(RC_NONARCH_CFLAGS)' \
41 RC_$@=YES $(foreach ARCH,$(filter-out $@,$(ALLARCHS)),RC_$(ARCH)=)
44 @$(MAKE) -f Makefile $@