2 include MakefileVersion
4 MIN_MACOSX_VERSION=10.7
5 MAX_MACOSX_VERSION=MAC_OS_X_VERSION_10_7
7 OBJECTS = CFCharacterSet.o CFPreferences.o CFApplicationPreferences.o CFXMLPreferencesDomain.o CFStringEncodingConverter.o CFUniChar.o CFArray.o CFOldStylePList.o CFPropertyList.o CFStringEncodingDatabase.o CFUnicodeDecomposition.o CFBag.o CFData.o CFStringEncodings.o CFUnicodePrecomposition.o CFBase.o CFDate.o CFNumber.o CFRuntime.o CFStringScanner.o CFBinaryHeap.o CFDateFormatter.o CFNumberFormatter.o CFSet.o CFStringUtilities.o CFUtilities.o CFBinaryPList.o CFDictionary.o CFPlatform.o CFSystemDirectories.o CFVersion.o CFBitVector.o CFError.o CFPlatformConverters.o CFTimeZone.o CFBuiltinConverters.o CFFileUtilities.o CFSortFunctions.o CFTree.o CFICUConverters.o CFURL.o CFLocale.o CFURLAccess.o CFCalendar.o CFLocaleIdentifier.o CFString.o CFUUID.o CFStorage.o CFLocaleKeys.o
8 OBJECTS += CFBasicHash.o
9 HFILES = $(wildcard *.h)
10 INTERMEDIATE_HFILES = $(addprefix $(OBJBASE)/CoreFoundation/,$(HFILES))
12 PUBLIC_HEADERS=CFArray.h CFBag.h CFBase.h CFBinaryHeap.h CFBitVector.h CFByteOrder.h CFCalendar.h CFCharacterSet.h CFData.h CFDate.h CFDateFormatter.h CFDictionary.h CFError.h CFLocale.h CFMachPort.h CFNumber.h CFNumberFormatter.h CFPreferences.h CFPropertyList.h CFSet.h CFString.h CFStringEncodingExt.h CFTimeZone.h CFTree.h CFURL.h CFURLAccess.h CFUUID.h CoreFoundation.h TargetConditionals.h
14 PRIVATE_HEADERS= CFCharacterSetPriv.h CFError_Private.h CFLogUtilities.h CFPriv.h CFRuntime.h CFStorage.h CFStringDefaultEncoding.h CFStringEncodingConverter.h CFStringEncodingConverterExt.h CFUniChar.h CFUnicodeDecomposition.h CFUnicodePrecomposition.h ForFoundationOnly.h
16 RESOURCES = CFCharacterSetBitmaps.bitmap CFUnicodeData-L.mapping CFUnicodeData-B.mapping
18 OBJBASE_ROOT = CF-Objects
19 OBJBASE = $(OBJBASE_ROOT)/$(STYLE)
28 CFLAGS=-c -x c -fblocks -fpic -pipe -std=gnu99 -Wno-trigraphs -fexceptions -DCF_BUILDING_CF=1 -DDEPLOYMENT_TARGET_LINUX=1 -DMAC_OS_X_VERSION_MAX_ALLOWED=$(MAX_MACOSX_VERSION) -DU_SHOW_DRAFT_API=1 -DU_SHOW_CPLUSPLUS_API=0 -I$(OBJBASE) -I$(OBJBASE)/CoreFoundation -DVERSION=$(VERSION) -include CoreFoundation_Prefix.h
30 LFLAGS=-shared -fpic -init=___CFInitialize -Wl,--no-undefined,-soname,libCoreFoundation.so
32 # Libs for open source version of ICU
33 LIBS=-lc -lpthread -lm -lrt -licuuc -licudata -licui18n -lBlocksRuntime
35 .PHONY: all install clean
36 .PRECIOUS: $(OBJBASE)/CoreFoundation/%.h
38 all: $(OBJBASE)/libCoreFoundation.so
41 -/bin/rm -rf $(OBJBASE_ROOT)
43 $(OBJBASE)/CoreFoundation:
44 /bin/mkdir -p $(OBJBASE)/CoreFoundation
46 $(OBJBASE)/CoreFoundation/%.h: %.h $(OBJBASE)/CoreFoundation
49 $(OBJBASE)/%.o: %.c $(INTERMEDIATE_HFILES)
50 $(CC) $(STYLE_CFLAGS) $(CFLAGS) $< -o $@
52 $(OBJBASE)/%.o: %.m $(INTERMEDIATE_HFILES)
53 $(CC) $(STYLE_CFLAGS) $(CFLAGS) $< -o $@
55 $(OBJBASE)/libCoreFoundation.so: $(addprefix $(OBJBASE)/,$(OBJECTS))
56 $(CC) $(STYLE_LFLAGS) $(LFLAGS) $^ -L/usr/local/lib $(LIBS) -o $(OBJBASE)/libCoreFoundation.so
57 @echo "Building done. 'sudo make install' to put the result into $(DSTBASE)/lib and $(DSTBASE)/include."
59 install: $(OBJBASE)/libCoreFoundation.so
60 /bin/mkdir -p $(DSTBASE)
61 /bin/mkdir -p $(DSTBASE)/include/CoreFoundation
62 /bin/mkdir -p $(DSTBASE)/share/CoreFoundation
63 -/bin/rm $(DSTBASE)/include/CoreFoundation/*.h
64 /bin/mkdir -p $(DSTBASE)/lib
65 /bin/cp $(PRIVATE_HEADERS) $(DSTBASE)/include/CoreFoundation
66 /bin/cp $(PUBLIC_HEADERS) $(DSTBASE)/include/CoreFoundation
67 /bin/cp $(OBJBASE)/libCoreFoundation.so $(DSTBASE)/lib
68 /bin/cp $(RESOURCES) $(DSTBASE)/share/CoreFoundation
69 # this one goes outside the base directory
70 /bin/cp TargetConditionals.h $(DSTBASE)/include
71 /sbin/ldconfig -n $(DSTBASE)/lib
72 @echo "Installing done. The library is in $(DSTBASE)/lib and the headers are in $(DSTBASE)/include/CoreFoundation"