]> git.saurik.com Git - apple/libsystem.git/blame - GNUmakefile
Libsystem-71.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
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##---------------------------------------------------------------------
19ALLARCHS = hppa i386 m68k ppc sparc
20NARCHS = $(words $(RC_ARCHS))
21USRLIB = /usr/lib
22
23install: $(RC_ARCHS)
24 ditto $(OBJROOT)/$(word 1,$(RC_ARCHS))/dstroot $(DSTROOT)
25ifneq "$(NARCHS)" "1"
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); \
31 done
32endif
33
34$(ALLARCHS):
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)' \
40 RC_ARCHS='$@' \
41 RC_$@=YES $(foreach ARCH,$(filter-out $@,$(ALLARCHS)),RC_$(ARCH)=)
42
43.DEFAULT:
44 @$(MAKE) -f Makefile $@