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