1 # use LDFLAGS not LFLAGS
3 # Simple makefile for building objc4 on Darwin
5 # These make variables (or environment variables) are used
7 # SRCROOT path location of root of source hierarchy;
8 # defaults to ".", but must be set to a
9 # destination path for installsrc target.
10 # OBJROOT path location where .o files will be put;
11 # defaults to SRCROOT.
12 # SYMROOT path location where build products will be
13 # put; defaults to SRCROOT.
14 # DSTROOT path location where installed products will
15 # be put; defaults to / .
16 # OBJROOT and SYMROOT should not be directories shared with other
18 # PLATFORM name of platform being built on
19 # USER name of user building the project
20 # ARCHS list of archs for which to build
21 # RC_ARCHS more archs for which to build (build system)
22 # OTHER_CFLAGS other flags to be passed to compiler
23 # RC_CFLAGS more flags to be passed to compiler (build system)
24 # OTHER_LDFLAGS other flags to be passed to the link stage
32 .PHONY: default all build optimized debug profile installsrc installhdrs install clean prebuild build-optimized build-debug build-profile prebuild-optimized prebuild-debug prebuild-profile compile-optimized compile-debug compile-profile link-optimized link-debug link-profile postbuild
34 CURRENT_PROJECT_VERSION = 227
38 # First figure out the platform if not specified, so we can use it in the
39 # rest of this file. Currently defined values: Darwin
41 PLATFORM := $(shell uname)
60 ifeq "$(PLATFORM)" "Darwin"
67 MKDIRS = /bin/mkdir -p
70 COPY_RECUR = /bin/cp -r
72 REMOVE_RECUR = /bin/rm -rf
75 CHOWN = /usr/sbin/chown
77 STRIP = /usr/bin/strip
78 NMEDIT = /usr/bin/nmedit
81 ifeq "$(PLATFORM)" "Darwin"
82 WARNING_FLAGS = -Wmost -Wno-precomp -Wno-four-char-constants
86 ifeq "$(PLATFORM)" "Darwin"
91 ifneq "$(RC_ARCHS)" ""
92 ARCH_LIST += $(RC_ARCHS)
94 ARCH_LIST += $(shell /usr/bin/arch)
98 ARCH_FLAGS = $(foreach A, $(ARCH_LIST), $(addprefix -arch , $(A)))
103 ifeq "$(ORDERFILE)" ""
104 ORDERFILE = $(wildcard /usr/local/lib/OrderFiles/libobjc.order)
106 ifneq "$(ORDERFILE)" ""
107 ORDER = -sectorder __TEXT __text $(ORDERFILE)
116 CFLAGS = -g -fno-common -fobjc-exceptions -pipe $(PLATFORM_CFLAGS) $(WARNING_FLAGS) -I$(SYMROOT) -I. -I$(SYMROOT)/ProjectHeaders
121 PUBLIC_HEADER_INSTALLDIR = usr/include/objc
122 OTHER_HEADER_INSTALLDIR = usr/local/include/objc
125 ifeq "$(PLATFORM)" "Darwin"
126 LDFLAGS += -dynamiclib -dynamic -compatibility_version 1 -current_version $(CURRENT_PROJECT_VERSION)
130 CFLAGS += $(OTHER_CFLAGS) $(RC_CFLAGS)
131 LDFLAGS += $(OTHER_LDFLAGS)
133 ifndef OPTIMIZATION_CFLAGS
134 OPTIMIZATION_CFLAGS = -Os
137 DEBUG_CFLAGS = -DDEBUG
139 ifndef PROFILE_CFLAGS
140 PROFILE_CFLAGS = -DPROFILE -pg -Os
143 CFLAGS_OPTIMIZED = $(OPTIMIZATION_CFLAGS) $(CFLAGS)
144 CFLAGS_DEBUG = $(DEBUG_CFLAGS) $(CFLAGS)
145 CFLAGS_PROFILE = $(PROFILE_CFLAGS) $(CFLAGS)
147 LDFLAGS_OPTIMIZED = $(LDFLAGS) -g
148 LDFLAGS_DEBUG = $(LDFLAGS) -g
149 LDFLAGS_PROFILE = $(LDFLAGS) -g -pg
151 SUBDIRS = . runtime runtime/OldClasses.subproj runtime/Messengers.subproj runtime/Auto.subproj
155 # files to compile into separate linker modules
157 # files to not compile
159 # headers to install in /usr/include/objc
161 # headers that don't get installed
163 # headers to install in /usr/local/include/objc
167 SOURCES += $(addprefix runtime/, \
168 Object.m Protocol.m hashtable2.m maptable.m objc-class.m objc-errors.m \
169 objc-file.m objc-load.m objc-moninit.c objc-runtime.m objc-sel.m \
170 objc-sync.m objc-exception.m objc-auto.m objc-sel-set.m objc-rtp.m \
172 PUBLIC_HEADERS += $(addprefix runtime/, \
173 objc-class.h objc-api.h objc-load.h objc-runtime.h objc.h Object.h \
174 objc-sync.h objc-exception.h objc-auto.h \
175 Protocol.h error.h hashtable2.h \
177 PRIVATE_HEADERS += runtime/objc-private.h runtime/objc-config.h runtime/objc-sel-table.h runtime/objc-sel-set.h runtime/objc-rtp.h
178 OTHER_HEADERS += runtime/maptable.h runtime/objc-auto.h
181 SOURCES += runtime/OldClasses.subproj/List.m
182 PUBLIC_HEADERS += runtime/OldClasses.subproj/List.h
185 SOURCES += runtime/Messengers.subproj/objc-msg.s
186 OTHER_SOURCES += runtime/Messengers.subproj/objc-msg-ppc.s runtime/Messengers.subproj/objc-msg-i386.s
189 SOURCES += runtime/Auto.subproj/objc-auto.s
190 OTHER_SOURCES += runtime/Auto.subproj/objc-auto-ppc.s runtime/Auto.subproj/objc-auto-i386.s
192 # RTP symbols for gdb
193 # See also $(OBJROOT)/runtime/objc-rtp-sym.ppc.o rule below.
194 OTHER_SOURCES += runtime/objc-rtp-sym.s
196 # Interposing support.
197 # This code is built into a second module so dyld's function interposing
198 # can manipulate the calls.
199 MODULE_SOURCES += runtime/Messengers.subproj/objc-msg-stub.s
200 OTHER_SOURCES += runtime/Messengers.subproj/objc-msg-stub-ppc.s runtime/Messengers.subproj/objc-msg-stub-i386.s
203 OTHER_SOURCES += Makefile APPLE_LICENSE objc-exports-i386 objc-exports-ppc
205 OBJECTS = $(addprefix $(OBJROOT)/, $(addsuffix .o, $(basename $(SOURCES) ) ) )
206 OBJECTS_OPTIMIZED = $(OBJECTS:.o=.opt.o)
207 OBJECTS_DEBUG = $(OBJECTS:.o=.debug.o)
208 OBJECTS_PROFILE = $(OBJECTS:.o=.profile.o)
210 MODULE_OBJECTS = $(addprefix $(OBJROOT)/, $(addsuffix .o, $(basename $(MODULE_SOURCES) ) ) )
211 MODULE_OBJECTS_OPTIMIZED = $(MODULE_OBJECTS:.o=.opt.o)
212 MODULE_OBJECTS_DEBUG = $(MODULE_OBJECTS:.o=.debug.o)
213 MODULE_OBJECTS_PROFILE = $(MODULE_OBJECTS:.o=.profile.o)
215 # For simplicity, each object target depends on all objc headers. Most of
216 # them come close to requiring this anyway, and rebuild from scratch is fast.
217 DEPEND_HEADERS = $(addprefix $(SRCROOT)/, \
218 $(PUBLIC_HEADERS) $(PRIVATE_HEADERS) $(OTHER_HEADERS) )
220 $(OBJROOT)/%.opt.o : $(SRCROOT)/%.m $(DEPEND_HEADERS)
221 $(SILENT) $(ECHO) " ... $<"
222 $(SILENT) $(CC) $(CFLAGS_OPTIMIZED) "$<" -c -o "$@"
224 $(OBJROOT)/%.debug.o : $(SRCROOT)/%.m $(DEPEND_HEADERS)
225 $(SILENT) $(ECHO) " ... $<"
226 $(SILENT) $(CC) $(CFLAGS_DEBUG) "$<" -c -o "$@"
228 $(OBJROOT)/%.profile.o : $(SRCROOT)/%.m $(DEPEND_HEADERS)
229 $(SILENT) $(ECHO) " ... $<"
230 $(SILENT) $(CC) $(CFLAGS_PROFILE) "$<" -c -o "$@"
232 $(OBJROOT)/%.opt.o : $(SRCROOT)/%.c $(DEPEND_HEADERS)
233 $(SILENT) $(ECHO) " ... $<"
234 $(SILENT) $(CC) $(CFLAGS_OPTIMIZED) "$<" -c -o "$@"
236 $(OBJROOT)/%.debug.o : $(SRCROOT)/%.c $(DEPEND_HEADERS)
237 $(SILENT) $(ECHO) " ... $<"
238 $(SILENT) $(CC) $(CFLAGS_DEBUG) "$<" -c -o "$@"
240 $(OBJROOT)/%.profile.o : $(SRCROOT)/%.c $(DEPEND_HEADERS)
241 $(SILENT) $(ECHO) " ... $<"
242 $(SILENT) $(CC) $(CFLAGS_PROFILE) "$<" -c -o "$@"
244 $(OBJROOT)/%.opt.o : $(SRCROOT)/%.s $(DEPEND_HEADERS)
245 $(SILENT) $(ECHO) " ... $<"
246 $(SILENT) $(CC) $(CFLAGS_OPTIMIZED) "$<" -c -o "$@"
248 $(OBJROOT)/%.debug.o : $(SRCROOT)/%.s $(DEPEND_HEADERS)
249 $(SILENT) $(ECHO) " ... $<"
250 $(SILENT) $(CC) $(CFLAGS_DEBUG) "$<" -c -o "$@"
252 $(OBJROOT)/%.profile.o : $(SRCROOT)/%.s $(DEPEND_HEADERS)
253 $(SILENT) $(ECHO) " ... $<"
254 $(SILENT) $(CC) $(CFLAGS_PROFILE) "$<" -c -o "$@"
256 # Additional dependency: objc-msg.s depends on objc-msg-ppc.s and
257 # objc-msg-i386.s, which it includes.
258 $(OBJROOT)/runtime/Messengers.subproj/objc-msg.opt.o \
259 $(OBJROOT)/runtime/Messengers.subproj/objc-msg.debug.o \
260 $(OBJROOT)/runtime/Messengers.subproj/objc-msg.profile.o : \
261 $(SRCROOT)/runtime/Messengers.subproj/objc-msg-ppc.s \
262 $(SRCROOT)/runtime/Messengers.subproj/objc-msg-i386.s
264 # Additional dependency: objc-msg-sutb.s depends on objc-msg-stub-ppc.s and
265 # objc-msg-stub-i386.s, which it includes.
266 $(OBJROOT)/runtime/Messengers.subproj/objc-msg-stub.opt.o \
267 $(OBJROOT)/runtime/Messengers.subproj/objc-msg-stub.debug.o \
268 $(OBJROOT)/runtime/Messengers.subproj/objc-msg-stub.profile.o : \
269 $(SRCROOT)/runtime/Messengers.subproj/objc-msg-stub-ppc.s \
270 $(SRCROOT)/runtime/Messengers.subproj/objc-msg-stub-i386.s
272 # Additional dependency: objc-auto.s depends on objc-auto-ppc.s and
273 # objc-auto-i386.s, which it includes.
274 $(OBJROOT)/runtime/Auto.subproj/objc-auto.opt.o \
275 $(OBJROOT)/runtime/Auto.subproj/objc-auto.debug.o \
276 $(OBJROOT)/runtime/Auto.subproj/objc-auto.profile.o : \
277 $(SRCROOT)/runtime/Auto.subproj/objc-auto-ppc.s \
278 $(SRCROOT)/runtime/Auto.subproj/objc-auto-i386.s
280 # Additional rules: objc-rtp-sym.s needs to be built with a per-arch seg1addr,
281 # and need to be stripped here because stripping the dylib does not remove
282 # debug info from the magic sections.
283 # objc-rtp-sym.s is not in SOURCES, and objc-rtp-sym.o is not in OBJECTS
284 $(OBJROOT)/runtime/objc-rtp-sym.ppc.o: $(SRCROOT)/runtime/objc-rtp-sym.s
285 $(SILENT) $(CC) $(CFLAGS_OPTIMIZED) -arch ppc "$<" -c -o "$@.temp"
286 $(SILENT) $(STRIP) -S "$@.temp"
287 $(SILENT) $(LD) -arch ppc -seg1addr 0xfffec000 "$@.temp" -r -o "$@"
289 $(OBJROOT)/runtime/objc-rtp-sym.i386.o: $(SRCROOT)/runtime/objc-rtp-sym.s
290 $(SILENT) $(CC) $(CFLAGS_OPTIMIZED) -arch i386 "$<" -c -o "$@.temp"
291 $(SILENT) $(STRIP) -S "$@.temp"
292 $(SILENT) $(LD) -arch i386 -seg1addr 0xfffe8000 "$@.temp" -r -o "$@"
295 # These are the main targets:
296 # build builds the library to OBJROOT and SYMROOT
297 # installsrc copies the sources to SRCROOT
298 # installhdrs install only the headers to DSTROOT
299 # install build, then install the headers and library to DSTROOT
300 # clean removes build products in OBJROOT and SYMROOT
302 # optimized same as 'build' but builds optimized library only
303 # debug same as 'build' but builds debug library only
304 # profile same as 'build' but builds profile library only
306 # Default build doesn't currently build the debug library.
307 build: prebuild build-optimized build-profile postbuild
309 optimized: prebuild build-optimized postbuild
310 debug: prebuild build-debug postbuild
311 profile: prebuild build-profile postbuild
314 $(SILENT) $(ECHO) "Installing source from . to $(SRCROOT)..."
315 ifeq "$(SRCROOT)" "."
316 $(SILENT) $(ECHO) "SRCROOT must be defined to be the destination directory; it cannot be '.'"
319 $(SILENT) $(TAR) -cf $(SRCROOT)/objc4.sources.tar $(SOURCES) $(PUBLIC_HEADERS) $(PRIVATE_HEADERS) $(OTHER_HEADERS) $(OTHER_SOURCES) $(MODULE_SOURCES)
320 $(SILENT) $(CD) $(SRCROOT) && $(TAR) -xf $(SRCROOT)/objc4.sources.tar
321 $(SILENT) $(REMOVE) -f $(SRCROOT)/objc4.sources.tar
324 $(SILENT) $(ECHO) "Installing headers from $(SRCROOT) to $(DSTROOT)/$(HEADER_INSTALLDIR)..."
326 $(SILENT) $(MKDIRS) $(DSTROOT)/$(PUBLIC_HEADER_INSTALLDIR)
327 -$(SILENT) $(CHMOD) +w $(DSTROOT)/$(PUBLIC_HEADER_INSTALLDIR)/*.h
328 $(SILENT) $(COPY) $(addprefix $(SRCROOT)/, $(PUBLIC_HEADERS) ) \
329 $(DSTROOT)/$(PUBLIC_HEADER_INSTALLDIR)
330 # duplicate hashtable2.h to hashtable.h
331 $(SILENT) $(COPY) $(DSTROOT)/$(PUBLIC_HEADER_INSTALLDIR)/hashtable2.h \
332 $(DSTROOT)/$(PUBLIC_HEADER_INSTALLDIR)/hashtable.h
333 $(SILENT) $(CHMOD) -w $(DSTROOT)/$(PUBLIC_HEADER_INSTALLDIR)/*.h
334 $(SILENT) $(CHMOD) a+r $(DSTROOT)/$(PUBLIC_HEADER_INSTALLDIR)/*.h
336 $(SILENT) $(MKDIRS) $(DSTROOT)/$(OTHER_HEADER_INSTALLDIR)
337 -$(SILENT) $(CHMOD) +w $(DSTROOT)/$(OTHER_HEADER_INSTALLDIR)/*.h
338 $(SILENT) $(COPY) $(addprefix $(SRCROOT)/, $(OTHER_HEADERS) ) \
339 $(DSTROOT)/$(OTHER_HEADER_INSTALLDIR)
340 $(SILENT) $(CHMOD) -w $(DSTROOT)/$(OTHER_HEADER_INSTALLDIR)/*.h
341 $(SILENT) $(CHMOD) a+r $(DSTROOT)/$(OTHER_HEADER_INSTALLDIR)/*.h
344 $(SILENT) $(RM) -f $(DSTROOT)$(PUBLIC_HEADER_DIR)$(PUBLIC_HEADER_DIR_SUFFIX)/hashtable.h
347 install: build installhdrs
348 $(SILENT) $(ECHO) "Installing products from $(SYMROOT) to $(DSTROOT)..."
350 $(SILENT) $(MKDIRS) $(DSTROOT)/$(INSTALLDIR)
351 -$(SILENT) $(CHMOD) +w $(DSTROOT)/$(INSTALLDIR)
353 $(SILENT) $(REMOVE) -f $(DSTROOT)/$(INSTALLDIR)/libobjc.$(VERSION_NAME)$(LIBRARY_EXT)
354 $(SILENT) $(REMOVE) -f $(DSTROOT)/$(INSTALLDIR)/libobjc_debug.$(VERSION_NAME)$(LIBRARY_EXT)
355 $(SILENT) $(REMOVE) -f $(DSTROOT)/$(INSTALLDIR)/libobjc_profile.$(VERSION_NAME)$(LIBRARY_EXT)
358 $(SILENT) $(COPY) $(SYMROOT)/libobjc.$(VERSION_NAME)$(LIBRARY_EXT) $(DSTROOT)/$(INSTALLDIR)
359 $(SILENT) $(STRIP) -S $(DSTROOT)/$(INSTALLDIR)/libobjc.$(VERSION_NAME)$(LIBRARY_EXT)
360 -$(SILENT) $(CHOWN) root:wheel $(DSTROOT)/$(INSTALLDIR)/libobjc.$(VERSION_NAME)$(LIBRARY_EXT)
361 $(SILENT) $(CHMOD) 755 $(DSTROOT)/$(INSTALLDIR)/libobjc.$(VERSION_NAME)$(LIBRARY_EXT)
362 $(SILENT) $(CD) $(DSTROOT)/$(INSTALLDIR) && \
363 $(SYMLINK) libobjc.$(VERSION_NAME)$(LIBRARY_EXT) libobjc$(LIBRARY_EXT)
365 # debug (allowed not to exist)
366 -$(SILENT) $(COPY) $(SYMROOT)/libobjc_debug.$(VERSION_NAME)$(LIBRARY_EXT) $(DSTROOT)/$(INSTALLDIR)
367 -$(SILENT) $(CHOWN) root:wheel $(DSTROOT)/$(INSTALLDIR)/libobjc_debug.$(VERSION_NAME)$(LIBRARY_EXT)
368 -$(SILENT) $(CHMOD) 755 $(DSTROOT)/$(INSTALLDIR)/libobjc_debug.$(VERSION_NAME)$(LIBRARY_EXT)
369 -$(SILENT) $(CD) $(DSTROOT)/$(INSTALLDIR) && \
370 test -e libobjc_debug.$(VERSION_NAME)$(LIBRARY_EXT) && \
371 $(SYMLINK) libobjc_debug.$(VERSION_NAME)$(LIBRARY_EXT) libobjc_debug$(LIBRARY_EXT) && \
372 $(SYMLINK) libobjc_debug.$(VERSION_NAME)$(LIBRARY_EXT) libobjc.$(VERSION_NAME)_debug$(LIBRARY_EXT)
375 # profile (allowed not to exist)
376 -$(SILENT) $(COPY) $(SYMROOT)/libobjc_profile.$(VERSION_NAME)$(LIBRARY_EXT) $(DSTROOT)/$(INSTALLDIR)
377 -$(SILENT) $(CHOWN) root:wheel $(DSTROOT)/$(INSTALLDIR)/libobjc_profile.$(VERSION_NAME)$(LIBRARY_EXT)
378 -$(SILENT) $(CHMOD) 755 $(DSTROOT)/$(INSTALLDIR)/libobjc_profile.$(VERSION_NAME)$(LIBRARY_EXT)
379 -$(SILENT) $(CD) $(DSTROOT)/$(INSTALLDIR) && \
380 test -e libobjc_profile.$(VERSION_NAME)$(LIBRARY_EXT) && \
381 $(SYMLINK) libobjc_profile.$(VERSION_NAME)$(LIBRARY_EXT) libobjc_profile$(LIBRARY_EXT) && \
382 $(SYMLINK) libobjc_profile.$(VERSION_NAME)$(LIBRARY_EXT) libobjc.$(VERSION_NAME)_profile$(LIBRARY_EXT)
386 $(SILENT) $(ECHO) "Deleting build products..."
387 $(SILENT) $(REMOVE) -f \
388 $(foreach A, $(ARCH_LIST), \
389 $(OBJROOT)/libobjc_debug.$A.$(VERSION_NAME)$(LIBRARY_EXT) \
390 $(OBJROOT)/libobjc_profile.$A.$(VERSION_NAME)$(LIBRARY_EXT) \
391 $(OBJROOT)/libobjc.$A.$(VERSION_NAME)$(LIBRARY_EXT) \
392 $(OBJROOT)/runtime/objc-rtp-sym.$A.o \
393 $(OBJROOT)/runtime/objc-rtp-sym.$A.o.temp \
396 $(SILENT) $(REMOVE) -f $(SYMROOT)/libobjc.optimized.o
397 $(SILENT) $(REMOVE) -f $(SYMROOT)/libobjc.debug.o
398 $(SILENT) $(REMOVE) -f $(SYMROOT)/libobjc.profile.o
400 $(SILENT) $(REMOVE) -f $(SYMROOT)/libobjc.$(VERSION_NAME)$(LIBRARY_EXT)
401 $(SILENT) $(REMOVE) -f $(SYMROOT)/libobjc_debug.$(VERSION_NAME)$(LIBRARY_EXT)
402 $(SILENT) $(REMOVE) -f $(SYMROOT)/libobjc_profile.$(VERSION_NAME)$(LIBRARY_EXT)
404 $(SILENT) $(REMOVE) -f $(OBJECTS_OPTIMIZED)
405 $(SILENT) $(REMOVE) -f $(OBJECTS_DEBUG)
406 $(SILENT) $(REMOVE) -f $(OBJECTS_PROFILE)
408 $(SILENT) $(REMOVE) -f $(MODULE_OBJECTS_OPTIMIZED)
409 $(SILENT) $(REMOVE) -f $(MODULE_OBJECTS_DEBUG)
410 $(SILENT) $(REMOVE) -f $(MODULE_OBJECTS_PROFILE)
412 $(SILENT) $(REMOVE) -rf $(SYMROOT)/ProjectHeaders
415 $(SILENT) $(ECHO) "Prebuild-setup..."
417 # Install headers into $(SYMROOT)/ProjectHeaders so #includes can find them
418 # even if they're not installed in /usr.
419 $(SILENT) $(MKDIRS) $(SYMROOT)
420 $(SILENT) $(REMOVE_RECUR) $(SYMROOT)/ProjectHeaders
421 $(SILENT) $(MKDIRS) $(SYMROOT)/ProjectHeaders
422 $(SILENT) $(ECHO) "Copying headers from $(SRCROOT) to $(SYMROOT)/ProjectHeaders..."
423 $(SILENT) $(COPY) $(addprefix $(SRCROOT)/, $(PRIVATE_HEADERS) ) $(SYMROOT)/ProjectHeaders
424 $(SILENT) $(MKDIRS) $(SYMROOT)/ProjectHeaders/objc
425 $(SILENT) $(COPY) $(addprefix $(SRCROOT)/, $(PUBLIC_HEADERS) ) $(SYMROOT)/ProjectHeaders/objc
426 $(SILENT) $(COPY) $(addprefix $(SRCROOT)/, $(OTHER_HEADERS) ) $(SYMROOT)/ProjectHeaders/objc
430 build-optimized: prebuild-optimized compile-optimized link-optimized
431 build-debug: prebuild-debug compile-debug link-debug
432 build-profile: prebuild-profile compile-profile link-profile
436 $(SILENT) $(ECHO) "Building (optimized) ..."
437 $(SILENT) $(MKDIRS) $(foreach S, $(SUBDIRS), $(OBJROOT)/$(S) )
440 $(SILENT) $(ECHO) "Building (debug) ..."
441 $(SILENT) $(MKDIRS) $(foreach S, $(SUBDIRS), $(OBJROOT)/$(S) )
444 $(SILENT) $(ECHO) "Building (profile) ..."
445 $(SILENT) $(MKDIRS) $(foreach S, $(SUBDIRS), $(OBJROOT)/$(S) )
448 compile-optimized: $(OBJECTS_OPTIMIZED) $(MODULE_OBJECTS_OPTIMIZED) $(foreach A, $(ARCH_LIST), $(OBJROOT)/runtime/objc-rtp-sym.$A.o )
449 compile-debug: $(OBJECTS_DEBUG) $(MODULE_OBJECTS_DEBUG) $(foreach A, $(ARCH_LIST), $(OBJROOT)/runtime/objc-rtp-sym.$A.o )
450 compile-profile: $(OBJECTS_PROFILE) $(MODULE_OBJECTS_PROFILE) $(foreach A, $(ARCH_LIST), $(OBJROOT)/runtime/objc-rtp-sym.$A.o )
453 # link lib-suffix, LDFLAGS, OBJECTS, MODULE_OBJECTS
454 # libsuffix should be "" or _debug or _profile
455 ifeq "$(PLATFORM)" "Darwin"
458 $(foreach A, $(ARCH_LIST), \
461 -o $(OBJROOT)/libobjc$1.$A.o \
465 -Wl,-exported_symbols_list,$(SRCROOT)/objc-exports-$(A) \
467 -sectcreate __DATA __commpage $(OBJROOT)/runtime/objc-rtp-sym.$A.o \
468 -install_name /$(INSTALLDIR)/libobjc$1.$(VERSION_NAME)$(LIBRARY_EXT) \
469 -o $(OBJROOT)/libobjc$1.$A.$(VERSION_NAME)$(LIBRARY_EXT) \
470 $(OBJROOT)/libobjc$1.$A.o $4 ; \
473 -create -output $(SYMROOT)/libobjc$1.$(VERSION_NAME)$(LIBRARY_EXT) \
474 $(foreach A, $(ARCH_LIST), -arch $A $(OBJROOT)/libobjc$1.$A.$(VERSION_NAME)$(LIBRARY_EXT) )
480 $(SILENT) $(ECHO) "Don't know how to link for platform '$(PLATFORM)'"
487 $(SILENT) $(ECHO) "Linking (optimized)..."
488 $(call link,,$(LDFLAGS_OPTIMIZED),$(OBJECTS_OPTIMIZED),$(MODULE_OBJECTS_OPTIMIZED) )
491 $(SILENT) $(ECHO) "Linking (debug)..."
492 $(call link,_debug,$(LDFLAGS_DEBUG),$(OBJECTS_DEBUG),$(MODULE_OBJECTS_DEBUG) )
495 $(SILENT) $(ECHO) "Linking (profile)..."
496 $(call link,_profile,$(LDFLAGS_PROFILE),$(OBJECTS_PROFILE),$(MODULE_OBJECTS_PROFILE) )
500 $(SILENT) $(ECHO) "Done!"