1 # Simple makefile for building CoreFoundation on Darwin
3 # These make variables (or environment variables) are used
5 # SRCROOT path location of root of source hierarchy;
6 # defaults to ".", but must be set to a
7 # destination path for installsrc target.
8 # OBJROOT path location where .o files will be put;
9 # defaults to "/tmp/CoreFoundation.obj".
10 # SYMROOT path location where build products will be
11 # put; defaults to "/tmp/CoreFoundation.sym".
12 # DSTROOT path location where installed products will
13 # be put; defaults to "/tmp/CoreFoundation.dst".
14 # OBJROOT and SYMROOT should not be directories shared with other
15 # built projects, and should not be the same directory.
16 # PLATFORM name of platform being built on
17 # USER name of user building the project
18 # ARCHS list of archs for which to build
19 # RC_ARCHS more archs for which to build (build system)
20 # OTHER_CFLAGS other flags to be passed to compiler
21 # RC_CFLAGS more flags to be passed to compiler (build system)
22 # OTHER_LFLAGS other flags to be passed to the link stage
25 CURRENT_PROJECT_VERSION = 299.3
27 # First figure out the platform if not specified, so we can use it in the
28 # rest of this file. Currently defined values: Darwin, Linux, FreeBSD, WIN32
30 PLATFORM := $(shell uname)
33 ifeq "$(PLATFORM)" "Darwin"
34 PLATFORM_CFLAGS = -D__MACH__=1 -fconstant-cfstrings
37 ifeq "$(PLATFORM)" "Linux"
38 PLATFORM_CFLAGS = -D__LINUX__=1
41 ifeq "$(PLATFORM)" "FreeBSD"
42 PLATFORM_CFLAGS = -D__FREEBSD__=1
45 ifeq "$(PLATFORM)" "WIN32"
46 PLATFORM_CFLAGS = -D__WIN32__=1
47 OBJROOT = CoreFoundation.obj
48 SYMROOT = CoreFoundation.sym
49 DSTROOT = CoreFoundation.dst
57 OBJROOT = /tmp/CoreFoundation.obj
61 SYMROOT = /tmp/CoreFoundation.sym
65 DSTROOT = /tmp/CoreFoundation.dst
69 ifeq "$(PLATFORM)" "WIN32"
84 ifeq "$(PLATFORM)" "Darwin"
90 MKDIRS = /bin/mkdir -p
92 COPY_RECUR = /bin/cp -r
94 REMOVE_RECUR = /bin/rm -rf
97 CHOWN = /usr/sbin/chown
99 STRIP = /usr/bin/strip
102 ifeq "$(PLATFORM)" "Darwin"
103 WARNING_FLAGS = -Wno-precomp -Wno-four-char-constants
106 ifeq "$(PLATFORM)" "Darwin"
108 ARCH_FLAGS = $(foreach A, $(ARCHS), $(addprefix -arch , $(A)))
110 ifneq "$(RC_ARCHS)" ""
111 ARCH_FLAGS = $(foreach A, $(RC_ARCHS), $(addprefix -arch , $(A)))
113 ARCH_FLAGS = -arch ppc
118 ifeq "$(PLATFORM)" "FreeBSD"
119 ARCH_FLAGS = -march=i386
122 ifeq "$(PLATFORM)" "Linux"
130 CFLAGS = -DCF_BUILDING_CF=1 -g -fno-common -pipe $(PLATFORM_CFLAGS) \
131 $(WARNING_FLAGS) -I$(SYMROOT)/ProjectHeaders -I.
133 ifeq "$(PLATFORM)" "WIN32"
134 LFLAGS = -lmsvcrt -lnetapi32 -lobjc -lole32 -lws2_32
139 ifeq "$(wildcard /System/Library/Frameworks)" ""
140 LIBRARY_STYLE = Library
142 ifeq "$(PLATFORM)" "Linux"
145 ifeq "$(PLATFORM)" "WIN32"
148 HEADER_INSTALLDIR = /usr/local/include/CoreFoundation
149 INSTALLDIR = /usr/local/lib
150 CHARACTERSETS_INSTALLDIR = /usr/local/share/CoreFoundation
152 LIBRARY_STYLE = Framework
153 INSTALLDIR = /System/Library/Frameworks
154 FRAMEWORK_DIR = /System/Library/Frameworks/CoreFoundation.framework
155 CHARACTERSETS_INSTALLDIR = /System/Library/CoreServices
158 ifeq "$(PLATFORM)" "Darwin"
159 CFLAGS += $(ARCH_FLAGS) -F$(SYMROOT)
160 LFLAGS += $(ARCH_FLAGS) -dynamiclib -dynamic -compatibility_version 150 \
161 -current_version $(CURRENT_PROJECT_VERSION) -Wl,-init,___CFInitialize
164 ifeq "$(PLATFORM)" "FreeBSD"
168 ifeq "$(PLATFORM)" "Linux"
172 CFLAGS += $(OTHER_CFLAGS) $(RC_CFLAGS)
173 LFLAGS += $(OTHER_LFLAGS)
176 SUBPROJECTS = AppServices Base Collections Locale NumberDate Parsing PlugIn \
177 RunLoop String StringEncodings URL
179 AppServices_PUBHEADERS = CFUserNotification.h
180 AppServices_SOURCES = CFUserNotification.c
181 Base_PROJHEADERS = CFPriv.h CFInternal.h ForFoundationOnly.h CFRuntime.h \
183 Base_PUBHEADERS = CFBase.h CFByteOrder.h CoreFoundation.h CFUUID.h
184 Base_SOURCES = CFBase.c CFUtilities.c CFSortFunctions.c \
185 CFRuntime.c CFFileUtilities.c CFPlatform.c CFUUID.c uuid.c
186 Collections_PROJHEADERS = CFStorage.h
187 Collections_PUBHEADERS = CFArray.h CFBag.h CFBinaryHeap.h CFBitVector.h \
188 CFData.h CFDictionary.h CFSet.h CFTree.h
189 Collections_SOURCES = CFArray.c CFBag.c CFBinaryHeap.c CFBitVector.c \
190 CFData.c CFDictionary.c CFSet.c CFStorage.c CFTree.c
191 Locale_PUBHEADERS = CFLocale.h
192 NumberDate_PROJHEADERS =
193 NumberDate_PUBHEADERS = CFDate.h CFNumber.h CFTimeZone.h
194 NumberDate_SOURCES = CFDate.c CFNumber.c CFTimeZone.c
195 Parsing_PROJHEADERS = CFXMLInputStream.h
196 Parsing_PUBHEADERS = CFPropertyList.h CFXMLParser.h CFXMLNode.h
197 Parsing_SOURCES = CFBinaryPList.c CFPropertyList.c CFXMLParser.c \
198 CFXMLInputStream.c CFXMLNode.c CFXMLTree.c
199 PlugIn_PROJHEADERS = CFBundlePriv.h CFBundle_BinaryTypes.h CFBundle_Internal.h \
201 PlugIn_PUBHEADERS = CFBundle.h CFPlugIn.h CFPlugInCOM.h
202 PlugIn_SOURCES = CFBundle.c CFBundle_Resources.c CFPlugIn.c CFPlugIn_Factory.c \
203 CFPlugIn_Instance.c CFPlugIn_PlugIn.c
204 ifeq "$(PLATFORM)" "Darwin"
205 RunLoop_PROJHEADERS = CFWindowsMessageQueue.h
206 RunLoop_PUBHEADERS = CFRunLoop.h CFSocket.h CFMachPort.h CFMessagePort.h
207 RunLoop_SOURCES = CFMachPort.c CFMessagePort.c CFRunLoop.c CFSocket.c \
208 CFWindowsMessageQueue.c
210 ifeq "$(PLATFORM)" "WIN32"
211 RunLoop_PROJHEADERS =
212 RunLoop_PUBHEADERS = CFRunLoop.h CFMachPort.h CFMessagePort.h
213 RunLoop_SOURCES = CFMachPort.c CFMessagePort.c CFRunLoop.c
215 String_PROJHEADERS = CFCharacterSetPriv.h
216 String_PUBHEADERS = CFCharacterSet.h CFString.h
217 String_SOURCES = CFCharacterSet.c CFString.c CFStringEncodings.c \
218 CFStringScanner.c CFStringUtilities.c
219 StringEncodings_PROJHEADERS = CFStringEncodingConverter.h CFUniChar.h \
220 CFStringEncodingConverterExt.h CFUniCharPriv.h \
221 CFStringEncodingConverterPriv.h CFUnicodeDecomposition.h \
222 CFUnicodePrecomposition.h
223 StringEncodings_PUBHEADERS =
224 StringEncodings_SOURCES = CFStringEncodingConverter.c CFBuiltinConverters.c \
225 CFUnicodeDecomposition.c CFUnicodePrecomposition.c CFUniChar.c
227 URL_PUBHEADERS = CFURL.h CFURLAccess.h
228 URL_SOURCES = CFURL.c CFURLAccess.c
230 OTHER_SOURCES = version.c Makefile APPLE_LICENSE PropertyList.dtd
234 build: prebuild actual-build postbuild
236 # These are the main targets:
237 # build builds the library to OBJROOT and SYMROOT
238 # installsrc copies the sources to SRCROOT
239 # installhdrs install only the headers to DSTROOT
240 # install build, then install the headers and library to DSTROOT
241 # clean removes build products in OBJROOT and SYMROOT
244 $(SILENT) $(ECHO) "Installing source..."
245 ifeq "$(SRCROOT)" "."
246 $(SILENT) $(ECHO) "SRCROOT must be defined to be the destination directory; it cannot be '.'"
249 $(SILENT) $(MKDIRS) $(SRCROOT)
250 $(SILENT) $(MKDIRS) $(foreach S, $(SUBPROJECTS), $(SRCROOT)/$(S).subproj)
251 -$(SILENT) $(foreach S, $(SUBPROJECTS), $(COPY) $(foreach F, $($(S)_SOURCES), $(S).subproj/$(F)) $(SRCROOT)/$(S).subproj;)
252 -$(SILENT) $(foreach S, $(SUBPROJECTS), $(COPY) $(foreach F, $($(S)_PROJHEADERS), $(S).subproj/$(F)) $(SRCROOT)/$(S).subproj;)
253 -$(SILENT) $(foreach S, $(SUBPROJECTS), $(COPY) $(foreach F, $($(S)_PUBHEADERS), $(S).subproj/$(F)) $(SRCROOT)/$(S).subproj;)
254 $(SILENT) $(COPY) $(OTHER_SOURCES) $(SRCROOT)
255 $(SILENT) $(COPY_RECUR) CharacterSets $(SRCROOT)
256 $(SILENT) $(REMOVE_RECUR) $(SRCROOT)/CharacterSets/CVS
259 $(SILENT) $(ECHO) "Installing headers..."
260 ifeq "$(LIBRARY_STYLE)" "Framework"
261 $(SILENT) $(REMOVE) -f $(DSTROOT)/$(FRAMEWORK_DIR)/Headers
262 $(SILENT) $(REMOVE) -f $(DSTROOT)/$(FRAMEWORK_DIR)/PrivateHeaders
263 $(SILENT) $(REMOVE) -f $(DSTROOT)/$(FRAMEWORK_DIR)/Versions/Current
264 $(SILENT) $(MKDIRS) $(DSTROOT)/$(FRAMEWORK_DIR)/Versions/A/Headers
265 $(SILENT) $(MKDIRS) $(DSTROOT)/$(FRAMEWORK_DIR)/Versions/A/PrivateHeaders
266 $(SILENT) $(SYMLINK) A $(DSTROOT)/$(FRAMEWORK_DIR)/Versions/Current
267 $(SILENT) $(SYMLINK) Versions/Current/Headers $(DSTROOT)/$(FRAMEWORK_DIR)/Headers
268 $(SILENT) $(SYMLINK) Versions/Current/PrivateHeaders $(DSTROOT)/$(FRAMEWORK_DIR)/PrivateHeaders
269 -$(SILENT) $(CHMOD) +w $(DSTROOT)/$(FRAMEWORK_DIR)/Versions/A/Headers/*.h
270 -$(SILENT) $(CHMOD) +w $(DSTROOT)/$(FRAMEWORK_DIR)/Versions/A/PrivateHeaders/*.h
271 $(SILENT) $(COPY) $(foreach S, $(SUBPROJECTS), $(foreach F, $($(S)_PUBHEADERS), $(SRCROOT)/$(S).subproj/$(F))) $(DSTROOT)/$(FRAMEWORK_DIR)/Versions/A/Headers
272 $(SILENT) $(COPY) Base.subproj/CFPriv.h Base.subproj/CFRuntime.h $(DSTROOT)/$(FRAMEWORK_DIR)/Versions/A/PrivateHeaders
273 $(SILENT) $(CHOWN) -R root:wheel $(DSTROOT)/$(FRAMEWORK_DIR)
274 -$(SILENT) $(CHMOD) -w $(DSTROOT)/$(FRAMEWORK_DIR)/Versions/A/Headers/*.h
275 -$(SILENT) $(CHMOD) -w $(DSTROOT)/$(FRAMEWORK_DIR)/Versions/A/PrivateHeaders/*.h
277 ifeq "$(LIBRARY_STYLE)" "Library"
278 $(SILENT) $(MKDIRS) $(DSTROOT)/$(HEADER_INSTALLDIR)
279 -$(SILENT) $(CHMOD) +w $(DSTROOT)/$(HEADER_INSTALLDIR)/*.h
280 $(SILENT) $(COPY) $(foreach S, $(SUBPROJECTS), $(foreach F, $($(S)_PUBHEADERS), $(SRCROOT)/$(S).subproj/$(F))) $(DSTROOT)/$(HEADER_INSTALLDIR)
281 $(SILENT) $(CHMOD) -w $(DSTROOT)/$(HEADER_INSTALLDIR)/*.h
285 $(SILENT) $(ECHO) "Installing..."
286 ifeq "$(LIBRARY_STYLE)" "Framework"
287 $(SILENT) $(MKDIRS) $(DSTROOT)/$(FRAMEWORK_DIR)
288 -$(SILENT) $(CHMOD) -R +w $(DSTROOT)/$(FRAMEWORK_DIR)
289 $(SILENT) $(REMOVE_RECUR) $(DSTROOT)/$(FRAMEWORK_DIR)
290 $(SILENT) (cd $(SYMROOT) && $(TAR) -cf - CoreFoundation.framework) | (cd $(DSTROOT)/$(INSTALLDIR) && $(TAR) -xf -)
291 $(SILENT) $(STRIP) -S $(DSTROOT)/$(FRAMEWORK_DIR)/Versions/A/CoreFoundation
292 $(SILENT) $(STRIP) -S $(DSTROOT)/$(FRAMEWORK_DIR)/Versions/A/CoreFoundation_debug
293 $(SILENT) $(STRIP) -S $(DSTROOT)/$(FRAMEWORK_DIR)/Versions/A/CoreFoundation_profile
294 $(SILENT) $(CHMOD) -R ugo-w $(DSTROOT)/$(FRAMEWORK_DIR)
295 $(SILENT) $(CHMOD) -R o+rX $(DSTROOT)/$(FRAMEWORK_DIR)
296 $(SILENT) $(CHOWN) -R root:wheel $(DSTROOT)/$(FRAMEWORK_DIR)
298 ifeq "$(LIBRARY_STYLE)" "Library"
299 $(SILENT) $(MKDIRS) $(DSTROOT)/$(INSTALLDIR)
300 -$(SILENT) $(CHMOD) +w $(DSTROOT)/$(INSTALLDIR)
301 $(SILENT) $(REMOVE) -f $(DSTROOT)/$(INSTALLDIR)/libCoreFoundation$(LIBRARY_EXT)
302 $(SILENT) $(REMOVE) -f $(DSTROOT)/$(INSTALLDIR)/libCoreFoundation_debug$(LIBRARY_EXT)
303 $(SILENT) $(REMOVE) -f $(DSTROOT)/$(INSTALLDIR)/libCoreFoundation_profile$(LIBRARY_EXT)
304 $(SILENT) $(COPY) $(SYMROOT)/libCoreFoundation$(LIBRARY_EXT) $(DSTROOT)/$(INSTALLDIR)/libCoreFoundation$(LIBRARY_EXT)
305 ifneq "$(LIBRARY_EXT)" ".a"
306 $(SILENT) $(COPY) $(SYMROOT)/libCoreFoundation_debug$(LIBRARY_EXT) $(DSTROOT)/$(INSTALLDIR)/libCoreFoundation_debug$(LIBRARY_EXT)
307 $(SILENT) $(COPY) $(SYMROOT)/libCoreFoundation_profile$(LIBRARY_EXT) $(DSTROOT)/$(INSTALLDIR)/libCoreFoundation_profile$(LIBRARY_EXT)
309 -$(SILENT) $(CHOWN) root:wheel $(DSTROOT)/$(INSTALLDIR)/libCoreFoundation$(LIBRARY_EXT)
310 -$(SILENT) $(CHOWN) root:wheel $(DSTROOT)/$(INSTALLDIR)/libCoreFoundation_debug$(LIBRARY_EXT)
311 -$(SILENT) $(CHOWN) root:wheel $(DSTROOT)/$(INSTALLDIR)/libCoreFoundation_profile$(LIBRARY_EXT)
312 $(SILENT) $(CHMOD) 755 $(DSTROOT)/$(INSTALLDIR)/libCoreFoundation$(LIBRARY_EXT)
313 ifneq "$(LIBRARY_EXT)" ".a"
314 $(SILENT) $(CHMOD) 755 $(DSTROOT)/$(INSTALLDIR)/libCoreFoundation_debug$(LIBRARY_EXT)
315 $(SILENT) $(CHMOD) 755 $(DSTROOT)/$(INSTALLDIR)/libCoreFoundation_profile$(LIBRARY_EXT)
317 $(SILENT) $(MKDIRS) $(DSTROOT)/$(HEADER_INSTALLDIR)
318 -$(SILENT) $(CHMOD) +w $(DSTROOT)/$(HEADER_INSTALLDIR)/*.h
319 $(SILENT) $(COPY) $(foreach S, $(SUBPROJECTS), $(foreach F, $($(S)_PUBHEADERS), $(SRCROOT)/$(S).subproj/$(F))) $(DSTROOT)/$(HEADER_INSTALLDIR)
320 $(SILENT) $(CHMOD) -w $(DSTROOT)/$(HEADER_INSTALLDIR)/*.h
322 $(SILENT) $(MKDIRS) $(DSTROOT)/$(CHARACTERSETS_INSTALLDIR)
323 -$(SILENT) $(CHMOD) 755 $(DSTROOT)/$(CHARACTERSETS_INSTALLDIR)
324 $(SILENT) $(MKDIRS) $(DSTROOT)/$(CHARACTERSETS_INSTALLDIR)/CharacterSets
325 -$(SILENT) $(CHMOD) -R +w $(DSTROOT)/$(CHARACTERSETS_INSTALLDIR)/CharacterSets
326 $(SILENT) $(REMOVE_RECUR) $(DSTROOT)/$(CHARACTERSETS_INSTALLDIR)/CharacterSets
327 $(SILENT) $(COPY_RECUR) $(SRCROOT)/CharacterSets $(DSTROOT)/$(CHARACTERSETS_INSTALLDIR)
328 $(SILENT) $(REMOVE_RECUR) $(DSTROOT)/$(CHARACTERSETS_INSTALLDIR)/CharacterSets/CVS
329 $(SILENT) $(CHOWN) -R root:wheel $(DSTROOT)/$(CHARACTERSETS_INSTALLDIR)/CharacterSets
330 $(SILENT) $(CHMOD) 444 $(DSTROOT)/$(CHARACTERSETS_INSTALLDIR)/CharacterSets/*
331 $(SILENT) $(CHMOD) 755 $(DSTROOT)/$(CHARACTERSETS_INSTALLDIR)/CharacterSets
334 $(SILENT) $(ECHO) "Deleting build products..."
335 $(SILENT) $(REMOVE_RECUR) $(SYMROOT)/ProjectHeaders
336 ifeq "$(LIBRARY_STYLE)" "Framework"
337 $(SILENT) $(REMOVE_RECUR) $(SYMROOT)/CoreFoundation.framework
339 ifeq "$(LIBRARY_STYLE)" "Library"
340 $(SILENT) $(REMOVE) -f $(SYMROOT)/libCoreFoundation$(LIBRARY_EXT)
341 $(SILENT) $(REMOVE) -f $(SYMROOT)/libCoreFoundation_debug$(LIBRARY_EXT)
342 $(SILENT) $(REMOVE) -f $(SYMROOT)/libCoreFoundation_profile$(LIBRARY_EXT)
344 ifeq "$(PLATFORM)" "WIN32"
345 $(SILENT) $(REMOVE) -f $(SYMROOT)/CoreFoundation*$(LIBRARY_EXT)
346 $(SILENT) $(REMOVE) -f $(SYMROOT)/CoreFoundation*.lib
348 $(SILENT) $(REMOVE) -f $(OBJROOT)/*.o
351 $(SILENT) $(ECHO) "Prebuild-setup..."
352 ifeq "$(LIBRARY_STYLE)" "Framework"
353 $(SILENT) $(MKDIRS) $(SYMROOT)
354 $(SILENT) $(REMOVE_RECUR) $(SYMROOT)/ProjectHeaders
355 $(SILENT) $(MKDIRS) $(SYMROOT)/ProjectHeaders
356 # $(SILENT) $(REMOVE_RECUR) $(SYMROOT)/CoreFoundation.framework
357 $(SILENT) $(REMOVE) -f $(SYMROOT)/CoreFoundation.framework/Versions/Current
358 $(SILENT) $(REMOVE) -f $(SYMROOT)/CoreFoundation.framework/Headers
359 $(SILENT) $(REMOVE) -f $(SYMROOT)/CoreFoundation.framework/PrivateHeaders
360 $(SILENT) $(REMOVE) -f $(SYMROOT)/CoreFoundation.framework/Resources
361 $(SILENT) $(MKDIRS) $(SYMROOT)/CoreFoundation.framework/Versions/A/Headers
362 $(SILENT) $(MKDIRS) $(SYMROOT)/CoreFoundation.framework/Versions/A/PrivateHeaders
363 $(SILENT) $(MKDIRS) $(SYMROOT)/CoreFoundation.framework/Versions/A/Resources
364 $(SILENT) $(SYMLINK) A $(SYMROOT)/CoreFoundation.framework/Versions/Current
365 $(SILENT) $(SYMLINK) Versions/Current/Headers $(SYMROOT)/CoreFoundation.framework/Headers
366 $(SILENT) $(SYMLINK) Versions/Current/PrivateHeaders $(SYMROOT)/CoreFoundation.framework/PrivateHeaders
367 $(SILENT) $(SYMLINK) Versions/Current/Resources $(SYMROOT)/CoreFoundation.framework/Resources
368 $(SILENT) $(ECHO) "Copying headers..."
369 $(SILENT) $(COPY) $(foreach S, $(SUBPROJECTS), $(foreach F, $($(S)_PROJHEADERS), $(SRCROOT)/$(S).subproj/$(F))) $(SYMROOT)/ProjectHeaders
370 $(SILENT) $(COPY) $(foreach S, $(SUBPROJECTS), $(foreach F, $($(S)_PUBHEADERS), $(SRCROOT)/$(S).subproj/$(F))) $(SYMROOT)/CoreFoundation.framework/Versions/A/Headers
371 $(SILENT) $(COPY) Base.subproj/CFPriv.h Base.subproj/CFRuntime.h $(SYMROOT)/CoreFoundation.framework/Versions/A/PrivateHeaders
373 ifeq "$(LIBRARY_STYLE)" "Library"
374 $(SILENT) $(MKDIRS) $(SYMROOT)
375 $(SILENT) $(REMOVE_RECUR) $(SYMROOT)/ProjectHeaders
376 $(SILENT) $(MKDIRS) $(SYMROOT)/ProjectHeaders
377 $(SILENT) $(ECHO) "Copying headers..."
378 $(SILENT) $(COPY) $(foreach S, $(SUBPROJECTS), $(foreach F, $($(S)_PROJHEADERS), $(SRCROOT)/$(S).subproj/$(F))) $(SYMROOT)/ProjectHeaders
379 $(SILENT) $(MKDIRS) $(SYMROOT)/ProjectHeaders/CoreFoundation
380 $(SILENT) $(COPY) $(foreach S, $(SUBPROJECTS), $(foreach F, $($(S)_PUBHEADERS), $(SRCROOT)/$(S).subproj/$(F))) $(SYMROOT)/ProjectHeaders/CoreFoundation
384 $(SILENT) $(ECHO) "Building..."
385 $(SILENT) $(MKDIRS) $(OBJROOT)
386 $(SILENT) for x in $(foreach S, $(SUBPROJECTS), $(foreach F, $($(S)_SOURCES), $(SRCROOT)/$(S).subproj/$(F))) ; do \
387 if [ ! $(OBJROOT)/`basename $$x .c`.opt.o -nt $$x ] ; then \
388 $(ECHO) " ..." $$x " (optimized)" ; \
389 $(CC) $(CFLAGS) $$x -O -c -o $(OBJROOT)/`basename $$x .c`.opt.o ; \
391 if [ ! $(OBJROOT)/`basename $$x .c`.debug.o -nt $$x ] ; then \
392 $(ECHO) " ..." $$x " (debug)" ; \
393 $(CC) $(CFLAGS) $$x -DDEBUG -c -o $(OBJROOT)/`basename $$x .c`.debug.o ; \
395 if [ ! $(OBJROOT)/`basename $$x .c`.profile.o -nt $$x ] ; then \
396 $(ECHO) " ..." $$x " (profile)" ; \
397 $(CC) $(CFLAGS) $$x -DPROFILE -pg -O -c -o $(OBJROOT)/`basename $$x .c`.profile.o ; \
400 $(SILENT) $(CC) $(CFLAGS) $(SRCROOT)/version.c -DVERSION=$(CURRENT_PROJECT_VERSION) -DUSER=$(USER) -O -c -o $(OBJROOT)/version.opt.o
401 $(SILENT) $(CC) $(CFLAGS) $(SRCROOT)/version.c -DVERSION=$(CURRENT_PROJECT_VERSION) -DUSER=$(USER) -DDEBUG -c -o $(OBJROOT)/version.debug.o
402 $(SILENT) $(CC) $(CFLAGS) $(SRCROOT)/version.c -DVERSION=$(CURRENT_PROJECT_VERSION) -DUSER=$(USER) -DPROFILE -pg -O -c -o $(OBJROOT)/version.profile.o
403 $(SILENT) $(ECHO) "Linking..."
404 ifeq "$(PLATFORM)" "Darwin"
405 $(SILENT) $(CC) $(LFLAGS) -O -install_name $(FRAMEWORK_DIR)/Versions/A/CoreFoundation -o $(SYMROOT)/CoreFoundation.framework/Versions/A/CoreFoundation $(OBJROOT)/*.opt.o
406 $(SILENT) $(CC) $(LFLAGS) -install_name $(FRAMEWORK_DIR)/Versions/A/CoreFoundation_debug -o $(SYMROOT)/CoreFoundation.framework/Versions/A/CoreFoundation_debug $(OBJROOT)/*.debug.o
407 $(SILENT) $(CC) $(LFLAGS) -pg -O -install_name $(FRAMEWORK_DIR)/Versions/A/CoreFoundation_profile -o $(SYMROOT)/CoreFoundation.framework/Versions/A/CoreFoundation_profile $(OBJROOT)/*.profile.o
409 ifeq "$(PLATFORM)" "Linux"
410 $(SILENT) $(ECHO) "NOTE: Producing static libraries on Linux"
411 $(SILENT) ar cr $(SYMROOT)/libCoreFoundation$(LIBRARY_EXT) $(OBJROOT)/*.opt.o
412 $(SILENT) ar cr $(SYMROOT)/libCoreFoundation_debug$(LIBRARY_EXT) $(OBJROOT)/*.debug.o
413 $(SILENT) ar cr $(SYMROOT)/libCoreFoundation_profile$(LIBRARY_EXT) $(OBJROOT)/*.profile.o
415 ifeq "$(PLATFORM)" "FreeBSD"
416 $(SILENT) $(CC) $(LFLAGS) -O -o $(SYMROOT)/libCoreFoundation$(LIBRARY_EXT) (OBJROOT)/*.opt.o
417 $(SILENT) $(CC) $(LFLAGS) -o $(SYMROOT)/libCoreFoundation_debug$(LIBRARY_EXT) (OBJROOT)/*.debug.o
418 $(SILENT) $(CC) $(LFLAGS) -pg -O -o $(SYMROOT)/libCoreFoundation_profile$(LIBRARY_EXT) (OBJROOT)/*.profile.o
420 ifeq "$(PLATFORM)" "WIN32"
421 $(SILENT) $(DLLTOOL) -e CoreFoundation -l CoreFoundation.lib $(OBJROOT)/*.opt.o
422 $(SILENT) $(CC) -mdll $(OBJROOT)/*.opt.o CoreFoundation -o CoreFoundation$(LIBRARY_EXT) $(LFLAGS)
423 $(SILENT) $(DLLTOOL) -e CoreFoundation_debug -l CoreFoundation_debug.lib $(OBJROOT)/*.debug.o
424 $(SILENT) $(CC) -mdll $(OBJROOT)/*.debug.o CoreFoundation_debug -o CoreFoundation_debug$(LIBRARY_EXT) $(LFLAGS)
425 $(SILENT) $(COPY) *.lib $(SYMROOT)
426 $(SILENT) $(COPY) *.dll $(SYMROOT)
427 $(SILENT) $(REMOVE) *.dll *.lib CoreFoundation CoreFoundation_debug
429 $(SILENT) $(ECHO) "Done!"
432 ifeq "$(LIBRARY_STYLE)" "Framework"
433 -$(SILENT) $(SYMLINK) Versions/Current/CoreFoundation $(SYMROOT)/CoreFoundation.framework/CoreFoundation
434 -$(SILENT) $(SYMLINK) Versions/Current/CoreFoundation_debug $(SYMROOT)/CoreFoundation.framework/CoreFoundation_debug
435 -$(SILENT) $(SYMLINK) Versions/Current/CoreFoundation_profile $(SYMROOT)/CoreFoundation.framework/CoreFoundation_profile