CF-299.3.tar.gz
[apple/cf.git] / Makefile
CommitLineData
9ce05555
A
1# Simple makefile for building CoreFoundation on Darwin
2#
3# These make variables (or environment variables) are used
4# if defined:
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
23#
24
fe65cb98 25CURRENT_PROJECT_VERSION = 299.3
9ce05555
A
26
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
29ifeq "$(PLATFORM)" ""
30PLATFORM := $(shell uname)
31endif
32
33ifeq "$(PLATFORM)" "Darwin"
34PLATFORM_CFLAGS = -D__MACH__=1 -fconstant-cfstrings
35endif
36
37ifeq "$(PLATFORM)" "Linux"
38PLATFORM_CFLAGS = -D__LINUX__=1
39endif
40
41ifeq "$(PLATFORM)" "FreeBSD"
42PLATFORM_CFLAGS = -D__FREEBSD__=1
43endif
44
45ifeq "$(PLATFORM)" "WIN32"
46PLATFORM_CFLAGS = -D__WIN32__=1
47OBJROOT = CoreFoundation.obj
48SYMROOT = CoreFoundation.sym
49DSTROOT = CoreFoundation.dst
50endif
51
52ifndef SRCROOT
53SRCROOT = .
54endif
55
56ifndef OBJROOT
57OBJROOT = /tmp/CoreFoundation.obj
58endif
59
60ifndef SYMROOT
61SYMROOT = /tmp/CoreFoundation.sym
62endif
63
64ifndef DSTROOT
65DSTROOT = /tmp/CoreFoundation.dst
66endif
67
68SILENT = @
69ifeq "$(PLATFORM)" "WIN32"
70CC = gcc
71ECHO = echo
72MKDIRS = mkdir -p
73COPY = cp
74COPY_RECUR = cp -r
75REMOVE = rm
76REMOVE_RECUR = rm -rf
77SYMLINK = ln -s
78CHMOD = chmod
79CHOWN = chown
80TAR = tar
81STRIP = strip
82DLLTOOL = dlltool
83else
84ifeq "$(PLATFORM)" "Darwin"
85CC = /usr/bin/cc
86else
87CC = /usr/bin/gcc
88endif
89ECHO = /bin/echo
90MKDIRS = /bin/mkdir -p
91COPY = /bin/cp
92COPY_RECUR = /bin/cp -r
93REMOVE = /bin/rm
94REMOVE_RECUR = /bin/rm -rf
95SYMLINK = /bin/ln -s
96CHMOD = /bin/chmod
97CHOWN = /usr/sbin/chown
98TAR = /usr/bin/tar
99STRIP = /usr/bin/strip
100endif
101
102ifeq "$(PLATFORM)" "Darwin"
103WARNING_FLAGS = -Wno-precomp -Wno-four-char-constants
104endif
105
106ifeq "$(PLATFORM)" "Darwin"
107ifneq "$(ARCHS)" ""
108ARCH_FLAGS = $(foreach A, $(ARCHS), $(addprefix -arch , $(A)))
109else
110ifneq "$(RC_ARCHS)" ""
111ARCH_FLAGS = $(foreach A, $(RC_ARCHS), $(addprefix -arch , $(A)))
112else
113ARCH_FLAGS = -arch ppc
114endif
115endif
116endif
117
118ifeq "$(PLATFORM)" "FreeBSD"
119ARCH_FLAGS = -march=i386
120endif
121
122ifeq "$(PLATFORM)" "Linux"
123ARCH_FLAGS =
124endif
125
126ifeq "$(USER)" ""
127USER = unknown
128endif
129
130CFLAGS = -DCF_BUILDING_CF=1 -g -fno-common -pipe $(PLATFORM_CFLAGS) \
131 $(WARNING_FLAGS) -I$(SYMROOT)/ProjectHeaders -I.
132
133ifeq "$(PLATFORM)" "WIN32"
134LFLAGS = -lmsvcrt -lnetapi32 -lobjc -lole32 -lws2_32
135else
136LFLAGS =
137endif
138
139ifeq "$(wildcard /System/Library/Frameworks)" ""
140LIBRARY_STYLE = Library
141LIBRARY_EXT = .so
142ifeq "$(PLATFORM)" "Linux"
143LIBRARY_EXT = .a
144endif
145ifeq "$(PLATFORM)" "WIN32"
146LIBRARY_EXT = .dll
147endif
148HEADER_INSTALLDIR = /usr/local/include/CoreFoundation
149INSTALLDIR = /usr/local/lib
150CHARACTERSETS_INSTALLDIR = /usr/local/share/CoreFoundation
151else
152LIBRARY_STYLE = Framework
153INSTALLDIR = /System/Library/Frameworks
154FRAMEWORK_DIR = /System/Library/Frameworks/CoreFoundation.framework
155CHARACTERSETS_INSTALLDIR = /System/Library/CoreServices
156endif
157
158ifeq "$(PLATFORM)" "Darwin"
159CFLAGS += $(ARCH_FLAGS) -F$(SYMROOT)
160LFLAGS += $(ARCH_FLAGS) -dynamiclib -dynamic -compatibility_version 150 \
161 -current_version $(CURRENT_PROJECT_VERSION) -Wl,-init,___CFInitialize
162endif
163
164ifeq "$(PLATFORM)" "FreeBSD"
165LFLAGS += -shared
166endif
167
168ifeq "$(PLATFORM)" "Linux"
169LFLAGS += -lpthread
170endif
171
172CFLAGS += $(OTHER_CFLAGS) $(RC_CFLAGS)
173LFLAGS += $(OTHER_LFLAGS)
174
175
176SUBPROJECTS = AppServices Base Collections Locale NumberDate Parsing PlugIn \
177 RunLoop String StringEncodings URL
178
179AppServices_PUBHEADERS = CFUserNotification.h
180AppServices_SOURCES = CFUserNotification.c
181Base_PROJHEADERS = CFPriv.h CFInternal.h ForFoundationOnly.h CFRuntime.h \
182 CFUtilities.h
183Base_PUBHEADERS = CFBase.h CFByteOrder.h CoreFoundation.h CFUUID.h
184Base_SOURCES = CFBase.c CFUtilities.c CFSortFunctions.c \
185 CFRuntime.c CFFileUtilities.c CFPlatform.c CFUUID.c uuid.c
186Collections_PROJHEADERS = CFStorage.h
187Collections_PUBHEADERS = CFArray.h CFBag.h CFBinaryHeap.h CFBitVector.h \
188 CFData.h CFDictionary.h CFSet.h CFTree.h
189Collections_SOURCES = CFArray.c CFBag.c CFBinaryHeap.c CFBitVector.c \
190 CFData.c CFDictionary.c CFSet.c CFStorage.c CFTree.c
191Locale_PUBHEADERS = CFLocale.h
192NumberDate_PROJHEADERS =
193NumberDate_PUBHEADERS = CFDate.h CFNumber.h CFTimeZone.h
194NumberDate_SOURCES = CFDate.c CFNumber.c CFTimeZone.c
195Parsing_PROJHEADERS = CFXMLInputStream.h
196Parsing_PUBHEADERS = CFPropertyList.h CFXMLParser.h CFXMLNode.h
197Parsing_SOURCES = CFBinaryPList.c CFPropertyList.c CFXMLParser.c \
198 CFXMLInputStream.c CFXMLNode.c CFXMLTree.c
199PlugIn_PROJHEADERS = CFBundlePriv.h CFBundle_BinaryTypes.h CFBundle_Internal.h \
200 CFPlugIn_Factory.h
201PlugIn_PUBHEADERS = CFBundle.h CFPlugIn.h CFPlugInCOM.h
202PlugIn_SOURCES = CFBundle.c CFBundle_Resources.c CFPlugIn.c CFPlugIn_Factory.c \
203 CFPlugIn_Instance.c CFPlugIn_PlugIn.c
204ifeq "$(PLATFORM)" "Darwin"
205RunLoop_PROJHEADERS = CFWindowsMessageQueue.h
206RunLoop_PUBHEADERS = CFRunLoop.h CFSocket.h CFMachPort.h CFMessagePort.h
207RunLoop_SOURCES = CFMachPort.c CFMessagePort.c CFRunLoop.c CFSocket.c \
208 CFWindowsMessageQueue.c
209endif
210ifeq "$(PLATFORM)" "WIN32"
211RunLoop_PROJHEADERS =
212RunLoop_PUBHEADERS = CFRunLoop.h CFMachPort.h CFMessagePort.h
213RunLoop_SOURCES = CFMachPort.c CFMessagePort.c CFRunLoop.c
214endif
215String_PROJHEADERS = CFCharacterSetPriv.h
216String_PUBHEADERS = CFCharacterSet.h CFString.h
217String_SOURCES = CFCharacterSet.c CFString.c CFStringEncodings.c \
218 CFStringScanner.c CFStringUtilities.c
219StringEncodings_PROJHEADERS = CFStringEncodingConverter.h CFUniChar.h \
220 CFStringEncodingConverterExt.h CFUniCharPriv.h \
221 CFStringEncodingConverterPriv.h CFUnicodeDecomposition.h \
222 CFUnicodePrecomposition.h
223StringEncodings_PUBHEADERS =
224StringEncodings_SOURCES = CFStringEncodingConverter.c CFBuiltinConverters.c \
225 CFUnicodeDecomposition.c CFUnicodePrecomposition.c CFUniChar.c
226URL_PROJHEADERS =
227URL_PUBHEADERS = CFURL.h CFURLAccess.h
228URL_SOURCES = CFURL.c CFURLAccess.c
229
230OTHER_SOURCES = version.c Makefile APPLE_LICENSE PropertyList.dtd
231
232default: build
233all: build
234build: prebuild actual-build postbuild
235
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
242
243installsrc:
244 $(SILENT) $(ECHO) "Installing source..."
245ifeq "$(SRCROOT)" "."
246 $(SILENT) $(ECHO) "SRCROOT must be defined to be the destination directory; it cannot be '.'"
247 exit 1
248endif
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
257
258installhdrs:
259 $(SILENT) $(ECHO) "Installing headers..."
260ifeq "$(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
276endif
277ifeq "$(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
282endif
283
284install: build
285 $(SILENT) $(ECHO) "Installing..."
286ifeq "$(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)
297endif
298ifeq "$(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)
305ifneq "$(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)
308endif
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)
313ifneq "$(LIBRARY_EXT)" ".a"
314 $(SILENT) $(CHMOD) 755 $(DSTROOT)/$(INSTALLDIR)/libCoreFoundation_debug$(LIBRARY_EXT)
315 $(SILENT) $(CHMOD) 755 $(DSTROOT)/$(INSTALLDIR)/libCoreFoundation_profile$(LIBRARY_EXT)
316endif
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
321endif
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
332
333clean:
334 $(SILENT) $(ECHO) "Deleting build products..."
335 $(SILENT) $(REMOVE_RECUR) $(SYMROOT)/ProjectHeaders
336ifeq "$(LIBRARY_STYLE)" "Framework"
337 $(SILENT) $(REMOVE_RECUR) $(SYMROOT)/CoreFoundation.framework
338endif
339ifeq "$(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)
343endif
344ifeq "$(PLATFORM)" "WIN32"
345 $(SILENT) $(REMOVE) -f $(SYMROOT)/CoreFoundation*$(LIBRARY_EXT)
346 $(SILENT) $(REMOVE) -f $(SYMROOT)/CoreFoundation*.lib
347endif
348 $(SILENT) $(REMOVE) -f $(OBJROOT)/*.o
349
350prebuild:
351 $(SILENT) $(ECHO) "Prebuild-setup..."
352ifeq "$(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
372endif
373ifeq "$(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
381endif
382
383actual-build:
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 ; \
390 fi ; \
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 ; \
394 fi ; \
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 ; \
398 fi \
399 done
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..."
404ifeq "$(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
408endif
409ifeq "$(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
414endif
415ifeq "$(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
419endif
420ifeq "$(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
428endif
429 $(SILENT) $(ECHO) "Done!"
430
431postbuild:
432ifeq "$(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
436endif