1 include $(CoreOSMakefiles)/ProjectBuilder/Makefile.Postamble.Common
4 # gcc-3.5 doesn't support -precomp-trustfile (3689986), which
5 # pb_makefiles/flags.make sets, so we overwrite PRECOMP_CFLAGS
8 ifeq "$(BUILD_TYPE)" "normal"
14 LIBS := $(foreach LIB, \
15 $(filter $(BSD_LIBS), $(subst -l,,$(LIBS))), \
16 $(LIBSYS)/lib$(LIB).a) \
17 $(filter-out $(addprefix -l, $(BSD_LIBS)), $(LIBS))
19 # pb_makefiles erroneously omits $(BUILD_TYPE_SUFFIX) from the install name
20 DYLIB_INSTALL_NAME = $(LIBRARY_PREFIX)$(NAME).$(VERSION_NAME)$(BUILD_TYPE_SUFFIX)$(LIBRARY_EXT)
22 # The nonversioned suffix link is required by cc -pg, which is a bug in the compiler.
23 # We can remove those when this is fixed.
25 override DEBUG_SUFFIX = _debug
26 PRODUCTS += $(foreach TYPE, DEBUG PROFILE, \
27 $(PRODUCT_DIR)/$(LIBRARY_PREFIX)$(NAME)$($(TYPE)_SUFFIX)$(LIBRARY_EXT) \
28 $(PRODUCT_DIR)/$(LIBRARY_PREFIX)$(NAME).$(VERSION_NAME)$($(TYPE)_SUFFIX)$(LIBRARY_EXT) \
31 SystemFramework = $(NSFRAMEWORKDIR)/System.framework
32 VersionDir = Versions/$(VERSION_NAME)
35 $(INSTALL_DIRECTORY) "$(DSTROOT)$(SystemFramework)"
36 $(INSTALL_DIRECTORY) "$(DSTROOT)$(SystemFramework)/Versions"
37 $(INSTALL_DIRECTORY) "$(DSTROOT)$(SystemFramework)/$(VersionDir)"
38 $(LN) -fs "$(VERSION_NAME)" "$(DSTROOT)$(SystemFramework)/Versions/Current"
39 for suffix in "" $(DEBUG_SUFFIX) $(PROFILE_SUFFIX); do \
40 $(LN) -fs "Versions/Current/$(NAME)$${suffix}" "$(DSTROOT)$(SystemFramework)/$(NAME)$${suffix}" ; \
41 $(LN) -fs "../../../../../..$(INSTALLDIR)/$(LIBRARY_PREFIX)$(NAME).$(VERSION_NAME)$${suffix}$(LIBRARY_EXT)" \
42 "$(DSTROOT)$(SystemFramework)/$(VersionDir)/$(NAME)$${suffix}" ; \
44 $(LN) -fs "Versions/Current/PrivateHeaders" "$(DSTROOT)$(SystemFramework)"
47 for lib in $(BSD_LIBS) ; do \
48 $(LN) -fs libSystem.dylib "$(DSTROOT)$(INSTALLDIR)/lib$${lib}.dylib"; \
52 $(MKDIR) $(DSTROOT)$(SystemFramework)/$(VersionDir)/Resources
53 $(LN) -fs Versions/Current/Resources $(DSTROOT)$(SystemFramework)/Resources
54 $(RM) -f $(DSTROOT)$(SystemFramework)/$(VersionDir)/Resources/Info.plist
55 $(CP) $(SRCROOT)/Info.plist $(DSTROOT)$(SystemFramework)/$(VersionDir)/Resources
56 $(CHMOD) 444 $(DSTROOT)$(SystemFramework)/$(VersionDir)/Resources/Info.plist
58 .PHONY: comm-page-symbols
59 comm-page-symbols: spinlock_stub.o spinlocktry_stub.o spinunlock_stub.o CommPageSymbols.o
63 ALL_ARCHS = i386 ppc ppc64 x86_64
64 SEG1ADDR_i386 = 0xffff0000
65 SEG1ADDR_ppc = 0xffff8000
66 SEG1ADDR_ppc64 = 0xffffffffffff8000
67 SEG1ADDR_x86_64 = 0x00007fffffe00000
68 SLFS_F_PH = /System/Library/Frameworks/System.framework/PrivateHeaders
70 $(foreach A,$(ALL_ARCHS),$(OFILE_DIR)/%.$(A).o %.$(A).o): %.st
71 $(CC) -arch $(CURRENT_ARCH) -x assembler-with-cpp \
72 -I$(SLFS_F_PH)/$(CURRENT_ARCH) \
73 $(ALL_CFLAGS) -c -o $(OFILE_DIR)/commsym.$(CURRENT_ARCH).o $<
74 ld -arch $(CURRENT_ARCH) -r -seg1addr $(SEG1ADDR_$(CURRENT_ARCH)) \
75 $(OFILE_DIR)/commsym.$(CURRENT_ARCH).o -o $(OFILE_DIR)/$(notdir $@)
77 #-------------------------------------------------------------------------
79 LIBGCC = $(shell $(CC) -arch $(RC_ARCHS) -print-file-name=libgcc.a)