2 DSTROOT != x=`pwd`/DSTROOT && mkdir -p $$x && echo $$x
5 OBJROOT != x=`pwd`/OBJROOT && mkdir -p $$x && echo $$x
8 SRCROOT != dirname `pwd`
11 SYMROOT != x=`pwd`/SYMROOT && mkdir -p $$x && echo $$x
18 NARCHS != echo $(RC_ARCHS) | wc -w
19 .ifdef ALTUSRLOCALLIBSYSTEM
20 LIBSYS = $(ALTUSRLOCALLIBSYSTEM)
22 LIBSYS = $(NEXT_ROOT)/usr/local/lib/system
24 NJOBS != perl -e '$$n = `/usr/sbin/sysctl -n hw.ncpu`; printf "%d\n", $$n < 2 ? 2 : ($$n * 1.5)'
25 BSDMAKE = bsdmake -f Makefile
26 BSDMAKEJ = $(BSDMAKE) -j $(NJOBS)
28 # This variables are to guarantee that the left-hand side of an expression is
32 # Remove the arch stuff, since we know better here.
33 LOCAL_CFLAGS != echo $(RC_CFLAGS) | sed 's/ *-arch [^ ][^ ]*//g'
35 FORMS := debug dynamic profile
39 build: build-debug build-dynamic build-profile
41 # These are the non B&I defaults
42 .ifndef RC_ProjectName
43 install: installhdrs install-all
45 .else # RC_ProjectName
48 install: BI-install-$(F)
50 .endif # RC_ProjectName
53 .if $(dynamic) == $(F)
58 LIPOARGS$(F) != perl -e 'printf "%s\n", join(" ", map(qq(-arch $$_ \"$(OBJROOT)/$$_/$(F)/libc$(SUFFIX$(F)).a\"), qw($(RC_ARCHS))))'
61 build-$(F): build-$(A)-$(F)
65 cp -p "$(OBJROOT)/$(RC_ARCHS)/$(F)/libc$(SUFFIX$(F)).a" "$(SYMROOT)"
67 lipo -create $(LIPOARGS$(F)) -output "$(SYMROOT)/libc$(SUFFIX$(F)).a"
69 ranlib "$(SYMROOT)/libc$(SUFFIX$(F)).a"
72 build-$(A)-$(F): $(OBJROOT)/$(A)/libsystem.o
73 mkdir -p '$(OBJROOT)/$(A)/$(F)'
75 cd '$(OBJROOT)/$(A)/$(F)' && \
76 ditto -arch $(A) '$(LIBSYS)/libc-partial$(SUFFIX$(F)).a' . && \
77 ar x 'libc-partial$(SUFFIX$(F)).a' && \
78 ditto -arch $(A) '$(LIBSYS)/libsyscall$(SUFFIX$(F)).a' . && \
79 ar x 'libsyscall$(SUFFIX$(F)).a' && \
80 '$(SRCROOT)/libsys/build-libc.pl' '$(LIBSYS)' '$(OBJROOT)/$(A)/$(F)' && \
81 ln -s ../libsystem.o && \
87 $(OBJROOT)/$(A)/libsystem.o: $(OBJROOT)/libsystem.c
88 mkdir -p '$(OBJROOT)/$(A)'
89 cc -c -o '$(.TARGET)' -arch $(A) '$(.ALLSRC)'
92 $(OBJROOT)/libsystem.c:
93 /Developer/Makefiles/bin/version.pl Libsystem > $(.TARGET)
98 BI-install-$(F): build-$(F)
99 mkdir -p "$(DSTROOT)/usr/local/lib/system"
100 @echo "Installing libc$(SUFFIX$(F)).a"
101 install "$(SYMROOT)/libc$(SUFFIX$(F)).a" "$(DSTROOT)/usr/local/lib/system"
102 ranlib "$(DSTROOT)/usr/local/lib/system/libc$(SUFFIX$(F)).a"
103 chmod 0444 "$(DSTROOT)/usr/local/lib/system/libc$(SUFFIX$(F)).a"
108 install-all: BI-install-$(F)
112 .for A in $(RC_ARCHS)
113 rm -rf $(OBJROOT)/$(A)