The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/makedefs/MakeInc.def

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

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

Cache object: 619d0395f29e140b204c0730bf8906c9


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.