]>
Commit | Line | Data |
---|---|---|
39236c6e | 1 | # -*- mode: makefile;-*- |
1c79356b | 2 | # |
39236c6e | 3 | # Copyright (C) 1999-2012 Apple Inc. All rights reserved. |
1c79356b | 4 | # |
39236c6e A |
5 | # MakeInc.def contains global definitions for building, |
6 | # linking, and installing files. | |
1c79356b | 7 | # |
1c79356b | 8 | |
6d2010ae | 9 | # |
39236c6e | 10 | # Architecture Configuration options |
6d2010ae | 11 | # |
39236c6e | 12 | SUPPORTED_ARCH_CONFIGS := X86_64 |
6d2010ae | 13 | |
2d21ac55 | 14 | # |
1c79356b A |
15 | # Kernel Configuration options |
16 | # | |
39236c6e | 17 | SUPPORTED_KERNEL_CONFIGS = RELEASE DEVELOPMENT DEBUG PROFILE |
2d21ac55 | 18 | |
316670eb A |
19 | # |
20 | # Machine Configuration options | |
21 | # | |
39236c6e A |
22 | |
23 | SUPPORTED_X86_64_MACHINE_CONFIGS = NONE | |
6d2010ae | 24 | |
6d2010ae | 25 | |
2d21ac55 | 26 | # |
39236c6e | 27 | # Platform options |
2d21ac55 | 28 | # |
39236c6e | 29 | SUPPORTED_PLATFORMS = MacOSX iPhoneOS iPhoneSimulator |
2d21ac55 | 30 | |
6d2010ae | 31 | # |
39236c6e | 32 | # Setup up *_LC variables during recursive invocations |
6d2010ae | 33 | # |
6d2010ae | 34 | |
39236c6e A |
35 | ifndef CURRENT_ARCH_CONFIG_LC |
36 | export CURRENT_ARCH_CONFIG_LC := $(shell printf "%s" "$(CURRENT_ARCH_CONFIG)" | $(TR) A-Z a-z) | |
6d2010ae A |
37 | endif |
38 | ||
39236c6e A |
39 | ifndef CURRENT_KERNEL_CONFIG_LC |
40 | export CURRENT_KERNEL_CONFIG_LC := $(shell printf "%s" "$(CURRENT_KERNEL_CONFIG)" | $(TR) A-Z a-z) | |
316670eb | 41 | endif |
6d2010ae | 42 | |
39236c6e A |
43 | ifndef CURRENT_MACHINE_CONFIG_LC |
44 | export CURRENT_MACHINE_CONFIG_LC := $(shell printf "%s" "$(CURRENT_MACHINE_CONFIG)" | $(TR) A-Z a-z) | |
6d2010ae A |
45 | endif |
46 | ||
39236c6e | 47 | |
2d21ac55 | 48 | # |
39236c6e | 49 | # Component List |
2d21ac55 | 50 | # |
39236c6e A |
51 | COMPONENT_LIST = osfmk bsd libkern iokit pexpert libsa security |
52 | COMPONENT = $(if $(word 2,$(subst /, ,$(RELATIVE_SOURCE_PATH))),$(word 2,$(subst /, ,$(RELATIVE_SOURCE_PATH))),$(firstword $(subst /, ,$(RELATIVE_SOURCE_PATH)))) | |
53 | COMPONENT_IMPORT_LIST = $(filter-out $(COMPONENT),$(COMPONENT_LIST)) | |
1c79356b | 54 | |
1c79356b | 55 | |
316670eb A |
56 | # |
57 | # Deployment target flag | |
58 | # | |
316670eb | 59 | ifeq ($(PLATFORM),MacOSX) |
39236c6e | 60 | DEPLOYMENT_TARGET_FLAGS = -mmacosx-version-min=$(SDKVERSION) |
316670eb | 61 | else ifeq ($(PLATFORM),iPhoneOS) |
39236c6e | 62 | DEPLOYMENT_TARGET_FLAGS = -miphoneos-version-min=$(SDKVERSION) |
316670eb | 63 | else ifeq ($(PLATFORM),iPhoneSimulator) |
39236c6e | 64 | DEPLOYMENT_TARGET_FLAGS = |
316670eb | 65 | else |
39236c6e | 66 | DEPLOYMENT_TARGET_FLAGS = |
316670eb A |
67 | endif |
68 | ||
39236c6e | 69 | |
1c79356b A |
70 | # |
71 | # Standard defines list | |
72 | # | |
39236c6e A |
73 | DEFINES = -DAPPLE -DKERNEL -DKERNEL_PRIVATE -DXNU_KERNEL_PRIVATE \ |
74 | -DPRIVATE -D__MACHO__=1 -Dvolatile=__volatile $(IDENT) \ | |
75 | $(SEED_DEFINES) | |
1c79356b A |
76 | |
77 | # | |
78 | # Compiler command | |
79 | # | |
39236c6e A |
80 | KCC = $(CC) |
81 | KC++ = $(CXX) | |
9bccf70c | 82 | |
91447636 A |
83 | # |
84 | # Compiler warning flags | |
85 | # | |
86 | ||
87 | CWARNFLAGS_STD = \ | |
6d2010ae A |
88 | -Wall -Werror -Wno-format-y2k -Wextra -Wstrict-prototypes \ |
89 | -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual \ | |
90 | -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wchar-subscripts \ | |
91 | -Winline -Wnested-externs -Wredundant-decls -Wextra-tokens | |
92 | ||
6d2010ae | 93 | # Can be overridden in Makefile.template or Makefile.$arch |
91447636 A |
94 | export CWARNFLAGS ?= $(CWARNFLAGS_STD) |
95 | ||
6d2010ae A |
96 | define add_perfile_cflags |
97 | $(1)_CWARNFLAGS_ADD += $2 | |
98 | endef | |
99 | ||
91447636 | 100 | CXXWARNFLAGS_STD = \ |
6d2010ae A |
101 | -Wall -Werror -Wno-format-y2k -Wextra -Wpointer-arith -Wreturn-type \ |
102 | -Wcast-qual -Wwrite-strings -Wswitch -Wcast-align -Wchar-subscripts \ | |
103 | -Wredundant-decls -Wextra-tokens | |
104 | ||
39236c6e A |
105 | # overloaded-virtual warnings are non-fatal (9000888) |
106 | CXXWARNFLAGS_STD += -Wno-error=overloaded-virtual | |
91447636 | 107 | |
6d2010ae | 108 | # Can be overridden in Makefile.template or Makefile.$arch |
91447636 A |
109 | export CXXWARNFLAGS ?= $(CXXWARNFLAGS_STD) |
110 | ||
6d2010ae A |
111 | define add_perfile_cxxflags |
112 | $(1)_CXXWARNFLAGS_ADD += $2 | |
113 | endef | |
9bccf70c | 114 | |
2d21ac55 A |
115 | # |
116 | # Default ARCH_FLAGS, for use with compiler/linker/assembler/mig drivers | |
117 | ||
b0d623f7 | 118 | ARCH_FLAGS_X86_64 = -arch x86_64 |
c910b4d9 | 119 | |
2d21ac55 | 120 | |
1c79356b A |
121 | # |
122 | # Default CFLAGS | |
123 | # | |
124 | ifdef RC_CFLAGS | |
39236c6e | 125 | OTHER_CFLAGS = $(subst $(addprefix -arch ,$(RC_ARCHS)),,$(RC_CFLAGS)) |
1c79356b A |
126 | endif |
127 | ||
39236c6e A |
128 | # |
129 | # Debug info | |
130 | # | |
131 | DSYMKERNELSYSDIR = mach_kernel.sys.dSYM | |
132 | DSYMINFODIR = Contents | |
133 | DSYMKGMACROSDIR = Contents/Resources | |
134 | DSYMLLDBMACROSDIR = Contents/Resources/Python | |
135 | DSYMDWARFDIR = Contents/Resources/DWARF | |
136 | ||
137 | DEBUG_CFLAGS := -gdwarf-2 | |
138 | BUILD_DSYM := 1 | |
2d21ac55 A |
139 | |
140 | # | |
141 | # We must not use -fno-keep-inline-functions, or it will remove the dtrace | |
142 | # probes from the kernel. | |
143 | # | |
39236c6e | 144 | CFLAGS_GEN = $(DEBUG_CFLAGS) -nostdinc \ |
316670eb A |
145 | -freorder-blocks -fno-builtin -fno-common \ |
146 | -fsigned-bitfields $(OTHER_CFLAGS) | |
1c79356b | 147 | |
39236c6e A |
148 | CFLAGS_RELEASE = |
149 | CFLAGS_DEVELOPMENT = | |
150 | CFLAGS_DEBUG = | |
151 | CFLAGS_PROFILE = -pg | |
1c79356b | 152 | |
39236c6e | 153 | CFLAGS_X86_64 = -Dx86_64 -DX86_64 -D__X86_64__ -DLP64 \ |
316670eb | 154 | -DPAGE_SIZE_FIXED -mkernel -msoft-float \ |
39236c6e | 155 | -fno-limit-debug-info # Workaround for 11076603 |
316670eb | 156 | |
2d21ac55 | 157 | |
39236c6e A |
158 | CFLAGS_RELEASEX86_64 = -O2 |
159 | CFLAGS_DEVELOPMENTX86_64 = -O2 | |
b0d623f7 | 160 | # No space optimization for the DEBUG kernel for the benefit of gdb: |
39236c6e A |
161 | CFLAGS_DEBUGX86_64 = -O0 |
162 | CFLAGS_PROFILEX86_64 = -O2 | |
163 | ||
164 | CFLAGS_RELEASEARM = -O2 | |
165 | CFLAGS_DEVELOPMENTARM = -O2 | |
166 | CFLAGS_DEBUGARM = -O0 | |
167 | CFLAGS_PROFILEARM = -O2 | |
168 | ||
169 | CFLAGS = $(CFLAGS_GEN) \ | |
170 | $($(addsuffix $(CURRENT_MACHINE_CONFIG),MACHINE_FLAGS_$(CURRENT_ARCH_CONFIG)_)) \ | |
171 | $($(addsuffix $(CURRENT_ARCH_CONFIG),ARCH_FLAGS_)) \ | |
172 | $($(addsuffix $(CURRENT_ARCH_CONFIG),CFLAGS_)) \ | |
173 | $($(addsuffix $(CURRENT_KERNEL_CONFIG),CFLAGS_)) \ | |
174 | $($(addsuffix $(CURRENT_ARCH_CONFIG), $(addsuffix $(CURRENT_KERNEL_CONFIG),CFLAGS_))) \ | |
316670eb | 175 | $(DEPLOYMENT_TARGET_FLAGS) \ |
1c79356b A |
176 | $(DEFINES) |
177 | ||
6d2010ae | 178 | # |
55e303ae | 179 | # Default C++ flags |
1c79356b | 180 | # |
6d2010ae A |
181 | |
182 | OTHER_CXXFLAGS = | |
316670eb A |
183 | |
184 | CXXFLAGS_GEN = -fapple-kext $(OTHER_CXXFLAGS) | |
1c79356b | 185 | |
39236c6e A |
186 | # For the moment, do not use gnu++11 |
187 | #CXXFLAGS_ARM = -std=gnu++11 | |
188 | ||
55e303ae | 189 | CXXFLAGS = $(CXXFLAGS_GEN) \ |
39236c6e A |
190 | $($(addsuffix $(CURRENT_ARCH_CONFIG),CXXFLAGS_)) \ |
191 | $($(addsuffix $(CURRENT_KERNEL_CONFIG),CXXFLAGS_)) | |
192 | ||
1c79356b A |
193 | |
194 | # | |
195 | # Assembler command | |
196 | # | |
0c530ab8 A |
197 | AS = $(CC) |
198 | S_KCC = $(CC) | |
1c79356b A |
199 | |
200 | # | |
201 | # Default SFLAGS | |
202 | # | |
39236c6e | 203 | SFLAGS_GEN = -D__ASSEMBLER__ $(OTHER_CFLAGS) |
1c79356b | 204 | |
39236c6e A |
205 | SFLAGS_RELEASE = |
206 | SFLAGS_DEVELOPMENT = | |
207 | SFLAGS_DEBUG = | |
208 | SFLAGS_PROFILE = | |
1c79356b | 209 | |
39236c6e | 210 | SFLAGS_X86_64 = $(CFLAGS_X86_64) |
1c79356b | 211 | |
39236c6e A |
212 | SFLAGS = $(SFLAGS_GEN) \ |
213 | $($(addsuffix $(CURRENT_MACHINE_CONFIG),MACHINE_FLAGS_$(CURRENT_ARCH_CONFIG)_)) \ | |
214 | $($(addsuffix $(CURRENT_ARCH_CONFIG),ARCH_FLAGS_)) \ | |
215 | $($(addsuffix $(CURRENT_ARCH_CONFIG),SFLAGS_)) \ | |
216 | $($(addsuffix $(CURRENT_KERNEL_CONFIG),SFLAGS_)) \ | |
316670eb | 217 | $(DEPLOYMENT_TARGET_FLAGS) \ |
1c79356b A |
218 | $(DEFINES) |
219 | ||
220 | # | |
221 | # Linker command | |
222 | # | |
0c530ab8 | 223 | LD = $(KC++) -nostdlib |
1c79356b A |
224 | |
225 | # | |
226 | # Default LDFLAGS | |
227 | # | |
39236c6e A |
228 | # Availability of DWARF allows DTrace CTF (compressed type format) to be constructed. |
229 | # ctf_insert creates the CTF section. It needs reserved padding in the | |
230 | # headers for the load command segment and the CTF section structures. | |
231 | # | |
232 | LDFLAGS_KERNEL_GEN = \ | |
6d2010ae | 233 | -nostdlib \ |
0c530ab8 | 234 | -fapple-kext \ |
0c530ab8 | 235 | -Wl,-e,__start \ |
0c530ab8 A |
236 | -Wl,-sectalign,__TEXT,__text,0x1000 \ |
237 | -Wl,-sectalign,__DATA,__common,0x1000 \ | |
238 | -Wl,-sectalign,__DATA,__bss,0x1000 \ | |
b0d623f7 A |
239 | -Wl,-sectcreate,__PRELINK_TEXT,__text,/dev/null \ |
240 | -Wl,-sectcreate,__PRELINK_STATE,__kernel,/dev/null \ | |
241 | -Wl,-sectcreate,__PRELINK_STATE,__kexts,/dev/null \ | |
316670eb A |
242 | -Wl,-sectcreate,__PRELINK_INFO,__info,/dev/null \ |
243 | -Wl,-new_linker \ | |
244 | -Wl,-pagezero_size,0x0 \ | |
245 | -Wl,-version_load_command \ | |
39236c6e A |
246 | -Wl,-function_starts \ |
247 | -Wl,-headerpad,152 | |
b0d623f7 | 248 | |
39236c6e A |
249 | LDFLAGS_KERNEL_RELEASE = |
250 | LDFLAGS_KERNEL_DEVELOPMENT = | |
251 | LDFLAGS_KERNEL_DEBUG = | |
252 | LDFLAGS_KERNEL_PROFILE = | |
b0d623f7 | 253 | |
316670eb A |
254 | # KASLR static slide config: |
255 | ifndef SLIDE | |
256 | SLIDE=0x00 | |
257 | endif | |
39236c6e A |
258 | KERNEL_MIN_ADDRESS = 0xffffff8000000000 |
259 | KERNEL_BASE_OFFSET = 0x100000 | |
260 | KERNEL_STATIC_SLIDE = $(shell printf "0x%016x" \ | |
261 | $$[ $(SLIDE) << 21 ]) | |
262 | KERNEL_STATIC_BASE = $(shell printf "0x%016x" \ | |
263 | $$[ $(KERNEL_MIN_ADDRESS) + $(KERNEL_BASE_OFFSET) ]) | |
264 | KERNEL_HIB_SECTION_BASE = $(shell printf "0x%016x" \ | |
265 | $$[ $(KERNEL_STATIC_BASE) + $(KERNEL_STATIC_SLIDE) ]) | |
266 | KERNEL_TEXT_BASE = $(shell printf "0x%016x" \ | |
267 | $$[ $(KERNEL_HIB_SECTION_BASE) + 0x100000 ]) | |
268 | ||
269 | LDFLAGS_KERNEL_RELEASEX86_64 = \ | |
316670eb A |
270 | -Wl,-pie \ |
271 | -Wl,-segaddr,__HIB,$(KERNEL_HIB_SECTION_BASE) \ | |
272 | -Wl,-image_base,$(KERNEL_TEXT_BASE) \ | |
273 | -Wl,-seg_page_size,__TEXT,0x200000 \ | |
274 | -Wl,-sectalign,__DATA,__const,0x1000 \ | |
275 | -Wl,-sectalign,__DATA,__sysctl_set,0x1000 \ | |
276 | -Wl,-sectalign,__HIB,__bootPT,0x1000 \ | |
277 | -Wl,-sectalign,__HIB,__desc,0x1000 \ | |
278 | -Wl,-sectalign,__HIB,__data,0x1000 \ | |
279 | -Wl,-sectalign,__HIB,__text,0x1000 \ | |
280 | -Wl,-sectalign,__HIB,__const,0x1000 \ | |
281 | -Wl,-sectalign,__HIB,__bss,0x1000 \ | |
282 | -Wl,-sectalign,__HIB,__common,0x1000 \ | |
39236c6e | 283 | $(LDFLAGS_NOSTRIP_FLAG) |
316670eb A |
284 | |
285 | # Define KERNEL_BASE_OFFSET so known at compile time: | |
39236c6e | 286 | CFLAGS_X86_64 += -DKERNEL_BASE_OFFSET=$(KERNEL_BASE_OFFSET) |
2d21ac55 | 287 | |
39236c6e A |
288 | LDFLAGS_KERNEL_DEBUGX86_64 = $(LDFLAGS_KERNEL_RELEASEX86_64) |
289 | LDFLAGS_KERNEL_DEVELOPMENTX86_64 = $(LDFLAGS_KERNEL_RELEASEX86_64) | |
290 | LDFLAGS_KERNEL_PROFILEX86_64 = $(LDFLAGS_KERNEL_RELEASEX86_64) | |
d1ecb069 | 291 | |
d1ecb069 | 292 | |
39236c6e A |
293 | LDFLAGS_KERNEL = $(LDFLAGS_KERNEL_GEN) \ |
294 | $($(addsuffix $(CURRENT_ARCH_CONFIG),ARCH_FLAGS_)) \ | |
295 | $($(addsuffix $(CURRENT_ARCH_CONFIG),LDFLAGS_KERNEL_)) \ | |
296 | $($(addsuffix $(CURRENT_KERNEL_CONFIG),LDFLAGS_KERNEL_)) \ | |
297 | $($(addsuffix $(CURRENT_ARCH_CONFIG), $(addsuffix $(CURRENT_KERNEL_CONFIG),LDFLAGS_KERNEL_))) \ | |
316670eb | 298 | $(DEPLOYMENT_TARGET_FLAGS) |
1c79356b A |
299 | |
300 | # | |
301 | # Default runtime libraries to be linked with the kernel | |
302 | # | |
39236c6e | 303 | LD_KERNEL_LIBS = -lcc_kext |
1c79356b | 304 | |
39236c6e A |
305 | # |
306 | # DTrace support | |
307 | # | |
308 | ifeq ($(CURRENT_KERNEL_CONFIG),RELEASE) | |
309 | ifneq ($(filter ARM%,$(CURRENT_ARCH_CONFIG)),) | |
310 | DO_CTFCONVERT = 0 | |
311 | DO_CTFMERGE = 0 | |
312 | DO_CTFMACHO = 0 | |
313 | else | |
314 | DO_CTFCONVERT = $(SUPPORTS_CTFCONVERT) | |
315 | DO_CTFMERGE = 1 | |
316 | DO_CTFMACHO = $(NEEDS_CTF_MACHOS) | |
317 | endif | |
318 | else | |
319 | DO_CTFCONVERT = $(SUPPORTS_CTFCONVERT) | |
320 | DO_CTFMERGE = 1 | |
321 | DO_CTFMACHO = $(NEEDS_CTF_MACHOS) | |
322 | endif | |
b0d623f7 | 323 | |
1c79356b A |
324 | # |
325 | # Default INCFLAGS | |
326 | # | |
39236c6e A |
327 | INCFLAGS_IMPORT = $(patsubst %, -I$(OBJROOT)/EXPORT_HDRS/%, $(COMPONENT_IMPORT_LIST)) |
328 | INCFLAGS_EXTERN = -I$(SRCROOT)/EXTERNAL_HEADERS | |
329 | INCFLAGS_GEN = -I$(SRCROOT)/$(COMPONENT) -I$(OBJROOT)/EXPORT_HDRS/$(COMPONENT) | |
330 | INCFLAGS_LOCAL = -I. | |
1c79356b | 331 | |
39236c6e | 332 | INCFLAGS = $(INCFLAGS_LOCAL) $(INCFLAGS_GEN) $(INCFLAGS_IMPORT) $(INCFLAGS_EXTERN) $(INCFLAGS_MAKEFILE) |
1c79356b A |
333 | |
334 | # | |
335 | # Default MIGFLAGS | |
336 | # | |
39236c6e A |
337 | MIGFLAGS = $(DEFINES) $(INCFLAGS) $($(addsuffix $(CURRENT_ARCH_CONFIG),CFLAGS_)) $($(addsuffix $(CURRENT_ARCH_CONFIG),ARCH_FLAGS_)) \ |
338 | $(DEPLOYMENT_TARGET_FLAGS) | |
316670eb A |
339 | |
340 | # | |
341 | # Support for LLVM Link Time Optimization (LTO) | |
342 | # | |
39236c6e A |
343 | # CFLAGS_NOLTO_FLAG is needed on a per-file basis (for files |
344 | # that deal poorly with LTO, or files that must be machine | |
345 | # code *.o files for xnu to build (i.e, setsegname runs on | |
346 | # them). | |
347 | # | |
348 | # LDFLAGS_NOSTRIP_FLAG is used to support configurations that | |
349 | # do not utilize an export list. For these configs to build, | |
350 | # we need to prevent the LTO logic from dead stripping them. | |
316670eb A |
351 | |
352 | ifeq ($(BUILD_LTO),1) | |
39236c6e A |
353 | CFLAGS_GEN += -flto |
354 | CXXFLAGS_GEN += -flto | |
355 | LDFLAGS_KERNEL_GEN += -Wl,-mllvm,-disable-simplify-libcalls -Wl,-object_path_lto,$(TARGET)/lto.o # -Wl,-mllvm -Wl,-disable-fp-elim | |
356 | LDFLAGS_NOSTRIP_FLAG = -rdynamic | |
357 | CFLAGS_NOLTO_FLAG = -fno-lto | |
358 | SUPPORTS_CTFCONVERT = 0 | |
359 | NEEDS_CTF_MACHOS = 1 | |
316670eb | 360 | else |
39236c6e A |
361 | LDFLAGS_NOSTRIP_FLAG = |
362 | CFLAGS_NOLTO_FLAG = | |
363 | SUPPORTS_CTFCONVERT = 1 | |
364 | NEEDS_CTF_MACHOS = 0 | |
316670eb | 365 | endif |
1c79356b A |
366 | |
367 | # | |
368 | # Default VPATH | |
369 | # | |
39236c6e | 370 | export VPATH = .:$(SOURCE) |
1c79356b A |
371 | |
372 | # | |
2d21ac55 | 373 | # Macros that control installation of kernel and its header files |
1c79356b A |
374 | # |
375 | # install flags for header files | |
376 | # | |
39236c6e A |
377 | INSTALL_FLAGS = -c -S -m 0444 |
378 | DATA_INSTALL_FLAGS = -c -S -m 0644 | |
379 | EXEC_INSTALL_FLAGS = -c -S -m 0755 | |
1c79356b A |
380 | |
381 | # | |
382 | # Header file destinations | |
383 | # | |
6d2010ae A |
384 | ifeq ($(RC_ProjectName),xnu_headers_Sim) |
385 | HEADER_INSTALL_PREFIX = $(SDKROOT) | |
386 | else | |
387 | HEADER_INSTALL_PREFIX = | |
388 | endif | |
389 | ||
390 | FRAMEDIR = $(HEADER_INSTALL_PREFIX)/System/Library/Frameworks | |
391 | ||
392 | SINCVERS = B | |
393 | SINCFRAME = $(FRAMEDIR)/System.framework | |
394 | SINCDIR = $(SINCFRAME)/Versions/$(SINCVERS)/Headers | |
395 | SPINCDIR = $(SINCFRAME)/Versions/$(SINCVERS)/PrivateHeaders | |
396 | SRESDIR = $(SINCFRAME)/Versions/$(SINCVERS)/Resources | |
397 | ||
1c79356b | 398 | ifndef INCDIR |
6d2010ae | 399 | INCDIR = $(HEADER_INSTALL_PREFIX)/usr/include |
1c79356b A |
400 | endif |
401 | ifndef LCLDIR | |
6d2010ae | 402 | LCLDIR = $(SPINCDIR) |
1c79356b A |
403 | endif |
404 | ||
405 | KINCVERS = A | |
406 | KINCFRAME = $(FRAMEDIR)/Kernel.framework | |
407 | KINCDIR = $(KINCFRAME)/Versions/$(KINCVERS)/Headers | |
0b4e3aa0 | 408 | KPINCDIR = $(KINCFRAME)/Versions/$(KINCVERS)/PrivateHeaders |
91447636 A |
409 | KRESDIR = $(KINCFRAME)/Versions/$(KINCVERS)/Resources |
410 | ||
411 | XNU_PRIVATE_UNIFDEF = -UMACH_KERNEL_PRIVATE -UBSD_KERNEL_PRIVATE -UIOKIT_KERNEL_PRIVATE -ULIBKERN_KERNEL_PRIVATE -ULIBSA_KERNEL_PRIVATE -UPEXPERT_KERNEL_PRIVATE -UXNU_KERNEL_PRIVATE | |
412 | ||
6d2010ae | 413 | |
39236c6e A |
414 | PLATFORM_UNIFDEF = $(foreach x,$(SUPPORTED_PLATFORMS),$(if $(filter $(PLATFORM),$(x)),-DPLATFORM_$(x) $(foreach token,$(PLATFORM_UNIFDEF_BLACKLIST_TOKENS_$(x)),-U$(token)),-UPLATFORM_$(x))) |
415 | ||
416 | SPINCFRAME_UNIFDEF = $(PLATFORM_UNIFDEF) $(XNU_PRIVATE_UNIFDEF) $(SEED_DEFINES) -UKERNEL_PRIVATE -UKERNEL -DPRIVATE -U_OPEN_SOURCE_ -U__OPEN_SOURCE__ | |
417 | SINCFRAME_UNIFDEF = $(PLATFORM_UNIFDEF) $(XNU_PRIVATE_UNIFDEF) $(SEED_DEFINES) -UKERNEL_PRIVATE -UKERNEL -UPRIVATE -D_OPEN_SOURCE_ -D__OPEN_SOURCE__ | |
418 | KPINCFRAME_UNIFDEF = $(PLATFORM_UNIFDEF) $(XNU_PRIVATE_UNIFDEF) $(SEED_DEFINES) -DKERNEL_PRIVATE -DPRIVATE -DKERNEL -U_OPEN_SOURCE_ -U__OPEN_SOURCE__ | |
419 | KINCFRAME_UNIFDEF = $(PLATFORM_UNIFDEF) $(XNU_PRIVATE_UNIFDEF) $(SEED_DEFINES) -UKERNEL_PRIVATE -UPRIVATE -DKERNEL -D_OPEN_SOURCE_ -D__OPEN_SOURCE__ | |
1c79356b | 420 | |
b0d623f7 | 421 | |
1c79356b | 422 | # |
39236c6e | 423 | # Compononent Header file destinations |
1c79356b A |
424 | # |
425 | EXPDIR = EXPORT_HDRS/$(COMPONENT) | |
426 | ||
427 | # | |
428 | # Strip Flags | |
429 | # | |
39236c6e A |
430 | STRIP_FLAGS_RELEASE = -S -x |
431 | STRIP_FLAGS_DEVELOPMENT = -S -x | |
432 | STRIP_FLAGS_DEBUG = -S | |
433 | STRIP_FLAGS_PROFILE = -S -x | |
1c79356b | 434 | |
39236c6e | 435 | STRIP_FLAGS = $($(addsuffix $(CURRENT_KERNEL_CONFIG),STRIP_FLAGS_)) |
1c79356b | 436 | |
2d21ac55 A |
437 | # |
438 | # dsymutil flags | |
439 | # | |
39236c6e | 440 | DSYMUTIL_FLAGS_X86_64 = --arch=x86_64 |
2d21ac55 | 441 | |
39236c6e | 442 | DSYMUTIL_FLAGS = $($(addsuffix $(CURRENT_ARCH_CONFIG),DSYMUTIL_FLAGS_)) |
2d21ac55 | 443 | |
9bccf70c A |
444 | # |
445 | # Man Page destination | |
446 | # | |
39236c6e | 447 | MANDIR = /usr/share/man |
9bccf70c | 448 | |
b0d623f7 A |
449 | # |
450 | # DEBUG alias location | |
451 | # | |
39236c6e | 452 | DEVELOPER_EXTRAS_DIR = /AppleInternal/CoreOS/xnu_debug |
2d21ac55 | 453 | |
1c79356b | 454 | # |
39236c6e | 455 | # mach_kernel install location |
1c79356b | 456 | # |
39236c6e | 457 | INSTALL_KERNEL_DIR = / |
1c79356b | 458 | |
39236c6e A |
459 | # |
460 | # System.kext pseudo-kext install location | |
461 | # | |
462 | INSTALL_EXTENSIONS_DIR = /System/Library/Extensions | |
463 | ||
464 | # | |
465 | # KDK location for iOS | |
466 | # | |
467 | INSTALL_KERNEL_SYM_DIR = /System/Library/Extensions/KDK | |
468 | ||
469 | # | |
470 | # Misc. Etc. | |
471 | # | |
472 | INSTALL_SHARE_MISC_DIR = /usr/share/misc | |
473 | INSTALL_DTRACE_SCRIPTS_DIR = /usr/lib/dtrace | |
474 | ||
475 | # | |
476 | # Overrides for XBS build aliases | |
477 | # | |
478 | ifeq ($(RC_ProjectName),xnu_debug) | |
479 | INSTALL_KERNEL_DIR := $(DEVELOPER_EXTRAS_DIR) | |
480 | DELETE_KERNEL_FRAMEWORK_AND_MISC = 1 | |
481 | INSTALL_XNU_DEBUG_FILES = 1 | |
482 | endif | |
483 | ifeq ($(PLATFORM),iPhoneOS) | |
484 | INSTALL_PRIMARY_KERNEL_LIKE_NON_PRIMARY = 1 | |
485 | INSTALL_KERNEL_SYM_TO_KDK = 1 | |
486 | USE_BINARY_PLIST = 1 | |
487 | else ifeq ($(PLATFORM),iPhoneSimulator) | |
488 | INSTALL_SYSTEM_FRAMEWORK_SYMLINKS = 1 | |
489 | USE_BINARY_PLIST = 1 | |
490 | endif | |
1c79356b | 491 | |
2d21ac55 | 492 | # vim: set ft=make: |