]>
Commit | Line | Data |
---|---|---|
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 | ##--------------------------------------------------------------------- | |
8 | PROJECT = Libsystem | |
9 | ||
10 | no_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 | ##--------------------------------------------------------------------- | |
19 | ALLARCHS = hppa i386 m68k ppc sparc | |
20 | NARCHS = $(words $(RC_ARCHS)) | |
21 | USRLIB = /usr/lib | |
22 | ||
23 | install: $(RC_ARCHS) | |
24 | ditto $(OBJROOT)/$(word 1,$(RC_ARCHS))/dstroot $(DSTROOT) | |
25 | ifneq "$(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 | |
32 | endif | |
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 $@ |