]> git.saurik.com Git - apple/xnu.git/blame - makedefs/MakeInc.def
xnu-1504.9.26.tar.gz
[apple/xnu.git] / makedefs / MakeInc.def
CommitLineData
1c79356b
A
1export SOURCE=$(shell /bin/pwd)
2
3#
4# gnumake 3.77 support
5#
6export USE_APPLE_PB_SUPPORT = all
7
8#
9# Incremental Build option
10#
11ifndef INCR_EXPORTHDRS
12ifeq ($(shell test -d $$OBJROOT/EXPORT_HDRS;echo $$?),0)
13export INCR_EXPORTHDRS = TRUE
14else
15export INCR_EXPORTHDRS = FALSE
16endif
17endif
18
b0d623f7 19
1c79356b
A
20#
21# Component List
22#
0b4e3aa0 23ifndef COMPONENT_LIST
2d21ac55 24export COMPONENT_LIST = osfmk bsd libkern iokit pexpert libsa security
0c530ab8 25export COMPONENT_LIST_UC := $(shell printf "%s" "$(COMPONENT_LIST)" | $(TR) a-z A-Z)
0b4e3aa0
A
26endif
27ifndef COMPONENT
28export COMPONENT := $(firstword $(subst /, ,$(shell $(RELPATH) $(SRCROOT) $(SOURCE))))
29export COMPONENT_IMPORT_LIST := $(filter-out $(COMPONENT),$(COMPONENT_LIST))
30else
31ifeq ($(COMPONENT), .)
32export COMPONENT := $(firstword $(subst /, ,$(shell $(RELPATH) $(SRCROOT) $(SOURCE))))
33export COMPONENT_IMPORT_LIST := $(filter-out $(COMPONENT),$(COMPONENT_LIST))
34endif
35endif
1c79356b
A
36
37# Architecture options
38#
2d21ac55 39ifndef SUPPORTED_ARCH_CONFIGS
b0d623f7 40export SUPPORTED_ARCH_CONFIGS = PPC I386 X86_64 ARM
2d21ac55
A
41endif
42
0b4e3aa0 43ifndef ARCH_CONFIGS
1c79356b 44ifdef RC_ARCHS
0c530ab8 45export ARCH_CONFIGS := $(shell printf "%s" "$(RC_ARCHS)" | $(TR) a-z A-Z)
1c79356b 46else
0b4e3aa0
A
47export ARCH_CONFIGS := $(shell arch | $(TR) a-z A-Z)
48endif
49endif
50ifdef ARCH_CONFIG
51ifndef ARCH_CONFIG_LC
0c530ab8 52export ARCH_CONFIG_LC := $(shell printf "%s" "$(ARCH_CONFIG)" | $(TR) A-Z a-z)
1c79356b
A
53endif
54endif
1c79356b 55
2d21ac55 56#
1c79356b
A
57# Kernel Configuration options
58#
2d21ac55
A
59ifndef SUPPORTED_KERNEL_CONFIGS
60export SUPPORTED_KERNEL_CONFIGS = RELEASE DEVELOPMENT DEBUG PROFILE
61endif
0c530ab8 62
2d21ac55 63ifndef DEFAULT_KERNEL_CONFIG
b0d623f7
A
64ifeq ($(RC_ProjectName),xnu_debug)
65export DEFAULT_KERNEL_CONFIG = DEBUG
66else
2d21ac55 67export DEFAULT_KERNEL_CONFIG = RELEASE
1c79356b 68endif
b0d623f7 69endif
2d21ac55
A
70
71# If KERNEL_CONFIGS is specified it should override KERNEL_CONFIG.
72# If KERNEL_CONFIG is specified it will override the default. Will quit with
73# error if more than one config is specified.
74# If DEFAULT_KERNEL_CONFIG is not specified then it will be built RELEASE.
75ifndef KERNEL_CONFIGS
76 ifndef KERNEL_CONFIG
77 export KERNEL_CONFIGS = $(DEFAULT_KERNEL_CONFIG)
78 else
79 export KERNEL_CONFIGS = $(KERNEL_CONFIG)
80 endif
0c530ab8
A
81endif
82
0b4e3aa0 83ifndef KERNEL_CONFIG
1c79356b 84export KERNEL_CONFIG = $(firstword $(KERNEL_CONFIGS))
0b4e3aa0 85endif
1c79356b 86
2d21ac55
A
87ifneq ($(words $(KERNEL_CONFIG)), 1)
88$(error There were $(words $(KERNEL_CONFIG)) parameters passed to KERNEL_CONFIG = $(KERNEL_CONFG). \
89 Are you sure? To specify multiple configurations please use KERNEL_CONFIGS)
90endif
91
2d21ac55
A
92ifndef MACHINE_CONFIG
93export MACHINE_CONFIG = DEFAULT
94endif
95
2d21ac55
A
96
97#
98# Target configuration options. NOTE - target configurations will
99# override ARCH_CONFIGS and KERNEL_CONFIGS.
100#
101# Target configs come in groups of three parameters. The first is the
102# kernel configuration, the second is the architecture configuration,
103# and the third is the machine configuration. You may pass in as
104# many groups of configurations as you wish. Each item passed in is
105# seperated by whitespace.
106#
107# Example:
108# TARGET_CONFIGS="release ppc default debug i386 default release arm MX31ADS"
109# Parameters may be in upper or lower case (they are converted to upper).
110#
111# "default" parameter is a special case. It means use the default value for
112# that parameter. Here are the default values for each configuration:
113#
114# default kernel configuration = DEFAULT_KERNEL_CONFIG
115# default architecture configuration = system architecture where you are running make.
116# default machine configuration for ppc = none at this time.
117# default machine configuration for i386 = none at this time.
b0d623f7 118# default machine configuration for x86_64 = none at this time.
cf7d32b8 119# default machine configuration for arm = "S5L8900X".
2d21ac55
A
120#
121ifndef TARGET_CONFIGS_UC
122ifdef TARGET_CONFIGS
b0d623f7 123 export TARGET_CONFIGS_UC := $(strip $(shell printf "%s" "$(TARGET_CONFIGS)" | $(TR) a-z A-Z))
2d21ac55
A
124 export MACHINE_CONFIG = $(word 3, $(TARGET_CONFIGS_UC))
125 export DEFAULT_KERNEL_CONFIG = $(word 1, $(TARGET_CONFIGS_UC))
1c79356b 126else
2d21ac55
A
127 # generate TARGET_CONFIGS using KERNEL_CONFIGS and ARCH_CONFIGS and MACHINE_CONFIG (which defaults to "DEFAULT")
128 temp_list = $(foreach my_kern_config, $(KERNEL_CONFIGS), $(my_kern_config) arch_slot $(MACHINE_CONFIG))
129 export TARGET_CONFIGS = $(strip $(foreach my_arch_config, $(ARCH_CONFIGS), $(subst arch_slot,$(my_arch_config),$(temp_list))))
130 export TARGET_CONFIGS_UC := $(shell printf "%s" "$(TARGET_CONFIGS)" | $(TR) a-z A-Z)
131 export MACHINE_CONFIG = $(word 3, $(TARGET_CONFIGS_UC))
132 export DEFAULT_KERNEL_CONFIG = $(word 1, $(TARGET_CONFIGS_UC))
1c79356b 133endif
2d21ac55
A
134endif
135
136export MACHINE_CONFIG_LC := $(shell printf "%s" "$(MACHINE_CONFIG)" | $(TR) A-Z a-z)
137export KERNEL_CONFIG_LC := $(shell printf "%s" "$(KERNEL_CONFIG)" | $(TR) A-Z a-z)
138
139#
140# Kernel Configuration to install
141#
b0d623f7 142# supported install architecture : PPC I386 X86_64 ARM
2d21ac55
A
143#
144export INSTALL_TYPE = $(DEFAULT_KERNEL_CONFIG)
145
146ifndef INSTALL_ARCHS
147export INSTALL_ARCHS = $(strip $(foreach my_config, $(SUPPORTED_ARCH_CONFIGS), $(findstring $(my_config), $(TARGET_CONFIGS_UC))))
148export INSTALL_ARCHS_LC := $(shell printf "%s" "$(INSTALL_ARCHS)" | $(TR) A-Z a-z)
0b4e3aa0 149endif
1c79356b 150
b0d623f7 151export INSTALL_ARCH_DEFAULT = $(firstword $(INSTALL_ARCHS))
1c79356b
A
152
153#
154# Standard defines list
155#
2d21ac55 156export DEFINES = -DAPPLE -DKERNEL -DKERNEL_PRIVATE -DXNU_KERNEL_PRIVATE -DPRIVATE -D__MACHO__=1 -Dvolatile=__volatile $(IDENT)
1c79356b
A
157
158#
159# Compiler command
160#
0c530ab8
A
161KCC := $(CC)
162KC++ := $(CXX)
9bccf70c 163
91447636
A
164#
165# Compiler warning flags
166#
167
168CWARNFLAGS_STD = \
169 -Wall -Wno-format-y2k -W -Wstrict-prototypes -Wmissing-prototypes \
170 -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch \
b0d623f7 171 -Wshadow -Wcast-align -Wchar-subscripts -Winline \
91447636
A
172 -Wnested-externs -Wredundant-decls
173
174export CWARNFLAGS ?= $(CWARNFLAGS_STD)
175
91447636 176CXXWARNFLAGS_STD = \
0c530ab8 177 -Wall -Wno-format-y2k -W \
91447636 178 -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch \
b0d623f7 179 -Wcast-align -Wchar-subscripts -Wredundant-decls
91447636
A
180
181export CXXWARNFLAGS ?= $(CXXWARNFLAGS_STD)
182
9bccf70c
A
183
184#
2d21ac55 185# Setup for parallel sub-makes based on 2 times number of logical CPUs
9bccf70c
A
186#
187ifndef MAKEJOBS
2d21ac55 188export MAKEJOBS = --jobs=$(shell expr `/usr/sbin//sysctl -n hw.logicalcpu` \* 2)
9bccf70c 189endif
1c79356b 190
2d21ac55
A
191#
192# Default ARCH_FLAGS, for use with compiler/linker/assembler/mig drivers
193
194ARCH_FLAGS_PPC = -arch ppc
195ARCH_FLAGS_I386 = -arch i386
b0d623f7 196ARCH_FLAGS_X86_64 = -arch x86_64
2d21ac55
A
197ARCH_FLAGS_ARM = $($(addsuffix $(MACHINE_CONFIG),ARCH_FLAGS_ARM_))
198
c910b4d9
A
199ARCH_FLAGS_ALL_PPC = $(ARCH_FLAGS_PPC)
200ARCH_FLAGS_ALL_I386 = $(ARCH_FLAGS_I386)
b0d623f7 201ARCH_FLAGS_ALL_X86_64 = $(ARCH_FLAGS_X86_64)
c910b4d9
A
202ARCH_FLAGS_ALL_ARM = -arch arm
203
2d21ac55 204
1c79356b
A
205#
206# Default CFLAGS
207#
208ifdef RC_CFLAGS
209export OTHER_CFLAGS = $(subst $(addprefix -arch ,$(RC_ARCHS)),,$(RC_CFLAGS))
210endif
211
2d21ac55
A
212export DSYMBUILDDIR = ./Contents/Resources/DWARF/
213
214#
215# We must not use -fno-keep-inline-functions, or it will remove the dtrace
216# probes from the kernel.
217#
cf7d32b8 218export CFLAGS_GEN = -static $(DEBUG_CFLAGS) -nostdinc -nostdlib \
b0d623f7
A
219 -fno-builtin -finline -fno-common -msoft-float \
220 -fsigned-bitfields -fno-stack-protector $(OTHER_CFLAGS)
1c79356b 221
c910b4d9
A
222ifeq ($(BUILD_STABS),1)
223export CFLAGS_GEN += -gstabs+
224export BUILD_DWARF = 0
225export BUILD_STABS = 1
226else
227export CFLAGS_GEN += -gdwarf-2
228export BUILD_DWARF = 1
229export BUILD_STABS = 0
230endif
231
1c79356b 232export CFLAGS_RELEASE =
2d21ac55 233export CFLAGS_DEVELOPMENT =
55e303ae
A
234export CFLAGS_DEBUG =
235export CFLAGS_PROFILE = -pg
1c79356b 236
2d21ac55 237export CFLAGS_PPC = -Dppc -DPPC -D__PPC__ -DPAGE_SIZE_FIXED \
c910b4d9 238 -mno-altivec -force_cpusubtype_ALL
2d21ac55 239export CFLAGS_I386 = -Di386 -DI386 -D__I386__ \
c910b4d9 240 -DPAGE_SIZE_FIXED -force_cpusubtype_ALL
b0d623f7
A
241export CFLAGS_X86_64 = -Dx86_64 -DX86_64 -D__X86_64__ -DLP64 \
242 -DPAGE_SIZE_FIXED -mkernel
2d21ac55 243export CFLAGS_ARM = -Darm -DARM -D__ARM__ -DPAGE_SIZE_FIXED \
c910b4d9
A
244 -fno-strict-aliasing -fno-keep-inline-functions
245
246ifeq (-arch armv7,$(ARCH_FLAGS_ARM))
247CFLAGS_ARM += -mthumb
2d21ac55
A
248endif
249ifeq (-arch armv6,$(ARCH_FLAGS_ARM))
250CFLAGS_ARM += -mthumb
251endif
4a3eedf9 252ifeq (-arch armv5,$(ARCH_FLAGS_ARM))
b7266188 253CFLAGS_ARM += -mno-thumb
4a3eedf9
A
254endif
255ifeq (-arch xscale,$(ARCH_FLAGS_ARM))
256CFLAGS_ARM += -mthumb
257endif
2d21ac55
A
258
259export CFLAGS_RELEASEPPC = -O2 -mcpu=750 -mmultiple
2d21ac55
A
260export CFLAGS_DEVELOPMENTPPC = -O2 -mcpu=750 -mmultiple
261export CFLAGS_DEBUGPPC = -O2 -mcpu=750 -mmultiple
262export CFLAGS_PROFILEPPC = -O2 -mcpu=750 -mmultiple
1c79356b 263
91447636 264export CFLAGS_RELEASEI386 = -Os
2d21ac55 265export CFLAGS_DEVELOPMENTI386 = -Os
91447636
A
266export CFLAGS_DEBUGI386 = -Os
267export CFLAGS_PROFILEI386 = -Os
1c79356b 268
b0d623f7
A
269export CFLAGS_RELEASEX86_64 = -Os
270export CFLAGS_DEVELOPMENTX86_64 = -Os
271# No space optimization for the DEBUG kernel for the benefit of gdb:
272export CFLAGS_DEBUGX86_64 = -O0
273export CFLAGS_PROFILEX86_64 = -Os
274
2d21ac55
A
275export CFLAGS_RELEASEARM = -O2
276export CFLAGS_DEVELOPMENTARM = -O2
277export CFLAGS_DEBUGARM = -O2
278export CFLAGS_PROFILEARM = -O2
279
1c79356b 280export CFLAGS = $(CFLAGS_GEN) \
2d21ac55
A
281 $($(addsuffix $(MACHINE_CONFIG),MACHINE_FLAGS_)) \
282 $($(addsuffix $(ARCH_CONFIG),ARCH_FLAGS_)) \
1c79356b
A
283 $($(addsuffix $(ARCH_CONFIG),CFLAGS_)) \
284 $($(addsuffix $(KERNEL_CONFIG),CFLAGS_)) \
285 $($(addsuffix $(ARCH_CONFIG), $(addsuffix $(KERNEL_CONFIG),CFLAGS_))) \
286 $(DEFINES)
287
55e303ae 288# Default C++ flags
1c79356b 289#
0c530ab8 290CXXFLAGS_GEN = -fno-rtti -fno-exceptions -fcheck-new -fapple-kext
1c79356b 291
55e303ae
A
292CXXFLAGS = $(CXXFLAGS_GEN) \
293 $($(addsuffix $(ARCH_CONFIG),CXXFLAGS_)) \
294 $($(addsuffix $(KERNEL_CONFIG),CXXFLAGS_))
1c79356b
A
295
296#
297# Assembler command
298#
0c530ab8
A
299AS = $(CC)
300S_KCC = $(CC)
1c79356b
A
301
302#
303# Default SFLAGS
304#
2d21ac55 305export SFLAGS_GEN = -static -D__ASSEMBLER__ $(OTHER_CFLAGS)
1c79356b
A
306
307export SFLAGS_RELEASE =
2d21ac55 308export SFLAGS_DEVELOPMENT =
1c79356b
A
309export SFLAGS_DEBUG =
310export SFLAGS_PROFILE =
311
2d21ac55
A
312export SFLAGS_PPC = $(CFLAGS_PPC) -force_cpusubtype_ALL
313export SFLAGS_I386 = $(CFLAGS_I386)
314export SFLAGS_ARM = $(CFLAGS_ARM)
b0d623f7 315export SFLAGS_X86_64 = $(CFLAGS_X86_64)
1c79356b
A
316
317export SFLAGS = $(SFLAGS_GEN) \
2d21ac55
A
318 $($(addsuffix $(MACHINE_CONFIG),MACHINE_FLAGS_)) \
319 $($(addsuffix $(ARCH_CONFIG),ARCH_FLAGS_)) \
1c79356b
A
320 $($(addsuffix $(ARCH_CONFIG),SFLAGS_)) \
321 $($(addsuffix $(KERNEL_CONFIG),SFLAGS_)) \
322 $(DEFINES)
323
324#
325# Linker command
326#
0c530ab8 327LD = $(KC++) -nostdlib
1c79356b
A
328
329#
330# Default LDFLAGS
331#
1c79356b 332
91447636
A
333export LDFLAGS_KERNEL_GEN = \
334 -static \
0c530ab8 335 -fapple-kext \
0c530ab8 336 -Wl,-e,__start \
0c530ab8
A
337 -Wl,-sectalign,__TEXT,__text,0x1000 \
338 -Wl,-sectalign,__DATA,__common,0x1000 \
339 -Wl,-sectalign,__DATA,__bss,0x1000 \
b0d623f7
A
340 -Wl,-sectcreate,__PRELINK_TEXT,__text,/dev/null \
341 -Wl,-sectcreate,__PRELINK_STATE,__kernel,/dev/null \
342 -Wl,-sectcreate,__PRELINK_STATE,__kexts,/dev/null \
343 -Wl,-sectcreate,__PRELINK_INFO,__info,/dev/null
344
345# Availability of DWARF allows DTrace CTF (compressed type format) to be constructed
346ifeq ($(BUILD_DWARF),1)
347export LDFLAGS_KERNEL_GEN += \
348 -Wl,-sectcreate,__CTF,__ctf,/dev/null
349endif
1c79356b
A
350
351export LDFLAGS_KERNEL_RELEASE =
2d21ac55 352export LDFLAGS_KERNEL_DEVELOPMENT =
1c79356b
A
353export LDFLAGS_KERNEL_DEBUG =
354export LDFLAGS_KERNEL_PROFILE =
355
91447636 356export LDFLAGS_KERNEL_PPC = \
2d21ac55
A
357 -force_cpusubtype_ALL \
358 -Wl,-new_linker \
b0d623f7 359 -Wl,-pagezero_size,0x0 \
0c530ab8
A
360 -Wl,-segaddr,__VECTORS,0x0 \
361 -Wl,-segaddr,__HIB,0x7000 \
362 -Wl,-segaddr,__TEXT,0xe000
91447636 363
b0d623f7
A
364export LDFLAGS_KERNEL_RELEASEI386 = \
365 -Wl,-new_linker \
366 -Wl,-pagezero_size,0x0 \
367 -Wl,-segaddr,__INITPT,0x00100000 \
368 -Wl,-segaddr,__INITGDT,0x00106000 \
369 -Wl,-segaddr,__SLEEP,0x00107000 \
370 -Wl,-segaddr,__HIB,0x00108000 \
371 -Wl,-image_base,0x200000 \
372 -Wl,-seg_page_size,__TEXT,0x200000
373
374export LDFLAGS_KERNEL_DEBUGI386 = $(LDFLAGS_KERNEL_RELEASEI386)
375export LDFLAGS_KERNEL_DEVELOPMENTI386 = $(LDFLAGS_KERNEL_RELEASEI386)
376export LDFLAGS_KERNEL_PROFILEI386 = $(LDFLAGS_KERNEL_RELEASEI386)
377
378# Keep these constants in sync with the *_SEG_BASE definitions in i386/pmap.h
379export LDFLAGS_KERNEL_RELEASEX86_64 = \
2d21ac55 380 -Wl,-new_linker \
b0d623f7
A
381 -Wl,-pagezero_size,0x0 \
382 -Wl,-segaddr,__INITPT,0xffffff8000100000 \
383 -Wl,-segaddr,__INITGDT,0xffffff8000106000 \
384 -Wl,-segaddr,__SLEEP,0xffffff8000107000 \
385 -Wl,-segaddr,__HIB,0xffffff8000108000 \
386 -Wl,-image_base,0xffffff8000200000 \
387 -Wl,-seg_page_size,__TEXT,0x200000
388
389export LDFLAGS_KERNEL_DEBUGX86_64 = $(LDFLAGS_KERNEL_RELEASEX86_64)
390export LDFLAGS_KERNEL_DEVELOPMENTX86_64 = $(LDFLAGS_KERNEL_RELEASEX86_64)
391export LDFLAGS_KERNEL_PROFILEX86_64 = $(LDFLAGS_KERNEL_RELEASEX86_64)
2d21ac55 392
d1ecb069 393export LDFLAGS_KERNEL_RELEASEARM = \
c910b4d9 394 -Wl,-new_linker \
b0d623f7 395 -Wl,-pagezero_size,0x0 \
d1ecb069 396 -Wl,-image_base,0xC0001000 \
b7266188 397 -Wl,-exported_symbols_list,$(TARGET)/kernel-kpi.exp
b0d623f7 398
d1ecb069
A
399export LDFLAGS_KERNEL_DEVELOPMENTARM = \
400 -Wl,-new_linker \
401 -Wl,-pagezero_size,0x0 \
402 -Wl,-image_base,0xC0001000
403
404export LDFLAGS_KERNEL_DEBUGARM = $(LDFLAGS_KERNEL_DEVELOPMENTARM)
405
1c79356b
A
406
407export LDFLAGS_KERNEL = $(LDFLAGS_KERNEL_GEN) \
2d21ac55
A
408 $($(addsuffix $(MACHINE_CONFIG),MACHINE_FLAGS_)) \
409 $($(addsuffix $(ARCH_CONFIG),ARCH_FLAGS_)) \
1c79356b 410 $($(addsuffix $(ARCH_CONFIG),LDFLAGS_KERNEL_)) \
b0d623f7
A
411 $($(addsuffix $(KERNEL_CONFIG),LDFLAGS_KERNEL_)) \
412 $($(addsuffix $(ARCH_CONFIG), $(addsuffix $(KERNEL_CONFIG),LDFLAGS_KERNEL_))) \
1c79356b
A
413
414
415#
416# Default runtime libraries to be linked with the kernel
417#
418export LD_KERNEL_LIBS = -lcc_kext
419
b0d623f7
A
420#
421# Command to generate host binaries. Intentionally not
422# $(CC), which controls the target compiler
423#
424HOST_CC = cc
425
1c79356b
A
426#
427# Default INCFLAGS
428#
429export INCFLAGS_IMPORT = $(patsubst %, -I$(OBJROOT)/EXPORT_HDRS/%, $(COMPONENT_IMPORT_LIST))
430export INCFLAGS_EXTERN = -I$(OBJROOT)/EXTERN_HDRS -I$(SRCROOT)/EXTERNAL_HEADERS -I$(SRCROOT)/EXTERNAL_HEADERS/bsd
91447636 431export INCFLAGS_GEN = -I$(SRCROOT)/$(COMPONENT) -I$(OBJROOT)/EXPORT_HDRS/$(COMPONENT)
1c79356b
A
432export INCFLAGS_POSIX = -I$(OBJROOT)/EXPORT_HDRS/bsd
433export INCFLAGS_LOCAL = -I.
434
9bccf70c 435export INCFLAGS = $(INCFLAGS_LOCAL) $(INCFLAGS_GEN) $(INCFLAGS_IMPORT) $(INCFLAGS_EXTERN) $(INCFLAGS_MAKEFILE)
1c79356b
A
436
437#
438# Default MIGFLAGS
439#
2d21ac55 440export MIGFLAGS = $(DEFINES) $(INCFLAGS) $($(addsuffix $(ARCH_CONFIG),CFLAGS_)) $($(addsuffix $(ARCH_CONFIG),ARCH_FLAGS_))
1c79356b
A
441
442#
443# Default VPATH
444#
445empty:=
446space:= $(empty) $(empty)
447export VPATH_IMPORT = $(subst $(space),:,$(patsubst %,$(OBJROOT)/EXPORT_HDRS/%,$(strip $(COMPONENT_IMPORT_LIST)))):
448export VPATH_EXTERN = $(OBJROOT)/EXTERN_HDRS:
449export VPATH_GEN = .:$(SOURCE):
450
451export VPATH = $(VPATH_GEN)$(VPATH_IMPORT)$(VPATH_EXTERN)$(VPATH_MAKEFILE)
452
453#
2d21ac55 454# Macros that control installation of kernel and its header files
1c79356b
A
455#
456# install flags for header files
457#
458INSTALL_FLAGS = -c -m 0444
d7e50217
A
459FILE_INSTALL_FLAGS = -c -m 0644
460DATA_INSTALL_FLAGS = -c -m 0644
1c79356b
A
461
462#
463# Header file destinations
464#
465FRAMEDIR = System/Library/Frameworks
466ifndef INCDIR
467 INCDIR = /usr/include
468endif
469ifndef LCLDIR
470 LCLDIR = $(FRAMEDIR)/System.framework/Versions/B/PrivateHeaders
471endif
472
473KINCVERS = A
474KINCFRAME = $(FRAMEDIR)/Kernel.framework
475KINCDIR = $(KINCFRAME)/Versions/$(KINCVERS)/Headers
0b4e3aa0 476KPINCDIR = $(KINCFRAME)/Versions/$(KINCVERS)/PrivateHeaders
91447636
A
477KRESDIR = $(KINCFRAME)/Versions/$(KINCVERS)/Resources
478
479XNU_PRIVATE_UNIFDEF = -UMACH_KERNEL_PRIVATE -UBSD_KERNEL_PRIVATE -UIOKIT_KERNEL_PRIVATE -ULIBKERN_KERNEL_PRIVATE -ULIBSA_KERNEL_PRIVATE -UPEXPERT_KERNEL_PRIVATE -UXNU_KERNEL_PRIVATE
480
2d21ac55
A
481SPINCFRAME_UNIFDEF = $(XNU_PRIVATE_UNIFDEF) -UKERNEL_PRIVATE -UKERNEL -DPRIVATE -U_OPEN_SOURCE_
482SINCFRAME_UNIFDEF = $(XNU_PRIVATE_UNIFDEF) -UKERNEL_PRIVATE -UKERNEL -UPRIVATE -D_OPEN_SOURCE_
483KPINCFRAME_UNIFDEF = $(XNU_PRIVATE_UNIFDEF) -DKERNEL_PRIVATE -DPRIVATE -DKERNEL -U_OPEN_SOURCE_
484KINCFRAME_UNIFDEF = $(XNU_PRIVATE_UNIFDEF) -UKERNEL_PRIVATE -UPRIVATE -DKERNEL -D_OPEN_SOURCE_
1c79356b 485
b0d623f7 486
1c79356b
A
487#
488# Compononent Header file destinations
489#
490EXPDIR = EXPORT_HDRS/$(COMPONENT)
491
492#
493# Strip Flags
494#
55e303ae 495export STRIP_FLAGS_RELEASE = -S -x
2d21ac55 496export STRIP_FLAGS_DEVELOPMENT = -S -x
1c79356b 497export STRIP_FLAGS_DEBUG = -S
55e303ae 498export STRIP_FLAGS_PROFILE = -S -x
1c79356b
A
499
500export STRIP_FLAGS = $($(addsuffix $(KERNEL_CONFIG),STRIP_FLAGS_))
501
2d21ac55
A
502#
503# dsymutil flags
504#
505export DSYMUTIL_FLAGS_I386 = --arch=i386
b0d623f7 506export DSYMUTIL_FLAGS_X86_64 = --arch=x86_64
2d21ac55
A
507export DSYMUTIL_FLAGS_PPC = --arch=ppc
508export DSYMUTIL_FLAGS_ARM = --arch=arm
509
510export DSYMUTIL_FLAGS = $($(addsuffix $(ARCH_CONFIG),DSYMUTIL_FLAGS_))
511
9bccf70c
A
512#
513# Man Page destination
514#
515MANDIR = usr/share/man
516
b0d623f7
A
517#
518# DEBUG alias location
519#
520DEVELOPER_EXTRAS_DIR = AppleInternal/Developer/Extras
2d21ac55 521
1c79356b
A
522#
523# This must be here before any rules are possibly defined by the
524# machine dependent makefile fragment so that a plain "make" command
525# always works. The config program will emit an appropriate rule to
526# cause "all" to depend on every kernel configuration it generates.
527#
528
529default: all
530
2d21ac55 531# vim: set ft=make: