1 export SOURCE=$(shell /bin/pwd)
2 export RELATIVE_SOURCE_PATH ?= .
7 export USE_APPLE_PB_SUPPORT = all
10 # Incremental Build option
12 ifndef INCR_EXPORTHDRS
13 ifeq ($(shell test -d $$OBJROOT/EXPORT_HDRS;echo $$?),0)
14 export INCR_EXPORTHDRS = TRUE
16 export INCR_EXPORTHDRS = FALSE
25 export COMPONENT_LIST = osfmk bsd libkern iokit pexpert libsa security
26 export COMPONENT_LIST_UC := $(shell printf "%s" "$(COMPONENT_LIST)" | $(TR) a-z A-Z)
29 export COMPONENT := $(firstword $(subst /, ,$(RELATIVE_SOURCE_PATH)))
30 export COMPONENT_IMPORT_LIST := $(filter-out $(COMPONENT),$(COMPONENT_LIST))
32 ifeq ($(COMPONENT), .)
33 export COMPONENT := $(if $(word 2,$(subst /, ,$(RELATIVE_SOURCE_PATH))),$(word 2,$(subst /, ,$(RELATIVE_SOURCE_PATH))),$(firstword $(subst /, ,$(RELATIVE_SOURCE_PATH))))
34 export COMPONENT_IMPORT_LIST := $(filter-out $(COMPONENT),$(COMPONENT_LIST))
38 # Architecture options
40 ifndef SUPPORTED_ARCH_CONFIGS
41 export SUPPORTED_ARCH_CONFIGS = I386 X86_64
46 export ARCH_CONFIGS := $(shell printf "%s" "$(RC_ARCHS)" | $(TR) a-z A-Z | sed -E 's/ARMV[0-9][A-Z]?/ARM/g')
48 ifeq ($(PLATFORM),iPhoneOS)
49 export ARCH_CONFIGS := ARM
51 export ARCH_CONFIGS := $(shell arch | $(TR) a-z A-Z | sed -E 's/ARMV[0-9][A-Z]?/ARM/g')
57 export ARCH_CONFIG_LC := $(shell printf "%s" "$(ARCH_CONFIG)" | $(TR) A-Z a-z)
64 ifndef SUPPORTED_PLATFORMS
65 export SUPPORTED_PLATFORMS = MacOSX iPhoneOS iPhoneSimulator
68 # PLATFORM is set earlier in MakeInc.cmd, closer to where decisions about
69 # platform tools are made
72 # Kernel Configuration options
74 ifndef SUPPORTED_KERNEL_CONFIGS
75 export SUPPORTED_KERNEL_CONFIGS = RELEASE DEVELOPMENT DEBUG PROFILE
78 ifndef DEFAULT_KERNEL_CONFIG
79 ifeq ($(RC_ProjectName),xnu_debug)
80 export DEFAULT_KERNEL_CONFIG = DEBUG
82 export DEFAULT_KERNEL_CONFIG = RELEASE
86 # If KERNEL_CONFIGS is specified it should override KERNEL_CONFIG.
87 # If KERNEL_CONFIG is specified it will override the default. Will quit with
88 # error if more than one config is specified.
89 # If DEFAULT_KERNEL_CONFIG is not specified then it will be built RELEASE.
92 export KERNEL_CONFIGS = $(DEFAULT_KERNEL_CONFIG)
94 export KERNEL_CONFIGS = $(KERNEL_CONFIG)
99 export KERNEL_CONFIG = $(firstword $(KERNEL_CONFIGS))
102 ifneq ($(words $(KERNEL_CONFIG)), 1)
103 $(error There were $(words $(KERNEL_CONFIG)) parameters passed to KERNEL_CONFIG = $(KERNEL_CONFG). \
104 Are you sure? To specify multiple configurations please use KERNEL_CONFIGS)
107 ifndef MACHINE_CONFIG
108 export MACHINE_CONFIG = DEFAULT
113 # Machine Configuration options
115 export SUPPORTED_I386_MACHINE_CONFIGS := DEFAULT
116 export SUPPORTED_X86_64_MACHINE_CONFIGS := DEFAULT
120 # Target configuration options. NOTE - target configurations will
121 # override ARCH_CONFIGS and KERNEL_CONFIGS.
123 # Target configs come in groups of three parameters. The first is the
124 # kernel configuration, the second is the architecture configuration,
125 # and the third is the machine configuration. You may pass in as
126 # many groups of configurations as you wish. Each item passed in is
127 # separated by whitespace.
130 # TARGET_CONFIGS="release x86_64 default debug i386 default release arm S5l8920X"
131 # Parameters may be in upper or lower case (they are converted to upper).
133 # "default" parameter is a special case. It means use the default value for
134 # that parameter. Here are the default values for each configuration:
136 # default kernel configuration = DEFAULT_KERNEL_CONFIG
137 # default architecture configuration = system architecture where you are running make.
138 # default machine configuration for i386 = none at this time.
139 # default machine configuration for x86_64 = none at this time.
140 # default machine configuration for arm = "S5L8920X".
142 ifndef TARGET_CONFIGS_UC
144 export TARGET_CONFIGS_UC := $(strip $(shell printf "%s" "$(TARGET_CONFIGS)" | $(TR) a-z A-Z))
145 export MACHINE_CONFIG = $(word 3, $(TARGET_CONFIGS_UC))
146 export DEFAULT_KERNEL_CONFIG = $(word 1, $(TARGET_CONFIGS_UC))
149 ifneq ($(filter %_embedded,$(MAKECMDGOALS)),)
150 # generate set of standard embedded configs
151 export TARGET_CONFIGS = $(TARGET_CONFIGS_EMBEDDED)
152 else ifneq ($(filter %_devicemap,$(MAKECMDGOALS)),)
153 DEVICEMAP_PLATFORMS = $(shell $(EMBEDDED_DEVICE_MAP) -query SELECT DISTINCT Platform FROM Targets | $(TR) [:lower:] [:upper:])
154 export TARGET_CONFIGS = $(foreach my_kernel_config,$(KERNEL_CONFIGS_EMBEDDED),$(foreach my_arch,$(ARCH_CONFIGS),$(foreach my_machine_config,$(filter $(DEVICEMAP_PLATFORMS),$(SUPPORTED_$(my_arch)_MACHINE_CONFIGS)),$(my_kernel_config) $(my_arch) $(my_machine_config) )))
156 # generate TARGET_CONFIGS using KERNEL_CONFIGS and ARCH_CONFIGS and MACHINE_CONFIG (which defaults to "DEFAULT")
157 export TARGET_CONFIGS = $(strip $(foreach my_arch_config, $(ARCH_CONFIGS), $(foreach my_kern_config, $(KERNEL_CONFIGS), $(my_kern_config) $(my_arch_config) $(MACHINE_CONFIG))))
159 export TARGET_CONFIGS_UC := $(shell printf "%s" "$(TARGET_CONFIGS)" | $(TR) a-z A-Z)
160 export MACHINE_CONFIG = $(word 3, $(TARGET_CONFIGS_UC))
161 export DEFAULT_KERNEL_CONFIG = $(word 1, $(TARGET_CONFIGS_UC))
165 export MACHINE_CONFIG_LC := $(shell printf "%s" "$(MACHINE_CONFIG)" | $(TR) A-Z a-z)
166 export KERNEL_CONFIG_LC := $(shell printf "%s" "$(KERNEL_CONFIG)" | $(TR) A-Z a-z)
169 # Validate configuration options
171 ifneq ($(ARCH_CONFIG),)
172 ifeq ($(filter $(ARCH_CONFIG),$(SUPPORTED_ARCH_CONFIGS)),)
173 $(error Unsupported ARCH_CONFIG $(ARCH_CONFIG))
177 ifneq ($(KERNEL_CONFIG),)
178 ifeq ($(filter $(KERNEL_CONFIG),$(SUPPORTED_KERNEL_CONFIGS)),)
179 $(error Unsupported KERNEL_CONFIG $(KERNEL_CONFIG))
183 ifneq ($(MACHINE_CONFIG),)
184 ifneq ($(ARCH_CONFIG),)
185 ifeq ($(filter $(MACHINE_CONFIG),$(SUPPORTED_$(ARCH_CONFIG)_MACHINE_CONFIGS)),)
186 $(error Unsupported MACHINE_CONFIG $(MACHINE_CONFIG))
192 ifeq ($(filter $(PLATFORM),$(SUPPORTED_PLATFORMS)),)
193 $(error Unsupported PLATFORM $(PLATFORM))
198 # Kernel Configuration to install
200 # supported install architecture : I386 X86_64
202 export INSTALL_TYPE = $(DEFAULT_KERNEL_CONFIG)
205 export INSTALL_ARCHS = $(strip $(foreach my_config, $(SUPPORTED_ARCH_CONFIGS), $(filter $(TARGET_CONFIGS_UC),$(my_config))))
206 export INSTALL_ARCHS_LC := $(shell printf "%s" "$(INSTALL_ARCHS)" | $(TR) A-Z a-z)
209 export INSTALL_ARCH_DEFAULT = $(firstword $(INSTALL_ARCHS))
210 ifeq ($(INSTALL_ARCH_DEFAULT),)
211 $(error Could not determine INSTALL_ARCH_DEFAULT)
215 # Deployment target flag
217 ifndef DEPLOYMENT_TARGET_FLAGS
218 SDKVERSION=$(shell xcodebuild -sdk $(SDKROOT) -version SDKVersion | head -1)
219 ifeq ($(PLATFORM),MacOSX)
220 export DEPLOYMENT_TARGET_FLAGS := -mmacosx-version-min=$(SDKVERSION)
221 else ifeq ($(PLATFORM),iPhoneOS)
222 export DEPLOYMENT_TARGET_FLAGS := -miphoneos-version-min=$(SDKVERSION)
223 else ifeq ($(PLATFORM),iPhoneSimulator)
224 export DEPLOYMENT_TARGET_FLAGS :=
226 export DEPLOYMENT_TARGET_FLAGS :=
231 # Standard defines list
233 export DEFINES = -DAPPLE -DKERNEL -DKERNEL_PRIVATE -DXNU_KERNEL_PRIVATE \
234 -DPRIVATE -D__MACHO__=1 -Dvolatile=__volatile $(IDENT)
243 # Compiler warning flags
247 -Wall -Werror -Wno-format-y2k -Wextra -Wstrict-prototypes \
248 -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual \
249 -Wwrite-strings -Wswitch -Wshadow -Wcast-align -Wchar-subscripts \
250 -Winline -Wnested-externs -Wredundant-decls -Wextra-tokens
252 # Certain warnings are non-fatal (8474835)
253 CWARNFLAGS_STD += -Wno-error=cast-align
255 # Can be overridden in Makefile.template or Makefile.$arch
256 export CWARNFLAGS ?= $(CWARNFLAGS_STD)
258 define add_perfile_cflags
259 $(1)_CWARNFLAGS_ADD += $2
263 -Wall -Werror -Wno-format-y2k -Wextra -Wpointer-arith -Wreturn-type \
264 -Wcast-qual -Wwrite-strings -Wswitch -Wcast-align -Wchar-subscripts \
265 -Wredundant-decls -Wextra-tokens
267 # Certain warnings are non-fatal (8474835, 9000888)
268 CXXWARNFLAGS_STD += -Wno-error=cast-align -Wno-error=overloaded-virtual
270 # Can be overridden in Makefile.template or Makefile.$arch
271 export CXXWARNFLAGS ?= $(CXXWARNFLAGS_STD)
273 define add_perfile_cxxflags
274 $(1)_CXXWARNFLAGS_ADD += $2
278 # Setup for parallel sub-makes based on 2 times number of logical CPUs
281 export MAKEJOBS = --jobs=$(shell expr `/usr/sbin//sysctl -n hw.logicalcpu` \* 2)
285 # Default ARCH_FLAGS, for use with compiler/linker/assembler/mig drivers
287 ARCH_FLAGS_I386 = -arch i386
288 ARCH_FLAGS_X86_64 = -arch x86_64
295 export OTHER_CFLAGS = $(subst $(addprefix -arch ,$(RC_ARCHS)),,$(RC_CFLAGS))
298 export DSYMRESDIR = ./Contents/Resources/
299 export DSYMBUILDDIR = ./Contents/Resources/DWARF/
302 # We must not use -fno-keep-inline-functions, or it will remove the dtrace
303 # probes from the kernel.
305 export CFLAGS_GEN = $(DEBUG_CFLAGS) -nostdinc \
306 -freorder-blocks -fno-builtin -fno-common \
307 -fsigned-bitfields $(OTHER_CFLAGS)
309 ifeq ($(BUILD_STABS),1)
310 export CFLAGS_GEN += -gstabs+
311 export BUILD_DWARF = 0
312 export BUILD_STABS = 1
314 export CFLAGS_GEN += -gdwarf-2
315 export BUILD_DWARF = 1
316 export BUILD_STABS = 0
319 export CFLAGS_RELEASE =
320 export CFLAGS_DEVELOPMENT =
321 export CFLAGS_DEBUG = -fstack-protector-all
322 export CFLAGS_PROFILE = -pg
324 export CFLAGS_I386 = -static -Di386 -DI386 -D__I386__ \
325 -DPAGE_SIZE_FIXED -msoft-float \
327 export CFLAGS_X86_64 = -Dx86_64 -DX86_64 -D__X86_64__ -DLP64 \
328 -DPAGE_SIZE_FIXED -mkernel -msoft-float \
332 ifeq (-arch armv7,$(ARCH_FLAGS_ARM))
333 CFLAGS_ARM += -mthumb
335 ifeq (-arch armv6,$(ARCH_FLAGS_ARM))
336 CFLAGS_ARM += -mthumb
340 export CFLAGS_RELEASEI386 = -O2
341 export CFLAGS_DEVELOPMENTI386 = -O2
342 export CFLAGS_DEBUGI386 = -O0
343 export CFLAGS_PROFILEI386 = -O2
345 export CFLAGS_RELEASEX86_64 = -O2
346 export CFLAGS_DEVELOPMENTX86_64 = -O2
347 # No space optimization for the DEBUG kernel for the benefit of gdb:
348 export CFLAGS_DEBUGX86_64 = -O0
349 export CFLAGS_PROFILEX86_64 = -O2
351 export CFLAGS_RELEASEARM = -O2
352 export CFLAGS_DEVELOPMENTARM = -O2
353 export CFLAGS_DEBUGARM = -O0
354 export CFLAGS_PROFILEARM = -O2
356 export CFLAGS = $(CFLAGS_GEN) \
357 $($(addsuffix $(MACHINE_CONFIG),MACHINE_FLAGS_)) \
358 $($(addsuffix $(ARCH_CONFIG),ARCH_FLAGS_)) \
359 $($(addsuffix $(ARCH_CONFIG),CFLAGS_)) \
360 $($(addsuffix $(KERNEL_CONFIG),CFLAGS_)) \
361 $($(addsuffix $(ARCH_CONFIG), $(addsuffix $(KERNEL_CONFIG),CFLAGS_))) \
362 $(DEPLOYMENT_TARGET_FLAGS) \
371 CXXFLAGS_GEN = -fapple-kext $(OTHER_CXXFLAGS)
373 CXXFLAGS = $(CXXFLAGS_GEN) \
374 $($(addsuffix $(ARCH_CONFIG),CXXFLAGS_)) \
375 $($(addsuffix $(KERNEL_CONFIG),CXXFLAGS_))
386 export SFLAGS_GEN = -D__ASSEMBLER__ $(OTHER_CFLAGS)
388 export SFLAGS_RELEASE =
389 export SFLAGS_DEVELOPMENT =
390 export SFLAGS_DEBUG =
391 export SFLAGS_PROFILE =
393 export SFLAGS_I386 = $(CFLAGS_I386)
394 export SFLAGS_X86_64 = $(CFLAGS_X86_64)
397 export SFLAGS = $(SFLAGS_GEN) \
398 $($(addsuffix $(MACHINE_CONFIG),MACHINE_FLAGS_)) \
399 $($(addsuffix $(ARCH_CONFIG),ARCH_FLAGS_)) \
400 $($(addsuffix $(ARCH_CONFIG),SFLAGS_)) \
401 $($(addsuffix $(KERNEL_CONFIG),SFLAGS_)) \
402 $(DEPLOYMENT_TARGET_FLAGS) \
409 LD = $(KC++) -nostdlib
414 export LDFLAGS_KERNEL_GEN = \
418 -Wl,-sectalign,__TEXT,__text,0x1000 \
419 -Wl,-sectalign,__TEXT,initcode,0x1000 \
420 -Wl,-sectalign,__DATA,__common,0x1000 \
421 -Wl,-sectalign,__DATA,__bss,0x1000 \
422 -Wl,-sectcreate,__PRELINK_TEXT,__text,/dev/null \
423 -Wl,-sectcreate,__PRELINK_STATE,__kernel,/dev/null \
424 -Wl,-sectcreate,__PRELINK_STATE,__kexts,/dev/null \
425 -Wl,-sectcreate,__PRELINK_INFO,__info,/dev/null \
427 -Wl,-pagezero_size,0x0 \
428 -Wl,-version_load_command \
431 # Availability of DWARF allows DTrace CTF (compressed type format) to be constructed.
432 # ctf_insert creates the CTF section. It needs reserved padding in the
433 # headers for the load command segment and the CTF section structures.
434 ifeq ($(BUILD_DWARF),1)
435 export LDFLAGS_KERNEL_GEN += \
439 export LDFLAGS_KERNEL_RELEASE =
440 export LDFLAGS_KERNEL_DEVELOPMENT =
441 export LDFLAGS_KERNEL_DEBUG =
442 export LDFLAGS_KERNEL_PROFILE =
444 export LDFLAGS_KERNEL_RELEASEI386 = \
445 -Wl,-segaddr,__INITPT,0x00100000 \
446 -Wl,-segaddr,__INITGDT,0x00106000 \
447 -Wl,-segaddr,__SLEEP,0x00107000 \
448 -Wl,-segaddr,__HIB,0x00108000 \
449 -Wl,-image_base,0x200000 \
450 -Wl,-seg_page_size,__TEXT,0x200000
452 export LDFLAGS_KERNEL_DEBUGI386 = $(LDFLAGS_KERNEL_RELEASEI386)
453 export LDFLAGS_KERNEL_DEVELOPMENTI386 = $(LDFLAGS_KERNEL_RELEASEI386)
454 export LDFLAGS_KERNEL_PROFILEI386 = $(LDFLAGS_KERNEL_RELEASEI386)
456 # KASLR static slide config:
460 KERNEL_MIN_ADDRESS := 0xffffff8000000000
461 KERNEL_BASE_OFFSET := 0x100000
462 KERNEL_STATIC_SLIDE := $(shell printf "0x%016x" \
463 $$[ $(SLIDE) << 21 ])
464 KERNEL_STATIC_BASE := $(shell printf "0x%016x" \
465 $$[ $(KERNEL_MIN_ADDRESS) + $(KERNEL_BASE_OFFSET) ])
466 KERNEL_HIB_SECTION_BASE := $(shell printf "0x%016x" \
467 $$[ $(KERNEL_STATIC_BASE) + $(KERNEL_STATIC_SLIDE) ])
468 KERNEL_TEXT_BASE := $(shell printf "0x%016x" \
469 $$[ $(KERNEL_HIB_SECTION_BASE) + 0x100000 ])
471 export LDFLAGS_KERNEL_RELEASEX86_64 = \
473 -Wl,-segaddr,__HIB,$(KERNEL_HIB_SECTION_BASE) \
474 -Wl,-image_base,$(KERNEL_TEXT_BASE) \
475 -Wl,-seg_page_size,__TEXT,0x200000 \
476 -Wl,-sectalign,__DATA,__const,0x1000 \
477 -Wl,-sectalign,__DATA,__sysctl_set,0x1000 \
478 -Wl,-sectalign,__HIB,__bootPT,0x1000 \
479 -Wl,-sectalign,__HIB,__desc,0x1000 \
480 -Wl,-sectalign,__HIB,__data,0x1000 \
481 -Wl,-sectalign,__HIB,__text,0x1000 \
482 -Wl,-sectalign,__HIB,__const,0x1000 \
483 -Wl,-sectalign,__HIB,__bss,0x1000 \
484 -Wl,-sectalign,__HIB,__common,0x1000 \
486 # Define KERNEL_BASE_OFFSET so known at compile time:
487 export CFLAGS_X86_64 += -DKERNEL_BASE_OFFSET=$(KERNEL_BASE_OFFSET)
489 export LDFLAGS_KERNEL_DEBUGX86_64 = $(LDFLAGS_KERNEL_RELEASEX86_64)
490 export LDFLAGS_KERNEL_DEVELOPMENTX86_64 = $(LDFLAGS_KERNEL_RELEASEX86_64)
491 export LDFLAGS_KERNEL_PROFILEX86_64 = $(LDFLAGS_KERNEL_RELEASEX86_64)
493 export LDFLAGS_KERNEL_RELEASEARM = \
496 -Wl,-image_base,0x80001000 \
497 -Wl,-exported_symbols_list,$(TARGET)/kernel-kpi.exp
499 export LDFLAGS_KERNEL_DEVELOPMENTARM = \
502 -Wl,-image_base,0x80001000
504 export LDFLAGS_KERNEL_DEBUGARM = $(LDFLAGS_KERNEL_DEVELOPMENTARM)
506 # Offset image base by page to have iBoot load kernel TEXT correctly.
507 # First page is used for various purposes : sleep token, reset vector.
509 export LDFLAGS_KERNEL = $(LDFLAGS_KERNEL_GEN) \
510 $($(addsuffix $(MACHINE_CONFIG),MACHINE_FLAGS_)) \
511 $($(addsuffix $(ARCH_CONFIG),ARCH_FLAGS_)) \
512 $($(addsuffix $(ARCH_CONFIG),LDFLAGS_KERNEL_)) \
513 $($(addsuffix $(KERNEL_CONFIG),LDFLAGS_KERNEL_)) \
514 $($(addsuffix $(ARCH_CONFIG), $(addsuffix $(KERNEL_CONFIG),LDFLAGS_KERNEL_))) \
515 $(DEPLOYMENT_TARGET_FLAGS)
518 # Default runtime libraries to be linked with the kernel
520 export LD_KERNEL_LIBS = -lcc_kext
526 export INCFLAGS_IMPORT = $(patsubst %, -I$(OBJROOT)/EXPORT_HDRS/%, $(COMPONENT_IMPORT_LIST))
527 export INCFLAGS_EXTERN = -I$(OBJROOT)/EXTERN_HDRS -I$(SRCROOT)/EXTERNAL_HEADERS -I$(SRCROOT)/EXTERNAL_HEADERS/bsd
528 export INCFLAGS_GEN = -I$(SRCROOT)/$(COMPONENT) -I$(OBJROOT)/EXPORT_HDRS/$(COMPONENT)
529 export INCFLAGS_POSIX = -I$(OBJROOT)/EXPORT_HDRS/bsd
530 export INCFLAGS_LOCAL = -I.
532 export INCFLAGS = $(INCFLAGS_LOCAL) $(INCFLAGS_GEN) $(INCFLAGS_IMPORT) $(INCFLAGS_EXTERN) $(INCFLAGS_MAKEFILE)
537 export MIGFLAGS = $(DEFINES) $(INCFLAGS) $($(addsuffix $(ARCH_CONFIG),CFLAGS_)) \
538 $($(addsuffix $(ARCH_CONFIG),ARCH_FLAGS_)) \
539 $(DEPLOYMENT_TARGET_FLAGS)
542 # Support for LLVM Link Time Optimization (LTO)
545 ifeq ($(BUILD_LTO),1)
546 export CFLAGS_GEN += -flto
547 export CXXFLAGS_GEN += -flto
548 export LDFLAGS_KERNEL_GEN += -Wl,-object_path_lto,$(TARGET)/lto.o
549 export CFLAGS_NOLTO_FLAG = -fno-lto
550 export BUILD_MACHO_OBJ = 0
553 export CFLAGS_NOLTO_FLAG =
554 export BUILD_MACHO_OBJ = 1
559 # Support for LLVM Integrated Assembler with clang driver
561 ifeq ($(BUILD_INTEGRATED_ASSEMBLER),1)
562 export SFLAGS_GEN += -integrated-as
563 export CFLAGS_GEN += -integrated-as
564 export CXXFLAGS_GEN += -integrated-as
565 export SFLAGS_NOINTEGRATEDAS_FLAGS = -no-integrated-as
566 export CFLAGS_NOINTEGRATEDAS_FLAGS = -no-integrated-as
568 export SFLAGS_NOINTEGRATEDAS_FLAGS =
569 export CFLAGS_NOINTEGRATEDAS_FLAGS =
576 space:= $(empty) $(empty)
577 export VPATH_IMPORT = $(subst $(space),:,$(patsubst %,$(OBJROOT)/EXPORT_HDRS/%,$(strip $(COMPONENT_IMPORT_LIST)))):
578 export VPATH_EXTERN = $(OBJROOT)/EXTERN_HDRS:
579 export VPATH_GEN = .:$(SOURCE):
581 export VPATH = $(VPATH_GEN)$(VPATH_IMPORT)$(VPATH_EXTERN)$(VPATH_MAKEFILE)
584 # Macros that control installation of kernel and its header files
586 # install flags for header files
588 INSTALL_FLAGS = -c -m 0444
589 FILE_INSTALL_FLAGS = -c -m 0644
590 DATA_INSTALL_FLAGS = -c -m 0644
593 # Header file destinations
595 ifeq ($(RC_ProjectName),xnu_headers_Sim)
596 HEADER_INSTALL_PREFIX = $(SDKROOT)
598 HEADER_INSTALL_PREFIX =
601 FRAMEDIR = $(HEADER_INSTALL_PREFIX)/System/Library/Frameworks
604 SINCFRAME = $(FRAMEDIR)/System.framework
605 SINCDIR = $(SINCFRAME)/Versions/$(SINCVERS)/Headers
606 SPINCDIR = $(SINCFRAME)/Versions/$(SINCVERS)/PrivateHeaders
607 SRESDIR = $(SINCFRAME)/Versions/$(SINCVERS)/Resources
610 INCDIR = $(HEADER_INSTALL_PREFIX)/usr/include
617 KINCFRAME = $(FRAMEDIR)/Kernel.framework
618 KINCDIR = $(KINCFRAME)/Versions/$(KINCVERS)/Headers
619 KPINCDIR = $(KINCFRAME)/Versions/$(KINCVERS)/PrivateHeaders
620 KRESDIR = $(KINCFRAME)/Versions/$(KINCVERS)/Resources
622 XNU_PRIVATE_UNIFDEF = -UMACH_KERNEL_PRIVATE -UBSD_KERNEL_PRIVATE -UIOKIT_KERNEL_PRIVATE -ULIBKERN_KERNEL_PRIVATE -ULIBSA_KERNEL_PRIVATE -UPEXPERT_KERNEL_PRIVATE -UXNU_KERNEL_PRIVATE
624 PLATFORM_UNIFDEF = $(foreach x,$(SUPPORTED_PLATFORMS),$(if $(filter $(PLATFORM),$(x)),-DPLATFORM_$(x),-UPLATFORM_$(x)))
626 SPINCFRAME_UNIFDEF = $(PLATFORM_UNIFDEF) $(XNU_PRIVATE_UNIFDEF) -UKERNEL_PRIVATE -UKERNEL -DPRIVATE -U_OPEN_SOURCE_
627 SINCFRAME_UNIFDEF = $(PLATFORM_UNIFDEF) $(XNU_PRIVATE_UNIFDEF) -UKERNEL_PRIVATE -UKERNEL -UPRIVATE -D_OPEN_SOURCE_
628 KPINCFRAME_UNIFDEF = $(PLATFORM_UNIFDEF) $(XNU_PRIVATE_UNIFDEF) -DKERNEL_PRIVATE -DPRIVATE -DKERNEL -U_OPEN_SOURCE_
629 KINCFRAME_UNIFDEF = $(PLATFORM_UNIFDEF) $(XNU_PRIVATE_UNIFDEF) -UKERNEL_PRIVATE -UPRIVATE -DKERNEL -D_OPEN_SOURCE_
633 # Component Header file destinations
635 EXPDIR = EXPORT_HDRS/$(COMPONENT)
640 export STRIP_FLAGS_RELEASE = -S -x
641 export STRIP_FLAGS_DEVELOPMENT = -S -x
642 export STRIP_FLAGS_DEBUG = -S
643 export STRIP_FLAGS_PROFILE = -S -x
645 export STRIP_FLAGS = $($(addsuffix $(KERNEL_CONFIG),STRIP_FLAGS_))
650 export DSYMUTIL_FLAGS_I386 = --arch=i386
651 export DSYMUTIL_FLAGS_X86_64 = --arch=x86_64
653 export DSYMUTIL_FLAGS = $($(addsuffix $(ARCH_CONFIG),DSYMUTIL_FLAGS_))
656 # Man Page destination
658 MANDIR = usr/share/man
661 # DEBUG alias location
663 DEVELOPER_EXTRAS_DIR = AppleInternal/Developer/Extras
666 # This must be here before any rules are possibly defined by the
667 # machine dependent makefile fragment so that a plain "make" command
668 # always works. The config program will emit an appropriate rule to
669 # cause "all" to depend on every kernel configuration it generates.