]> git.saurik.com Git - apple/libsystem.git/blame_incremental - GNUmakefile
Libsystem-88.1.8.tar.gz
[apple/libsystem.git] / GNUmakefile
... / ...
CommitLineData
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##---------------------------------------------------------------------
8PROJECT = Libsystem
9
10no_target:
11 @$(MAKE) -f Makefile
12
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 copy over one on
16# time (for the non-dylib files), and then call lipo to create fat files
17# for the three dylibs.
18##---------------------------------------------------------------------
19ALLARCHS = hppa i386 m68k ppc ppc64 sparc
20NARCHS = $(words $(RC_ARCHS))
21USRLIB = /usr/lib
22
23install: $(RC_ARCHS)
24ifneq "$(NARCHS)" "1"
25 rsync -aH $(OBJROOT)/$(word 1,$(RC_ARCHS))/dstroot/ $(DSTROOT)
26 rsync -aH $(OBJROOT)/$(word 1,$(RC_ARCHS))/symroot/ $(SYMROOT)
27 @for i in libSystem.B.dylib libSystem.B_debug.dylib libSystem.B_profile.dylib; do \
28 echo rm -f $(DSTROOT)$(USRLIB)/$$i && \
29 rm -f $(DSTROOT)$(USRLIB)/$$i && \
30 echo lipo -create -o $(DSTROOT)$(USRLIB)/$$i $(foreach ARCH,$(RC_ARCHS),$(OBJROOT)/$(ARCH)/dstroot$(USRLIB)/$$i) && \
31 lipo -create -o $(DSTROOT)$(USRLIB)/$$i $(foreach ARCH,$(RC_ARCHS),$(OBJROOT)/$(ARCH)/dstroot$(USRLIB)/$$i) && \
32 echo rm -f $(SYMROOT)/$$i && \
33 rm -f $(SYMROOT)/$$i && \
34 echo lipo -create -o $(SYMROOT)/$$i $(foreach ARCH,$(RC_ARCHS),$(OBJROOT)/$(ARCH)/symroot/$$i) && \
35 lipo -create -o $(SYMROOT)/$$i $(foreach ARCH,$(RC_ARCHS),$(OBJROOT)/$(ARCH)/symroot/$$i); \
36 done
37endif
38
39$(ALLARCHS):
40ifneq "$(NARCHS)" "1"
41 mkdir -p $(OBJROOT)/$@/objroot $(OBJROOT)/$@/dstroot $(OBJROOT)/$@/symroot
42 $(MAKE) -f Makefile install \
43 OBJROOT='$(OBJROOT)/$@/objroot' \
44 DSTROOT='$(OBJROOT)/$@/dstroot' \
45 SYMROOT='$(OBJROOT)/$@/symroot' \
46 RC_CFLAGS='-arch $@ $(RC_NONARCH_CFLAGS)' \
47 RC_ARCHS='$@' \
48 RC_$@=YES $(foreach ARCH,$(filter-out $@,$(ALLARCHS)),RC_$(ARCH)=)
49else # NARCHS == 1
50 $(MAKE) -f Makefile install
51endif # NARCHS != 1
52
53.DEFAULT:
54 @$(MAKE) -f Makefile $@