1 include $(CoreOSMakefiles)/ProjectBuilder/Makefile.Postamble.Common
3 ifeq ($(BUILD_TYPE),normal)
4 OPTIMIZE_BUILD_LIBS := $(LIBSYSTEM_LIBS) $(GCCLIBS)
7 # pb_makefiles erroneously omits $(BUILD_TYPE_SUFFIX) from the install name
8 DYLIB_INSTALL_NAME = $(LIBRARY_PREFIX)$(NAME).$(VERSION_NAME)$(BUILD_TYPE_SUFFIX)$(LIBRARY_EXT)
10 # The nonversioned suffix link is required by cc -pg, which is a bug in the compiler.
11 # We can remove those when this is fixed.
13 override DEBUG_SUFFIX = _debug
14 PRODUCTS += $(foreach TYPE, DEBUG PROFILE, \
15 $(PRODUCT_DIR)/$(LIBRARY_PREFIX)$(NAME)$($(TYPE)_SUFFIX)$(LIBRARY_EXT) \
16 $(PRODUCT_DIR)/$(LIBRARY_PREFIX)$(NAME).$(VERSION_NAME)$($(TYPE)_SUFFIX)$(LIBRARY_EXT) \
19 SystemFramework = $(NSFRAMEWORKDIR)/System.framework
20 VersionDir = Versions/$(VERSION_NAME)
23 $(INSTALL_DIRECTORY) "$(DSTROOT)$(SystemFramework)"
24 $(INSTALL_DIRECTORY) "$(DSTROOT)$(SystemFramework)/Versions"
25 $(INSTALL_DIRECTORY) "$(DSTROOT)$(SystemFramework)/$(VersionDir)"
26 $(LN) -fs "$(VERSION_NAME)" "$(DSTROOT)$(SystemFramework)/Versions/Current"
27 for suffix in "" $(DEBUG_SUFFIX) $(PROFILE_SUFFIX); do \
28 $(LN) -fs "Versions/Current/$(NAME)$${suffix}" "$(DSTROOT)$(SystemFramework)/$(NAME)$${suffix}" ; \
29 $(LN) -fs "../../../../../..$(INSTALLDIR)/$(LIBRARY_PREFIX)$(NAME).$(VERSION_NAME)$${suffix}$(LIBRARY_EXT)" \
30 "$(DSTROOT)$(SystemFramework)/$(VersionDir)/$(NAME)$${suffix}" ; \
32 $(LN) -fs "Versions/Current/PrivateHeaders" "$(DSTROOT)$(SystemFramework)"
35 for lib in $(BSD_LIBS) ; do \
36 $(LN) -fs libSystem.dylib "$(DSTROOT)$(INSTALLDIR)/lib$${lib}.dylib"; \
40 $(MKDIR) $(DSTROOT)$(SystemFramework)/$(VersionDir)/Resources
41 $(LN) -fs Versions/Current/Resources $(DSTROOT)$(SystemFramework)/Resources
42 $(RM) -f $(DSTROOT)$(SystemFramework)/$(VersionDir)/Resources/Info.plist
43 $(CP) $(SRCROOT)/Info.plist $(DSTROOT)$(SystemFramework)/$(VersionDir)/Resources
44 $(CHMOD) 444 $(DSTROOT)$(SystemFramework)/$(VersionDir)/Resources/Info.plist
46 .PHONY: comm-page-symbols
47 comm-page-symbols: spinlock_stub.o spinlocktry_stub.o spinunlock_stub.o CommPageSymbols.o
51 SLFS_F_PH = /System/Library/Frameworks/System.framework/PrivateHeaders
53 $(OFILE_DIR)/%.ppc.o %.ppc.o: %.st
54 $(CC) -arch $(CURRENT_ARCH) -x assembler-with-cpp \
55 -I$(SLFS_F_PH)/$(CURRENT_ARCH) \
56 $(ALL_CFLAGS) -c -o $(OFILE_DIR)/commsym.$(CURRENT_ARCH).o $<
57 ld -arch $(CURRENT_ARCH) -r -seg1addr 0xffff8000 \
58 $(OFILE_DIR)/commsym.$(CURRENT_ARCH).o -o $(OFILE_DIR)/$(notdir $@)
60 $(OFILE_DIR)/%.i386.o %.i386.o: %.st
61 $(CC) -arch $(CURRENT_ARCH) -x assembler-with-cpp \
62 -I$(SLFS_F_PH)/$(CURRENT_ARCH) \
63 $(ALL_CFLAGS) -c -o $(OFILE_DIR)/commsym.$(CURRENT_ARCH).o $<
64 ld -arch $(CURRENT_ARCH) -r -seg1addr 0xBFFF8000 \
65 $(OFILE_DIR)/commsym.$(CURRENT_ARCH).o -o $(OFILE_DIR)/$(notdir $@)
67 #----------------------------------------------------------------------------
69 ifeq ($(RC_ARCHS),ppc)
70 ifeq ($(BUILD_TYPE),normal)
74 ifeq ($(BUILD_TYPE),debug)
78 LIBSUFFIX = _profile.a
82 CNAME = libc$(LIBSUFFIX)
83 MNAME = libm$(LIBSUFFIX)
84 REMOVELIBC = _ldtoa err hexfloat syslog vfprintf vfwprintf
85 REMOVELIBCOBJS = $(addsuffix $(REMOVESUFFIX),$(REMOVELIBC))
87 REMOVELIBMOBJS = $(addsuffix .o,$(REMOVELIBM))
88 LIBGCC = $(LIBSYS)/libgcc-ppc.a
90 $(OFILE_DIR)/libgcc.unexport:
91 nm -g -arch $(RC_ARCHS) $(LIBGCC) | grep ' [A-TV-Z] ' | sed 's/^.* [A-Z] //' > $(OFILE_DIR)/libgcc.unexport
92 lipo -thin ppc -output $(OFILE_DIR)/$(CNAME) $(LIBSYS)/$(CNAME)
93 ar -d $(OFILE_DIR)/$(CNAME) $(REMOVELIBCOBJS)
94 ranlib $(OFILE_DIR)/$(CNAME)
95 lipo -thin ppc -output $(OFILE_DIR)/$(MNAME) $(LIBSYS)/$(MNAME)
96 ar -d $(OFILE_DIR)/$(MNAME) $(REMOVELIBMOBJS)
97 ranlib $(OFILE_DIR)/$(MNAME)