]>
Commit | Line | Data |
---|---|---|
ad3c9f2a | 1 | #include "<DEVELOPER_DIR>/Makefiles/CoreOS/Xcode/BSD.xcconfig" |
23e20b00 | 2 | #include "<DEVELOPER_DIR>/AppleInternal/XcodeConfig/SimulatorSupport.xcconfig" |
ad3c9f2a A |
3 | |
4 | // Standard settings | |
23e20b00 A |
5 | SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator iphoneosnano iphonesimulatornano |
6 | SRCROOT_SEARCH_PATHS = $(SRCROOT) $(SRCROOT)/include $(SRCROOT)/gen $(SRCROOT)/locale $(SRCROOT)/locale/FreeBSD $(SRCROOT)/stdtime/FreeBSD $(SRCROOT)/darwin | |
ad3c9f2a | 7 | SYSTEM_FRAMEWORK_HEADERS = $(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders |
6465356a | 8 | HEADER_SEARCH_PATHS = $($(TARGET_NAME)_SEARCH_PATHS) $(DERIVED_FILES_DIR)/dtrace $(SRCROOT_SEARCH_PATHS) $(SYSTEM_FRAMEWORK_HEADERS) $(SDKROOT)/usr/local/include $(inherited) |
ad3c9f2a A |
9 | ALWAYS_SEARCH_USER_PATHS = YES |
10 | USE_HEADERMAP = NO | |
11 | BUILD_VARIANTS = normal | |
12 | GCC_OPTIMIZATION_LEVEL = s | |
13 | GCC_C_LANGUAGE_STANDARD = gnu99 | |
14 | GCC_ENABLE_OBJC_EXCEPTIONS = YES | |
15 | GCC_SYMBOLS_PRIVATE_EXTERN = NO | |
16 | GCC_DYNAMIC_NO_PIC = NO | |
17 | GCC_THUMB_SUPPORT = YES | |
6465356a A |
18 | GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; |
19 | GCC_WARN_UNINITIALIZED_AUTOS = YES; | |
20 | GCC_WARN_UNUSED_VARIABLE = YES; | |
21 | GCC_WARN_ABOUT_RETURN_TYPE = YES; | |
22 | WARNING_CFLAGS = "-Wall"; | |
23 | ||
ad3c9f2a A |
24 | COPY_PHASE_STRIP = NO |
25 | SKIP_INSTALL = YES | |
26 | INSTALLHDRS_SCRIPT_PHASE = YES | |
27 | VERSIONING_SYSTEM = | |
28 | COPY_PHASE_STRIP = NO | |
29 | STRIP_INSTALLED_PRODUCT = NO | |
30 | LD_DYLIB_INSTALL_NAME = /usr/lib/system/$(EXECUTABLE_NAME) | |
31 | ||
32 | BUILD_VARIANTS = normal debug | |
6465356a | 33 | BUILD_ARCHIVES = Platform Base FreeBSD NetBSD TRE vCancelable vDarwinExtsn vDarwinExtsnCancelable vPre1050 vLegacy vInode32 FortifySource |
ad3c9f2a | 34 | |
6465356a | 35 | // clang is desired over llvm-gcc for OSAtomics. However, it isn't capable of building armv6 correctly. |
ad3c9f2a A |
36 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0 |
37 | GCC_VERSION[arch=armv6] = com.apple.compilers.llvmgcc42 | |
38 | ||
39 | EXECUTABLE_PREFIX = libsystem_ | |
23e20b00 A |
40 | INSTALL_PATH_ACTUAL = /usr/lib/system |
41 | INSTALL_PATH[sdk=macos*]=$(INSTALL_PATH_ACTUAL) | |
42 | PUBLIC_HEADERS_FOLDER_PATH = $(INSTALL_PATH_PREFIX)/usr/include | |
43 | PRIVATE_HEADERS_FOLDER_PATH = $(INSTALL_PATH_PREFIX)/usr/local/include | |
ad3c9f2a A |
44 | |
45 | // Simulator | |
23e20b00 | 46 | EXECUTABLE_PREFIX[sdk=*simulator*] = libsystem_sim_ |
ad3c9f2a A |
47 | |
48 | BASE_PREPROCESSOR_MACROS = __LIBC__ __DARWIN_UNIX03=1 __DARWIN_64_BIT_INO_T=1 __DARWIN_NON_CANCELABLE=1 __DARWIN_VERS_1050=1 _FORTIFY_SOURCE=0 | |
6465356a | 49 | OTHER_CFLAGS = -fdollars-in-identifiers -fno-common -fverbose-asm $($(TARGET_NAME)_CFLAGS) $(VARIANT_PREPROCESSOR_MACROS) |
ad3c9f2a A |
50 | OTHER_CFLAGS_debug = -fstack-protector -fno-inline -O0 -DDEBUG=1 |
51 | ||
52 | GCC_PREPROCESSOR_DEFINITIONS = $(BASE_PREPROCESSOR_MACROS) | |
6465356a | 53 | GCC_PREPROCESSOR_DEFINITIONS[sdk=iphone*] = $(BASE_PREPROCESSOR_MACROS) LIBC_NO_LIBCRASHREPORTERCLIENT=1 |
ad3c9f2a A |
54 | |
55 | // libsystem_c.dylib linking | |
23e20b00 | 56 | CR_LDFLAGS = -lCrashReporterClient |
ad3c9f2a | 57 | LIBCOMPILER_RT_LDFLAGS = -lcompiler_rt |
6465356a | 58 | LIBMALLOC_LDFLAGS = -lsystem_malloc |
6465356a | 59 | LIBPLATFORM_LDFLAGS = -lsystem_platform |
23e20b00 | 60 | LIBPLATFORM_LDFLAGS[sdk=*simulator*] = -lsystem_sim_platform |
6465356a | 61 | LIBPTHREAD_LDFLAGS = -lsystem_pthread |
23e20b00 | 62 | LIBPTHREAD_LDFLAGS[sdk=*simulator*] = -lsystem_sim_pthread |
6465356a | 63 | LIBSYSCALL_LDFLAGS = -lsystem_kernel |
23e20b00 | 64 | LIBSYSCALL_LDFLAGS[sdk=*simulator*] = -lsystem_sim_kernel |
6465356a | 65 | LIBM_LDFLAGS = -lsystem_m |
23e20b00 | 66 | LIBM_LDFLAGS[sdk=*simulator*] = -lsystem_sim_m |
6465356a | 67 | LIBDYLD_LDFLAGS = -ldyld |
23e20b00 | 68 | LIBSYSTEM_C_LDFLAGS = -all_load -nostdlib -L/usr/lib/system -umbrella System $(CR_LDFLAGS) $(LIBCOMPILER_RT_LDFLAGS) $(LIBDYLD_LDFLAGS) $(LIBSYSCALL_LDFLAGS) $(LIBM_LDFLAGS) $(LIBMALLOC_LDFLAGS) $(LIBPLATFORM_LDFLAGS) $(LIBPTHREAD_LDFLAGS) $(UPWARD_LDFLAGS) -Wl,-interposable_list,$(DERIVED_FILES_DIR)/interposable.list -Wl,-unexported_symbols_list,$(DERIVED_FILES_DIR)/unexport.list -Wl,-alias_list,$(SRCROOT)/string/alias.list -Wl,-order_file,$(SRCROOT)/xcodescripts/Libc.order -Wl,-sectalign,__DATA,__data,1000 @$(BUILT_PRODUCTS_DIR)/$(CURRENT_VARIANT).linklist |
6465356a A |
69 | |
70 | // TODO: Remove upward links - mostly <rdar://problem/13183469>, macho is for assumes.c | |
71 | UPWARD_LDFLAGS = -Wl,-upward-ldispatch -Wl,-upward-llaunch -Wl,-upward-lmacho -Wl,-upward-lsystem_asl -Wl,-upward-lsystem_blocks -Wl,-upward-lsystem_info -Wl,-upward-lsystem_notify -Wl,-upward-lxpc | |
23e20b00 | 72 | UPWARD_LDFLAGS[sdk=*simulator*] = -Wl,-upward-ldispatch -Wl,-upward-lmacho_sim -Wl,-upward-lsystem_sim_asl -Wl,-upward-lsystem_sim_blocks -Wl,-upward-lsystem_sim_info -Wl,-upward-lnotify_sim -Wl,-upward-lxpc |
ad3c9f2a A |
73 | |
74 | // libPlatform.a architectures | |
75 | ARCH_FAMILY = $(ARCH_FAMILY_$(CURRENT_ARCH)) | |
76 | ARCH_FAMILY_x86_64 = x86_64 | |
77 | ARCH_FAMILY_i386 = i386 | |
78 | ARCH_FAMILY_armv6 = arm | |
79 | ARCH_FAMILY_armv7 = arm | |
065eae9f | 80 | ARCH_FAMILY_armv7s = arm |
ad3c9f2a A |
81 | ARCH_FAMILY_armv7f = arm |
82 | ARCH_FAMILY_armv7k = arm | |
83 | ||
6465356a A |
84 | // Platform target |
85 | Platform_INCLUDED_SOURCE_FILE_NAMES = $(Platform_INCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME)) | |
86 | Platform_INCLUDED_SOURCE_FILE_NAMES_macosx = $(Platform_INCLUDED_SOURCE_FILE_NAMES_gen) $(Platform_INCLUDED_SOURCE_FILE_NAMES_stdlib) $(Platform_INCLUDED_SOURCE_FILE_NAMES_string) $(Platform_INCLUDED_SOURCE_FILE_NAMES_sys) | |
87 | Platform_INCLUDED_SOURCE_FILE_NAMES_iphoneos = $(Platform_INCLUDED_SOURCE_FILE_NAMES_gen) $(Platform_INCLUDED_SOURCE_FILE_NAMES_stdlib) $(Platform_INCLUDED_SOURCE_FILE_NAMES_string) $(Platform_INCLUDED_SOURCE_FILE_NAMES_sys) | |
88 | Platform_INCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(Platform_INCLUDED_SOURCE_FILE_NAMES_gen) $(Platform_INCLUDED_SOURCE_FILE_NAMES_stdlib) $(Platform_INCLUDED_SOURCE_FILE_NAMES_string) | |
23e20b00 A |
89 | Platform_INCLUDED_SOURCE_FILE_NAMES_iphoneosnano = $(Platform_INCLUDED_SOURCE_FILE_NAMES_iphoneos) |
90 | Platform_INCLUDED_SOURCE_FILE_NAMES_iphonesimulatornano = $(Platform_INCLUDED_SOURCE_FILE_NAMES_iphonesimulatornano) | |
6465356a A |
91 | |
92 | Platform_INCLUDED_SOURCE_FILE_NAMES_gen = $(ARCH_FAMILY)/gen/*.c $(ARCH_FAMILY)/gen/*.s $(ARCH_FAMILY)/gen/*.S | |
93 | Platform_INCLUDED_SOURCE_FILE_NAMES_stdlib = $(ARCH_FAMILY)/stdlib/*.c $(ARCH_FAMILY)/stdlib/*.s $(ARCH_FAMILY)/stdlib/*.S | |
94 | Platform_INCLUDED_SOURCE_FILE_NAMES_string = $(ARCH_FAMILY)/string/*.c $(ARCH_FAMILY)/string/*.s $(ARCH_FAMILY)/string/*.S | |
95 | Platform_INCLUDED_SOURCE_FILE_NAMES_sys = $(ARCH_FAMILY)/sys/*.c $(ARCH_FAMILY)/sys/*.s $(ARCH_FAMILY)/sys/*.S | |
96 | ||
ad3c9f2a A |
97 | // FreeBSD target |
98 | FreeBSD_CFLAGS = -include $(SRCROOT)/fbsdcompat/_fbsd_compat_.h | |
99 | FreeBSD_SEARCH_PATHS = $(SRCROOT)/fbsdcompat $(SRCROOT)/gdtoa $(SRCROOT)/gdtoa/FreeBSD | |
100 | FreeBSD_EXCLUDED_SOURCE_GDTOA = gdtoa/FreeBSD/machdep* gdtoa-strtopx.c | |
101 | // Include the correct parts of gdtoa per-arch | |
102 | FreeBSD_INCLUDED_SOURCE_FILE_NAMES_x86_64 = gdtoa-strtopx.c machdep_ldisx.c | |
103 | FreeBSD_INCLUDED_SOURCE_FILE_NAMES_i386 = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_x86_64) | |
104 | FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7 = machdep_ldisd.c | |
065eae9f | 105 | FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7s = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7) |
ad3c9f2a A |
106 | FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7k = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7) |
107 | FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7f = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7) | |
108 | FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv6 = $(FreeBSD_INCLUDED_SOURCE_FILE_NAMES_armv7) | |
109 | ||
ad3c9f2a A |
110 | // NetBSD target |
111 | NetBSD_CFLAGS = -include $(SRCROOT)/nbsdcompat/_nbsd_compat_.h | |
112 | NetBSD_SEARCH_PATHS = $(SRCROOT)/nbsdcompat | |
113 | ||
114 | // TRE target | |
115 | TRE_CFLAGS = -DHAVE_CONFIG_H | |
116 | TRE_SEARCH_PATHS = $(SRCROOT)/regex/TRE $(SRCROOT)/regex/FreeBSD | |
117 | ||
118 | // Files per architecture to exclude from the non-platform builds (because optimised versions exist in Platform) | |
119 | BASE_EXCLUDED_SOURCE_FILE_NAMES = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_$(CURRENT_ARCH)) $(BASE_EXCLUDED_SOURCE_FILE_NAMES_$(PLATFORM_NAME)) | |
6465356a A |
120 | BASE_EXCLUDED_SOURCE_FILE_NAMES_x86_64 = kvm.c nlist.c strcpy.c strlen.c strncpy.c strnlen.c |
121 | BASE_EXCLUDED_SOURCE_FILE_NAMES_i386 = strcpy.c strlcat.c strlcpy.c strlen.c strncpy.c | |
122 | BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7 = strlen.c strnlen.c strstr.c | |
065eae9f | 123 | BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7s = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7) |
ad3c9f2a A |
124 | BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7k = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7) |
125 | BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7f = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7) | |
126 | BASE_EXCLUDED_SOURCE_FILE_NAMES_armv6 = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_armv7) | |
127 | ||
128 | // Rune support isn't included on iOS but there's no better way to exclude their complication | |
23e20b00 | 129 | BASE_EXCLUDED_SOURCE_FILE_NAMES_macosx = OSMemoryNotification.c |
ad3c9f2a | 130 | BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneos = frune.c login.c logout.c mbrune.c runedepreciated.c setinvalidrune.c getmntinfo64.c |
23e20b00 A |
131 | BASE_EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneos) |
132 | BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneosnano = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_iphoneos) | |
133 | BASE_EXCLUDED_SOURCE_FILE_NAMES_iphonesimulatornano = $(BASE_EXCLUDED_SOURCE_FILE_NAMES_iphonesimulator) | |
ad3c9f2a A |
134 | |
135 | // <rdar://problem/9513665> - collate.c crashes llvm-gcc on armv6 with -Os + -gdwarf-2 | |
136 | COLLATE_C_CFLAGS_macosx_armv6 = -O1 | |
137 | ||
138 | // ARMv6 thumb doesn't support all the instructions needed for OSAtomics | |
139 | OSATOMIC_C_CFLAGS_macosx_armv6 = -mno-thumb | |
140 | OSATOMIC_C_CFLAGS_iphoneos_armv6 = -mno-thumb | |
6465356a A |
141 | |
142 | // Make sure that OSAtomic isn't build unoptimised, otherwise the inlines | |
143 | // don't do what they are designed to do. | |
144 | OSATOMIC_C_CFLAGS = -Os -momit-leaf-frame-pointer $(OSATOMIC_C_CFLAGS_$(PLATFORM_NAME)_$(CURRENT_ARCH)) |