xref: /xnu-8020.101.4/makedefs/MakeInc.top (revision e7776783b89a353188416a9a346c6cdb4928faad)
1*e7776783SApple OSS Distributions# -*- mode: makefile;-*-
2*e7776783SApple OSS Distributions#
3*e7776783SApple OSS Distributions# Copyright (C) 2010-2020 Apple Inc. All rights reserved.
4*e7776783SApple OSS Distributions#
5*e7776783SApple OSS Distributions# MakeInc.top is the top-level makefile for the xnu
6*e7776783SApple OSS Distributions# build system. All the main XBS targets
7*e7776783SApple OSS Distributions# (like "installhdrs") are defined here, as
8*e7776783SApple OSS Distributions# well as globals that can be overridden on
9*e7776783SApple OSS Distributions# the command-line by the user.
10*e7776783SApple OSS Distributions#
11*e7776783SApple OSS Distributions# This makefile's main purpose is to bootstrap
12*e7776783SApple OSS Distributions# the user's intent ("build these 3 kernels")
13*e7776783SApple OSS Distributions# into 3 single-architecture builds that each
14*e7776783SApple OSS Distributions# invoke the recursive make build system.
15*e7776783SApple OSS Distributions# As such, we have no knowledge of how to build
16*e7776783SApple OSS Distributions# a kernel or perform actions other than
17*e7776783SApple OSS Distributions# invoking a sub-make with a different
18*e7776783SApple OSS Distributions# current directory, makefile, and target. One
19*e7776783SApple OSS Distributions# side effect of this is that each
20*e7776783SApple OSS Distributions# single-architecture build is responsible for
21*e7776783SApple OSS Distributions# inserting its build products into the final
22*e7776783SApple OSS Distributions# multi-architecture output files. To avoid
23*e7776783SApple OSS Distributions# races, these aggregating stages for
24*e7776783SApple OSS Distributions# "primary" build configs are done in serial.
25*e7776783SApple OSS Distributions#
26*e7776783SApple OSS Distributions
27*e7776783SApple OSS Distributionsexport MakeInc_cmd=${VERSDIR}/makedefs/MakeInc.cmd
28*e7776783SApple OSS Distributions
29*e7776783SApple OSS Distributionsinclude $(MakeInc_cmd)
30*e7776783SApple OSS Distributions
31*e7776783SApple OSS Distributions
32*e7776783SApple OSS Distributions#
33*e7776783SApple OSS Distributions# Architecture Configuration options
34*e7776783SApple OSS Distributions#
35*e7776783SApple OSS Distributions
36*e7776783SApple OSS Distributions# Default to current kernel architecture
37*e7776783SApple OSS Distributions
38*e7776783SApple OSS Distributionsifneq ($(filter $(SUPPORTED_EMBEDDED_PLATFORMS),$(PLATFORM)),)
39*e7776783SApple OSS Distributions     override DEFAULT_ARCH_CONFIG := ARM
40*e7776783SApple OSS Distributionselse ifneq ($(filter $(SUPPORTED_SIMULATOR_PLATFORMS),$(PLATFORM)),)
41*e7776783SApple OSS Distributions     override DEFAULT_ARCH_CONFIG := X86_64
42*e7776783SApple OSS Distributionselse
43*e7776783SApple OSS Distributions     override DEFAULT_ARCH_CONFIG := X86_64
44*e7776783SApple OSS Distributionsendif
45*e7776783SApple OSS Distributions
46*e7776783SApple OSS Distributions# Accept either explicit ARCH_CONFIGS or XBS-style RC_ARCHS
47*e7776783SApple OSS Distributionsifndef ARCH_CONFIGS
48*e7776783SApple OSS Distributionsifdef RC_ARCHS
49*e7776783SApple OSS DistributionsARCH_CONFIGS	:= $(shell printf "%s" "$(RC_ARCHS)" | $(TR) a-z A-Z | $(TR) " " "\n" | sort -u | $(TR) "\n" " ")
50*e7776783SApple OSS Distributionselse
51*e7776783SApple OSS DistributionsARCH_CONFIGS	:= DEFAULT
52*e7776783SApple OSS Distributionsendif
53*e7776783SApple OSS Distributionsendif
54*e7776783SApple OSS Distributions
55*e7776783SApple OSS Distributions#
56*e7776783SApple OSS Distributions# Kernel Configuration options
57*e7776783SApple OSS Distributions#
58*e7776783SApple OSS Distributions
59*e7776783SApple OSS DistributionsDEFAULT_PRODUCT_CONFIGS :=
60*e7776783SApple OSS Distributions
61*e7776783SApple OSS Distributionsifneq ($(filter $(RC_ProjectName),xnu_debug),)
62*e7776783SApple OSS Distributionsoverride DEFAULT_KERNEL_CONFIG := DEBUG
63*e7776783SApple OSS Distributionselse ifneq ($(filter $(RC_ProjectName),xnu_kasan),)
64*e7776783SApple OSS Distributionsoverride KERNEL_CONFIGS := KASAN
65*e7776783SApple OSS Distributionselse ifneq ($(filter $(SUPPORTED_EMBEDDED_PLATFORMS),$(PLATFORM)),)
66*e7776783SApple OSS Distributionsoverride DEFAULT_KERNEL_CONFIG := DEVELOPMENT
67*e7776783SApple OSS Distributionselse ifeq ($(PLATFORM),MacOSX)
68*e7776783SApple OSS Distributionsoverride DEFAULT_KERNEL_CONFIG := DEVELOPMENT
69*e7776783SApple OSS Distributionselse
70*e7776783SApple OSS Distributionsoverride DEFAULT_KERNEL_CONFIG := RELEASE
71*e7776783SApple OSS Distributionsendif
72*e7776783SApple OSS Distributions
73*e7776783SApple OSS Distributions# If KERNEL_CONFIGS is specified it should override default
74*e7776783SApple OSS Distributionsifndef KERNEL_CONFIGS
75*e7776783SApple OSS DistributionsKERNEL_CONFIGS := DEFAULT
76*e7776783SApple OSS Distributionsendif
77*e7776783SApple OSS Distributions
78*e7776783SApple OSS Distributions# If PRODUCT_CONFIGS is specified it should override default
79*e7776783SApple OSS Distributionsifndef PRODUCT_CONFIGS
80*e7776783SApple OSS DistributionsPRODUCT_CONFIGS := $(DEFAULT_PRODUCT_CONFIGS)
81*e7776783SApple OSS Distributionsendif
82*e7776783SApple OSS Distributions
83*e7776783SApple OSS Distributions#
84*e7776783SApple OSS Distributions# Machine Configuration options
85*e7776783SApple OSS Distributions#
86*e7776783SApple OSS Distributions
87*e7776783SApple OSS Distributionsoverride DEFAULT_I386_MACHINE_CONFIG := NONE
88*e7776783SApple OSS Distributionsoverride DEFAULT_X86_64_MACHINE_CONFIG := NONE
89*e7776783SApple OSS Distributionsoverride DEFAULT_X86_64H_MACHINE_CONFIG := NONE
90*e7776783SApple OSS Distributions
91*e7776783SApple OSS Distributionsifneq ($(findstring _Sim,$(RC_ProjectName)),)
92*e7776783SApple OSS Distributionsoverride DEFAULT_ARM_MACHINE_CONFIG	:= NONE
93*e7776783SApple OSS Distributionsoverride DEFAULT_ARM64_MACHINE_CONFIG	:= NONE
94*e7776783SApple OSS Distributionselse ifneq ($(findstring _host,$(RC_ProjectName)),)
95*e7776783SApple OSS Distributionsoverride DEFAULT_ARM_MACHINE_CONFIG	:= NONE
96*e7776783SApple OSS Distributionsoverride DEFAULT_ARM64_MACHINE_CONFIG	:= NONE
97*e7776783SApple OSS Distributionselse
98*e7776783SApple OSS Distributionsoverride DEFAULT_ARM_MACHINE_CONFIG	:= NONE
99*e7776783SApple OSS Distributionsoverride DEFAULT_ARM64_MACHINE_CONFIG	:= VMAPPLE
100*e7776783SApple OSS Distributionsendif
101*e7776783SApple OSS Distributions
102*e7776783SApple OSS Distributions# This is typically never specified (TARGET_CONFIGS is used)
103*e7776783SApple OSS Distributionsifndef MACHINE_CONFIGS
104*e7776783SApple OSS DistributionsMACHINE_CONFIGS	:= DEFAULT
105*e7776783SApple OSS Distributionsendif
106*e7776783SApple OSS Distributions
107*e7776783SApple OSS Distributions#
108*e7776783SApple OSS Distributions# Target configuration options.  NOTE - target configurations will
109*e7776783SApple OSS Distributions# override ARCH_CONFIGS and KERNEL_CONFIGS and MACHINE_CONFIGS.
110*e7776783SApple OSS Distributions#
111*e7776783SApple OSS Distributions# Target configs come in groups of three parameters.  The first is the
112*e7776783SApple OSS Distributions# kernel configuration, the second is the architecture configuration,
113*e7776783SApple OSS Distributions# and the third is the machine configuration.  You may pass in as
114*e7776783SApple OSS Distributions# many groups of configurations as you wish.  Each item passed in is
115*e7776783SApple OSS Distributions# seperated by whitespace.
116*e7776783SApple OSS Distributions#
117*e7776783SApple OSS Distributions# Example:
118*e7776783SApple OSS Distributions#	TARGET_CONFIGS="release ppc default debug i386 default release arm MX31ADS"
119*e7776783SApple OSS Distributions# Parameters may be in upper or lower case (they are converted to upper).
120*e7776783SApple OSS Distributions#
121*e7776783SApple OSS Distributions# "default" parameter is a special case.  It means use the default value for
122*e7776783SApple OSS Distributions# that parameter.  Here are the default values for each configuration:
123*e7776783SApple OSS Distributions#
124*e7776783SApple OSS Distributions# default kernel configuration = DEFAULT_KERNEL_CONFIG
125*e7776783SApple OSS Distributions# default architecture configuration = system architecture where you are running make.
126*e7776783SApple OSS Distributions
127*e7776783SApple OSS Distributionsifneq ($(filter $(SUPPORTED_PLATFORMS),$(PLATFORM)),)
128*e7776783SApple OSS Distributions
129*e7776783SApple OSS Distributions# Defaults for "make all_embedded"
130*e7776783SApple OSS Distributionsifeq ($(KERNEL_CONFIGS),DEFAULT)
131*e7776783SApple OSS DistributionsKERNEL_CONFIGS_EMBEDDED := RELEASE DEVELOPMENT
132*e7776783SApple OSS Distributionselse
133*e7776783SApple OSS DistributionsKERNEL_CONFIGS_EMBEDDED := $(KERNEL_CONFIGS)
134*e7776783SApple OSS Distributionsendif
135*e7776783SApple OSS Distributions
136*e7776783SApple OSS Distributionsifeq ($(ARCH_CONFIGS),DEFAULT)
137*e7776783SApple OSS DistributionsARCH_CONFIGS_EMBEDDED := ARM ARM64
138*e7776783SApple OSS DistributionsARCH_CONFIGS_DESKTOP := X86_64
139*e7776783SApple OSS Distributionselse
140*e7776783SApple OSS DistributionsARCH_CONFIGS_EMBEDDED := $(strip $(shell echo $(filter-out X86_64, $(ARCH_CONFIGS)) | $(TR) a-z A-Z))
141*e7776783SApple OSS DistributionsARCH_CONFIGS_DESKTOP := $(strip $(shell echo $(filter X86_64, $(ARCH_CONFIGS)) | $(TR) a-z A-Z))
142*e7776783SApple OSS Distributionsendif
143*e7776783SApple OSS Distributions
144*e7776783SApple OSS Distributions# Find supported products from the device map
145*e7776783SApple OSS Distributionsifneq ($(EMBEDDED_DEVICE_MAP),)
146*e7776783SApple OSS DistributionsDEVICEMAP_PRODUCTS_ARMV7  := $(shell $(EMBEDDED_DEVICE_MAP) -db $(EDM_DBPATH)		\
147*e7776783SApple OSS Distributions				-query 'SELECT DISTINCT TargetType			\
148*e7776783SApple OSS Distributions					FROM Files					\
149*e7776783SApple OSS Distributions					  INNER JOIN Manifests USING (manifestID)	\
150*e7776783SApple OSS Distributions					  INNER JOIN Targets USING (Target)		\
151*e7776783SApple OSS Distributions					WHERE (KernelMachOArchitecture LIKE "armv7"	\
152*e7776783SApple OSS Distributions					   AND fileType in ("KernelCache", "RestoreKernelCache"))')
153*e7776783SApple OSS DistributionsDEVICEMAP_PRODUCTS_ARMV7S := $(shell $(EMBEDDED_DEVICE_MAP) -db $(EDM_DBPATH)		\
154*e7776783SApple OSS Distributions				-query 'SELECT DISTINCT TargetType			\
155*e7776783SApple OSS Distributions					FROM Files					\
156*e7776783SApple OSS Distributions					  INNER JOIN Manifests USING (manifestID)	\
157*e7776783SApple OSS Distributions					  INNER JOIN Targets USING (Target)		\
158*e7776783SApple OSS Distributions					WHERE (KernelMachOArchitecture LIKE "armv7s"	\
159*e7776783SApple OSS Distributions					   AND fileType in ("KernelCache", "RestoreKernelCache"))')
160*e7776783SApple OSS DistributionsDEVICEMAP_PRODUCTS_ARMV7K := $(shell $(EMBEDDED_DEVICE_MAP) -db $(EDM_DBPATH)		\
161*e7776783SApple OSS Distributions				-query 'SELECT DISTINCT TargetType			\
162*e7776783SApple OSS Distributions					FROM Files					\
163*e7776783SApple OSS Distributions					  INNER JOIN Manifests USING (manifestID)	\
164*e7776783SApple OSS Distributions					  INNER JOIN Targets USING (Target)		\
165*e7776783SApple OSS Distributions					WHERE (KernelMachOArchitecture LIKE "armv7k"	\
166*e7776783SApple OSS Distributions					   AND fileType in ("KernelCache", "RestoreKernelCache"))')
167*e7776783SApple OSS DistributionsDEVICEMAP_PRODUCTS_ARM := $(DEVICEMAP_PRODUCTS_ARMV7) $(DEVICEMAP_PRODUCTS_ARMV7S) $(DEVICEMAP_PRODUCTS_ARMV7K)
168*e7776783SApple OSS Distributions
169*e7776783SApple OSS Distributions
170*e7776783SApple OSS DistributionsDEVICEMAP_PRODUCTS_ARM64 := $(shell $(EMBEDDED_DEVICE_MAP) -db $(EDM_DBPATH)		\
171*e7776783SApple OSS Distributions				-query 'SELECT DISTINCT TargetType			\
172*e7776783SApple OSS Distributions					FROM Files					\
173*e7776783SApple OSS Distributions					  INNER JOIN Manifests USING (manifestID)	\
174*e7776783SApple OSS Distributions					  INNER JOIN Targets USING (Target)		\
175*e7776783SApple OSS Distributions					WHERE (KernelMachOArchitecture LIKE "arm64"	\
176*e7776783SApple OSS Distributions					   AND fileType in ("KernelCache", "RestoreKernelCache"))')
177*e7776783SApple OSS DistributionsDEVICEMAP_PRODUCTS_OSX_ARM64 := $(shell $(EMBEDDED_DEVICE_MAP) -db $(EDM_DBPATH)		\
178*e7776783SApple OSS Distributions					-query 'SELECT DISTINCT TargetType			\
179*e7776783SApple OSS Distributions					      	FROM Files					\
180*e7776783SApple OSS Distributions					  	  INNER JOIN Manifests USING (manifestID)	\
181*e7776783SApple OSS Distributions					  	  INNER JOIN Targets USING (Target)		\
182*e7776783SApple OSS Distributions					    	WHERE (KernelMachOArchitecture LIKE "arm64"	\
183*e7776783SApple OSS Distributions					   	  AND fileType in ("KernelCache", "RestoreKernelCache") \
184*e7776783SApple OSS Distributions						  AND SDKPlatform == "macosx")')
185*e7776783SApple OSS Distributions
186*e7776783SApple OSS Distributions
187*e7776783SApple OSS Distributions# Generate a list of mappings of the form "n75:arm;t8002" based on the device map
188*e7776783SApple OSS DistributionsDEVICEMAP_PRODUCT_SOC_MAPPINGS := $(shell $(EMBEDDED_DEVICE_MAP) -db $(EDM_DBPATH) -query SELECT DISTINCT TargetType, KernelMachOArchitecture, KernelPlatform FROM Targets | awk -F\| '{ if ($$2 ~ /armv[0-9][a-z]?/) { print $$1 ":arm;" $$3 } else if ($$2 ~ /arm64[a-z]?/) { print $$1 ":arm64;" $$3 ";" $$4} else { print $$1 ":" $$2 ";" $$3 ";" $$4} }' )
189*e7776783SApple OSS Distributions
190*e7776783SApple OSS Distributions# use embedded_device_map
191*e7776783SApple OSS Distributionsendif
192*e7776783SApple OSS Distributions
193*e7776783SApple OSS Distributions# Map a product like "n75" to "arm;t8002"
194*e7776783SApple OSS Distributions# $(1) is a product name in lower case
195*e7776783SApple OSS Distributionsfunction_lookup_product = $(call function_substitute_word_with_replacement,	\
196*e7776783SApple OSS Distributions				 $(1),						\
197*e7776783SApple OSS Distributions				 $(DEVICEMAP_PRODUCT_SOC_MAPPINGS),		\
198*e7776783SApple OSS Distributions				 unknown_arch_for_$(1);unknown_platform_for_$(1) \
199*e7776783SApple OSS Distributions			   )
200*e7776783SApple OSS Distributions
201*e7776783SApple OSS Distributionsifneq ($(PLATFORM),MacOSX)
202*e7776783SApple OSS Distributionsifneq ($(EMBEDDED_DEVICE_MAP),)
203*e7776783SApple OSS Distributions# Generate a list of mappings for products that use a different platform for their kernel configuration than their true platform
204*e7776783SApple OSS Distributions# of the form "n71m:arm64;s8000;s8003". The 4th element is the true SoC platform, which will get an on-disk copy, while the
205*e7776783SApple OSS Distributions# kernel's recursive build system will build the 3rd element as the KernelPlatform
206*e7776783SApple OSS DistributionsDEVICEMAP_PRODUCT_SOC_ALIASES := $(shell $(EMBEDDED_DEVICE_MAP) -db $(EDM_DBPATH) -query SELECT DISTINCT TargetType, KernelMachOArchitecture, KernelPlatform, Platform FROM Targets WHERE KernelPlatform "!=" Platform | awk -F\| '{ if ($$2 ~ /armv[0-9][a-z]?/) { print $$1 ":arm;" $$3 ";" $$4} else if ($$2 ~ /arm64[a-z]?/) { print $$1 ":arm64;" $$3 ";" $$4} else { print $$1 ":" $$2 ";" $$3 ";" $$4} }' )
207*e7776783SApple OSS Distributions
208*e7776783SApple OSS Distributionsendif
209*e7776783SApple OSS Distributionsendif
210*e7776783SApple OSS Distributions
211*e7776783SApple OSS Distributionsfunction_lookup_product_alias = $(call function_substitute_word_with_replacement,	\
212*e7776783SApple OSS Distributions					$(1),						\
213*e7776783SApple OSS Distributions					$(DEVICEMAP_PRODUCT_SOC_ALIASES),		\
214*e7776783SApple OSS Distributions				 )
215*e7776783SApple OSS Distributionsendif
216*e7776783SApple OSS Distributions
217*e7776783SApple OSS Distributionsifeq ($(PLATFORM),MacOSX)
218*e7776783SApple OSS Distributions
219*e7776783SApple OSS Distributions# Defaults for "make all_desktop"
220*e7776783SApple OSS Distributionsifeq ($(KERNEL_CONFIGS),DEFAULT)
221*e7776783SApple OSS DistributionsKERNEL_CONFIGS_DESKTOP := RELEASE DEVELOPMENT
222*e7776783SApple OSS Distributionselse
223*e7776783SApple OSS DistributionsKERNEL_CONFIGS_DESKTOP := $(KERNEL_CONFIGS)
224*e7776783SApple OSS Distributionsendif
225*e7776783SApple OSS Distributions
226*e7776783SApple OSS Distributionsendif
227*e7776783SApple OSS Distributions
228*e7776783SApple OSS Distributionsifndef TARGET_CONFIGS
229*e7776783SApple OSS Distributionsifneq ($(PRODUCT_CONFIGS),)
230*e7776783SApple OSS Distributions# generate TARGET_CONFIGS using KERNEL_CONFIGS and PRODUCT_CONFIGS
231*e7776783SApple OSS DistributionsTARGET_CONFIGS := $(foreach my_devicemap_config,$(foreach my_product_config,$(shell printf "%s" "$(PRODUCT_CONFIGS)" | $(TR) A-Z a-z),$(call function_lookup_product,$(my_product_config))),$(foreach my_kernel_config,$(KERNEL_CONFIGS),$(my_kernel_config) $(subst ;, ,$(my_devicemap_config))))
232*e7776783SApple OSS DistributionsTARGET_CONFIGS_ALIASES := $(foreach my_devicemap_config,$(foreach my_product_config,$(shell printf "%s" "$(PRODUCT_CONFIGS)" | $(TR) A-Z a-z),$(call function_lookup_product_alias,$(my_product_config))),$(foreach my_kernel_config,$(KERNEL_CONFIGS),$(my_kernel_config) $(subst ;, ,$(my_devicemap_config))))
233*e7776783SApple OSS Distributionselse ifneq ($(filter %_release_embedded,$(MAKECMDGOALS)),)
234*e7776783SApple OSS Distributions# generate TARGET_CONFIGS for RELEASE kernel configs and products in the device map
235*e7776783SApple OSS DistributionsTARGET_CONFIGS := $(foreach my_devicemap_config,$(foreach my_arch_config,$(ARCH_CONFIGS_EMBEDDED),$(foreach my_product_config,$(DEVICEMAP_PRODUCTS_$(my_arch_config)),$(call function_lookup_product,$(my_product_config)))),$(foreach my_kernel_config,RELEASE,$(my_kernel_config) $(subst ;, ,$(my_devicemap_config))))
236*e7776783SApple OSS DistributionsTARGET_CONFIGS_ALIASES := $(foreach my_devicemap_config,$(foreach my_arch_config,$(ARCH_CONFIGS_EMBEDDED),$(foreach my_product_config,$(DEVICEMAP_PRODUCTS_$(my_arch_config)),$(call function_lookup_product_alias,$(my_product_config)))),$(foreach my_kernel_config,RELEASE,$(my_kernel_config) $(subst ;, ,$(my_devicemap_config))))
237*e7776783SApple OSS Distributionselse ifneq ($(filter %_development_embedded,$(MAKECMDGOALS)),)
238*e7776783SApple OSS Distributions# generate TARGET_CONFIGS for DEVELOPMENT kernel configs and products in the device map
239*e7776783SApple OSS DistributionsTARGET_CONFIGS := $(foreach my_devicemap_config,$(foreach my_arch_config,$(ARCH_CONFIGS_EMBEDDED),$(foreach my_product_config,$(DEVICEMAP_PRODUCTS_$(my_arch_config)),$(call function_lookup_product,$(my_product_config)))),$(foreach my_kernel_config,DEVELOPMENT,$(my_kernel_config) $(subst ;, ,$(my_devicemap_config))))
240*e7776783SApple OSS DistributionsTARGET_CONFIGS_ALIASES := $(foreach my_devicemap_config,$(foreach my_arch_config,$(ARCH_CONFIGS_EMBEDDED),$(foreach my_product_config,$(DEVICEMAP_PRODUCTS_$(my_arch_config)),$(call function_lookup_product_alias,$(my_product_config)))),$(foreach my_kernel_config,DEVELOPMENT,$(my_kernel_config) $(subst ;, ,$(my_devicemap_config))))
241*e7776783SApple OSS Distributionselse ifneq ($(filter %_embedded,$(MAKECMDGOALS)),)
242*e7776783SApple OSS Distributions# generate TARGET_CONFIGS for all kernel configs and products in the device map
243*e7776783SApple OSS DistributionsTARGET_CONFIGS := $(foreach my_devicemap_config,$(foreach my_arch_config,$(ARCH_CONFIGS_EMBEDDED),$(foreach my_product_config,$(DEVICEMAP_PRODUCTS_$(my_arch_config)),$(call function_lookup_product,$(my_product_config)))),$(foreach my_kernel_config,$(KERNEL_CONFIGS_EMBEDDED),$(my_kernel_config) $(subst ;, ,$(my_devicemap_config))))
244*e7776783SApple OSS DistributionsTARGET_CONFIGS_ALIASES := $(foreach my_devicemap_config,$(foreach my_arch_config,$(ARCH_CONFIGS_EMBEDDED),$(foreach my_product_config,$(DEVICEMAP_PRODUCTS_$(my_arch_config)),$(call function_lookup_product_alias,$(my_product_config)))),$(foreach my_kernel_config,$(KERNEL_CONFIGS_EMBEDDED),$(my_kernel_config) $(subst ;, ,$(my_devicemap_config))))
245*e7776783SApple OSS Distributionselse ifeq (xnu_headers_driverkit,$(RC_ProjectName))
246*e7776783SApple OSS Distributions# generate TARGET_CONFIGS for all kernel configs for B&I
247*e7776783SApple OSS DistributionsTARGET_CONFIGS = DEVELOPMENT arm64 DEFAULT DEVELOPMENT X86_64 DEFAULT
248*e7776783SApple OSS Distributionselse ifneq ($(filter %_desktop,$(MAKECMDGOALS)),)
249*e7776783SApple OSS Distributions# generate TARGET_CONFIGS for all kernel configs for B&I
250*e7776783SApple OSS DistributionsTARGET_CONFIGS := $(foreach my_kern_config, $(KERNEL_CONFIGS_DESKTOP), $(foreach my_arch_config, $(ARCH_CONFIGS_DESKTOP), $(foreach my_machine_config, $(MACHINE_CONFIGS), $(my_kern_config) $(my_arch_config) $(my_machine_config))))
251*e7776783SApple OSS DistributionsTARGET_CONFIGS += $(foreach my_devicemap_config,$(foreach my_arch_config,$(ARCH_CONFIGS_EMBEDDED),$(foreach my_product_config,$(DEVICEMAP_PRODUCTS_OSX_$(my_arch_config)),$(call function_lookup_product,$(my_product_config)))),$(foreach my_kernel_config,$(KERNEL_CONFIGS_EMBEDDED),$(my_kernel_config) $(subst ;, ,$(my_devicemap_config))))
252*e7776783SApple OSS DistributionsTARGET_CONFIGS_ALIASES := $(foreach my_devicemap_config,$(foreach my_arch_config,$(ARCH_CONFIGS_EMBEDDED),$(foreach my_product_config,$(DEVICEMAP_PRODUCTS_OSX_$(my_arch_config)),$(call function_lookup_product_alias,$(my_product_config)))),$(foreach my_kernel_config,$(KERNEL_CONFIGS_EMBEDDED),$(my_kernel_config) $(subst ;, ,$(my_devicemap_config))))
253*e7776783SApple OSS Distributionselse
254*e7776783SApple OSS Distributions# generate TARGET_CONFIGS using KERNEL_CONFIGS and ARCH_CONFIGS and MACHINE_CONFIGS (which defaults to "DEFAULT")
255*e7776783SApple OSS DistributionsTARGET_CONFIGS := $(foreach my_kern_config, $(KERNEL_CONFIGS), $(foreach my_arch_config, $(ARCH_CONFIGS), $(foreach my_machine_config, $(MACHINE_CONFIGS), $(my_kern_config) $(my_arch_config) $(my_machine_config))))
256*e7776783SApple OSS DistributionsTARGET_CONFIGS_ALIASES :=
257*e7776783SApple OSS Distributionsendif
258*e7776783SApple OSS Distributionsendif
259*e7776783SApple OSS Distributions
260*e7776783SApple OSS Distributionsifeq ($(TARGET_CONFIGS),)
261*e7776783SApple OSS Distributions$(error No TARGET_CONFIGS specified)
262*e7776783SApple OSS Distributionsendif
263*e7776783SApple OSS Distributions
264*e7776783SApple OSS DistributionsTARGET_CONFIGS_UC := $(strip $(shell printf "%s" "$(TARGET_CONFIGS)" | $(TR) a-z A-Z))
265*e7776783SApple OSS DistributionsTARGET_CONFIGS_ALIASES_UC := $(strip $(shell printf "%s" "$(TARGET_CONFIGS_ALIASES)" | $(TR) a-z A-Z))
266*e7776783SApple OSS Distributions
267*e7776783SApple OSS Distributions#
268*e7776783SApple OSS Distributions# Build Configurations
269*e7776783SApple OSS Distributions#
270*e7776783SApple OSS Distributions# TARGET_CONFIGS is unwieldy for use in Makefiles. Convert them to
271*e7776783SApple OSS Distributions# "build configurations" which are tuples joined by "^". For
272*e7776783SApple OSS Distributions# example, "RELEASE I386 DEFAULT DEVELOPMENT ARM DEFAULT" becomes
273*e7776783SApple OSS Distributions# "RELEASE^I386^NONE DEVELOPMENT^ARM^T8002", which can be looped
274*e7776783SApple OSS Distributions# over trivially. PRIMARY_BUILD_CONFIGS is the first config
275*e7776783SApple OSS Distributions# for each architecture, used primarily for machine-dependent recursion.
276*e7776783SApple OSS Distributions# VARIANT_CONFIGS contains one build configuration for each combination
277*e7776783SApple OSS Distributions# of kernel architecture and configuration. It is used for variant
278*e7776783SApple OSS Distributions# installation recursion.
279*e7776783SApple OSS Distributions
280*e7776783SApple OSS DistributionsBUILD_CONFIGS = $(call function_create_build_configs, $(TARGET_CONFIGS_UC))
281*e7776783SApple OSS Distributions
282*e7776783SApple OSS DistributionsPRIMARY_ARCHS = $(strip $(sort $(foreach build_config, $(BUILD_CONFIGS), $(call function_extract_arch_config_from_build_config, $(build_config)))))
283*e7776783SApple OSS DistributionsPRIMARY_BUILD_CONFIGS = $(strip $(foreach arch, $(PRIMARY_ARCHS), $(firstword $(foreach build_config, $(BUILD_CONFIGS), $(if $(filter $(arch),$(call function_extract_arch_config_from_build_config, $(build_config))), $(build_config), )))))
284*e7776783SApple OSS DistributionsNON_PRIMARY_BUILD_CONFIGS = $(strip $(filter-out $(PRIMARY_BUILD_CONFIGS), $(BUILD_CONFIGS)))
285*e7776783SApple OSS DistributionsFIRST_BUILD_CONFIG = $(firstword $(BUILD_CONFIGS))
286*e7776783SApple OSS Distributions
287*e7776783SApple OSS Distributions# Build list of all kernel configurations present in all build configs.
288*e7776783SApple OSS DistributionsPRIMARY_KERNEL_CONFIGS = $(strip $(sort $(foreach build_config, $(BUILD_CONFIGS), $(call function_extract_kernel_config_from_build_config, $(build_config)))))
289*e7776783SApple OSS Distributions
290*e7776783SApple OSS Distributions# Pick one build configuration for each kernel configuration.
291*e7776783SApple OSS Distributions# This will be used to populate System.kext variants in SYMROOT / DSTROOT.
292*e7776783SApple OSS DistributionsVARIANT_CONFIGS = $(strip \
293*e7776783SApple OSS Distributions                    $(foreach kernel_config, $(PRIMARY_KERNEL_CONFIGS), \
294*e7776783SApple OSS Distributions                      $(firstword $(call function_match_build_config_for_kernel_config, $(BUILD_CONFIGS), $(kernel_config)))))
295*e7776783SApple OSS Distributions
296*e7776783SApple OSS Distributionsifneq ($(TARGET_CONFIGS_ALIASES_UC),)
297*e7776783SApple OSS DistributionsALIAS_CONFIGS = $(call function_create_alias_configs, $(TARGET_CONFIGS_ALIASES_UC))
298*e7776783SApple OSS Distributionselse
299*e7776783SApple OSS DistributionsALIAS_CONFIGS =
300*e7776783SApple OSS Distributionsendif
301*e7776783SApple OSS Distributions
302*e7776783SApple OSS Distributions# $(warning PRIMARY_ARCHS is $(PRIMARY_ARCHS))
303*e7776783SApple OSS Distributions# $(warning TARGET_CONFIGS is $(TARGET_CONFIGS))
304*e7776783SApple OSS Distributions# $(warning BUILD_CONFIGS is $(BUILD_CONFIGS))
305*e7776783SApple OSS Distributions# $(warning PRIMARY_BUILD_CONFIGS is $(PRIMARY_BUILD_CONFIGS))
306*e7776783SApple OSS Distributions# $(warning NON_PRIMARY_BUILD_CONFIGS is $(NON_PRIMARY_BUILD_CONFIGS))
307*e7776783SApple OSS Distributions# $(warning TARGET_CONFIGS_ALIASES is $(TARGET_CONFIGS_ALIASES))
308*e7776783SApple OSS Distributions# $(warning ALIAS_CONFIGS is $(ALIAS_CONFIGS))
309*e7776783SApple OSS Distributions# $(warning PRIMARY_KERNEL_CONFIGS is $(PRIMARY_KERNEL_CONFIGS))
310*e7776783SApple OSS Distributions# $(warning VARIANT_CONFIGS is $(VARIANT_CONFIGS))
311*e7776783SApple OSS Distributions
312*e7776783SApple OSS DistributionsMEMORY_SIZE := $(shell /usr/sbin/sysctl -n hw.memsize)
313*e7776783SApple OSS Distributions
314*e7776783SApple OSS Distributions# Assume LTO scaling by default, unless it is being explicitly passed on the command-line
315*e7776783SApple OSS DistributionsLARGE_BUILD_FOOTPRINT := $(if $(BUILD_LTO),$(BUILD_LTO),1)
316*e7776783SApple OSS Distributions
317*e7776783SApple OSS Distributionsifeq ($(LARGE_BUILD_FOOTPRINT),1)
318*e7776783SApple OSS DistributionsRAM_PER_KERNEL_BUILD := 4294967296
319*e7776783SApple OSS Distributionselse
320*e7776783SApple OSS DistributionsRAM_PER_KERNEL_BUILD := 268435456
321*e7776783SApple OSS Distributionsendif
322*e7776783SApple OSS Distributions
323*e7776783SApple OSS DistributionsKERNEL_BUILDS_IN_PARALLEL := $(shell if [ $(MEMORY_SIZE) -le $$((1 * $(RAM_PER_KERNEL_BUILD))) ]; then echo 1; elif [ $(MEMORY_SIZE) -gt $$(($(SYSCTL_HW_PHYSICALCPU) * $(RAM_PER_KERNEL_BUILD))) ]; then echo $(SYSCTL_HW_PHYSICALCPU); else expr $(MEMORY_SIZE) / $(RAM_PER_KERNEL_BUILD); fi )
324*e7776783SApple OSS Distributions# $(warning Building $(KERNEL_BUILDS_IN_PARALLEL) kernels in parallel)
325*e7776783SApple OSS Distributions
326*e7776783SApple OSS Distributions#
327*e7776783SApple OSS Distributions# TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template
328*e7776783SApple OSS Distributions#
329*e7776783SApple OSS Distributions# $(1) is the name of the makefile target to invoke for the each build config
330*e7776783SApple OSS Distributions#      after setting up the parallel hierarchy in the TARGET directory
331*e7776783SApple OSS Distributions# $(2) is an optional suffix on the TARGET directory, which might even be
332*e7776783SApple OSS Distributions#      "/.."
333*e7776783SApple OSS Distributions# $(3) are any dependencies for the bootstrap target
334*e7776783SApple OSS Distributions# $(4) are any dependencies that are expanded per-build config to another bootstrap target
335*e7776783SApple OSS Distributions# $(5) is how many build configurations to build in parallel
336*e7776783SApple OSS Distributions# $(6) is which build configs to build in parallel
337*e7776783SApple OSS Distributions#
338*e7776783SApple OSS Distributions# Since building many configurations in parallel may overwhelm the system,
339*e7776783SApple OSS Distributions# we try to throttle behavior into more managable S "stripes" of N/S
340*e7776783SApple OSS Distributions# configurations by generating sequential dependencies between configs
341*e7776783SApple OSS Distributions# in each stripe. That ensures that only S kernel builds are occurring
342*e7776783SApple OSS Distributions# at once at any point in time
343*e7776783SApple OSS Distributions
344*e7776783SApple OSS Distributionsdefine TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template
345*e7776783SApple OSS Distributions
346*e7776783SApple OSS Distributions# Create a list of synthesized targets for each build config
347*e7776783SApple OSS Distributions$(1)_bootstrap_target_list = $$(addprefix $(1)_bootstrap_,$(6))
348*e7776783SApple OSS Distributions
349*e7776783SApple OSS Distributions.PHONY: $$($(1)_bootstrap_target_list)
350*e7776783SApple OSS Distributions
351*e7776783SApple OSS Distributions$(1)_generated_stripe_dependencies = $$(call _function_generate_stripe_groupings,$(1),$(5),$(call reverse,$(6)))
352*e7776783SApple OSS Distributionsifeq ($$(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
353*e7776783SApple OSS Distributions$$(warning Generate makefile fragment: $$($(1)_generated_stripe_dependencies))
354*e7776783SApple OSS Distributionsendif
355*e7776783SApple OSS Distributions$$(eval $$($(1)_generated_stripe_dependencies))
356*e7776783SApple OSS Distributions
357*e7776783SApple OSS Distributions$$($(1)_bootstrap_target_list): $(1)_bootstrap_% : $(1)_stripe_dep_for_% $$(addsuffix _bootstrap_%,$(4)) $(3)
358*e7776783SApple OSS Distributions	$$(_v)$$(MKDIR) $${OBJROOT}/$$(call function_convert_build_config_to_objdir,$$(patsubst $(1)_bootstrap_%,%,$$@))$(2)
359*e7776783SApple OSS Distributions	$$(_v)$${MAKE}													        \
360*e7776783SApple OSS Distributions		-C $${OBJROOT}/$$(call function_convert_build_config_to_objdir,$$(patsubst $(1)_bootstrap_%,%,$$@))$(2)		\
361*e7776783SApple OSS Distributions		-f $${SRCROOT}/Makefile												\
362*e7776783SApple OSS Distributions		CURRENT_KERNEL_CONFIG=$$(call function_extract_kernel_config_from_build_config,$$(patsubst $(1)_bootstrap_%,%,$$@)) \
363*e7776783SApple OSS Distributions		CURRENT_ARCH_CONFIG=$$(call function_extract_arch_config_from_build_config,$$(patsubst $(1)_bootstrap_%,%,$$@))	  \
364*e7776783SApple OSS Distributions		CURRENT_MACHINE_CONFIG=$$(call function_extract_machine_config_from_build_config,$$(patsubst $(1)_bootstrap_%,%,$$@))	\
365*e7776783SApple OSS Distributions		CURRENT_BUILD_CONFIG=$$(patsubst $(1)_bootstrap_%,%,$$@)							\
366*e7776783SApple OSS Distributions		PRIMARY_BUILD_CONFIGS="$(PRIMARY_BUILD_CONFIGS)" BUILD_CONFIGS="$(BUILD_CONFIGS)"				\
367*e7776783SApple OSS Distributions		SOURCE=$${SRCROOT}/												\
368*e7776783SApple OSS Distributions		RELATIVE_SOURCE_PATH=.											\
369*e7776783SApple OSS Distributions		TARGET=$${OBJROOT}/$$(call function_convert_build_config_to_objdir,$$(patsubst $(1)_bootstrap_%,%,$$@))$(2)/	\
370*e7776783SApple OSS Distributions		OBJPATH=$${OBJROOT}/$$(call function_convert_build_config_to_objdir,$$(patsubst $(1)_bootstrap_%,%,$$@))	\
371*e7776783SApple OSS Distributions		$(1)
372*e7776783SApple OSS Distributions
373*e7776783SApple OSS Distributions.PHONY: $(1)_bootstrap
374*e7776783SApple OSS Distributions
375*e7776783SApple OSS Distributions$(1)_bootstrap: $$($(1)_bootstrap_target_list)
376*e7776783SApple OSS Distributionsendef
377*e7776783SApple OSS Distributions
378*e7776783SApple OSS Distributions#
379*e7776783SApple OSS Distributions# TOP_LEVEL_STRIPE_DEPENDENCY_template
380*e7776783SApple OSS Distributions#
381*e7776783SApple OSS Distributions# $(1) is the Makefile target we are building for
382*e7776783SApple OSS Distributions# $(2) is the build config that must build first
383*e7776783SApple OSS Distributions# $(3) is the build config that must build after $(2)
384*e7776783SApple OSS Distributions
385*e7776783SApple OSS Distributionsdefine TOP_LEVEL_STRIPE_DEPENDENCY_template
386*e7776783SApple OSS Distributions
387*e7776783SApple OSS Distributions.PHONY: $(1)_stripe_dep_for_$(3)
388*e7776783SApple OSS Distributions
389*e7776783SApple OSS Distributions $(1)_stripe_dep_for_$(3): $(if $(2),$(1)_bootstrap_$(2))
390*e7776783SApple OSS Distributions
391*e7776783SApple OSS Distributionsendef
392*e7776783SApple OSS Distributions
393*e7776783SApple OSS Distributions# $(1) is the Makefile target we are building for
394*e7776783SApple OSS Distributions# $(2) is the stripe size
395*e7776783SApple OSS Distributions# $(3) is the list of the build configs in the current group
396*e7776783SApple OSS Distributions# $(4) is the list of remaining build configs
397*e7776783SApple OSS Distributions_function_generate_stripe_groupings_recursive = $(foreach stripe_index,$(call sequence,$(2)),$(if $(word $(stripe_index),$(4)),$(call TOP_LEVEL_STRIPE_DEPENDENCY_template,$(1),$(word $(stripe_index),$(3)),$(word $(stripe_index),$(4))))) $(if $(word $(call increment,$(2)),$(4)),$(call _function_generate_stripe_groupings_recursive,$(1),$(2),$(wordlist 1,$(2),$(4)),$(wordlist $(call increment,$(2)),$(words $(4)),$(4))))
398*e7776783SApple OSS Distributions
399*e7776783SApple OSS Distributions# $(1) is the Makefile target we are building for
400*e7776783SApple OSS Distributions# $(2) is the stripe size
401*e7776783SApple OSS Distributions# $(3) is the list of the build configs
402*e7776783SApple OSS Distributions_function_generate_stripe_groupings = $(call _function_generate_stripe_groupings_recursive,$(1),$(2),,$(3))
403*e7776783SApple OSS Distributions
404*e7776783SApple OSS Distributions#
405*e7776783SApple OSS Distributions# Setup pass for build system tools
406*e7776783SApple OSS Distributions#
407*e7776783SApple OSS Distributions
408*e7776783SApple OSS Distributionsgenerated_top_level_build_setup = $(call TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template,build_setup,/..,,,1,$(FIRST_BUILD_CONFIG))
409*e7776783SApple OSS Distributionsifeq ($(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
410*e7776783SApple OSS Distributions$(warning Generate makefile fragment: $(generated_top_level_build_setup))
411*e7776783SApple OSS Distributionsendif
412*e7776783SApple OSS Distributions$(eval $(generated_top_level_build_setup))
413*e7776783SApple OSS Distributions
414*e7776783SApple OSS Distributions.PHONY: setup
415*e7776783SApple OSS Distributions
416*e7776783SApple OSS Distributions# invalidate current kernel in $(SYMROOT). Timestamp must be +1 from a previous kernel build
417*e7776783SApple OSS Distributionssetup: build_setup_bootstrap
418*e7776783SApple OSS Distributions	$(_v)$(TOUCH) $(OBJROOT)/.mach_kernel.timestamp.new
419*e7776783SApple OSS Distributions    # -nt and -ot are evaluated differently by bash, dash, and zsh (and are not part of the POSIX specification).
420*e7776783SApple OSS Distributions    # Explicitly specify what should happen when the right hand file doesn't exist.
421*e7776783SApple OSS Distributions	$(_v)while [ \! $(OBJROOT)/.mach_kernel.timestamp.new -nt $(OBJROOT)/.mach_kernel.timestamp -a \( \! -e $(OBJROOT)/.mach_kernel.timestamp.new -o -e $(OBJROOT)/.mach_kernel.timestamp \) ]; do \
422*e7776783SApple OSS Distributions		$(SLEEP) 1;					\
423*e7776783SApple OSS Distributions		$(TOUCH) $(OBJROOT)/.mach_kernel.timestamp.new;	\
424*e7776783SApple OSS Distributions	done
425*e7776783SApple OSS Distributions	$(_v)$(MV) $(OBJROOT)/.mach_kernel.timestamp.new $(OBJROOT)/.mach_kernel.timestamp
426*e7776783SApple OSS Distributions	$(_v)$(TOUCH) $(OBJROOT)/.symbolset.timestamp.new
427*e7776783SApple OSS Distributions	$(_v)while [ $(OBJROOT)/.symbolset.timestamp.new -ot $(OBJROOT)/.symbolset.timestamp ]; do \
428*e7776783SApple OSS Distributions		$(SLEEP) 1;					\
429*e7776783SApple OSS Distributions		$(TOUCH) $(OBJROOT)/.symbolset.timestamp.new;	\
430*e7776783SApple OSS Distributions	done
431*e7776783SApple OSS Distributions	$(_v)$(MV) $(OBJROOT)/.symbolset.timestamp.new $(OBJROOT)/.symbolset.timestamp
432*e7776783SApple OSS Distributions
433*e7776783SApple OSS Distributions#
434*e7776783SApple OSS Distributions# Install kernel header files
435*e7776783SApple OSS Distributions#
436*e7776783SApple OSS Distributions.PHONY: exporthdrs exporthdrs_mi exporthdrs_md
437*e7776783SApple OSS Distributions
438*e7776783SApple OSS Distributionsexporthdrs: exporthdrs_mi exporthdrs_md
439*e7776783SApple OSS Distributions
440*e7776783SApple OSS Distributions#
441*e7776783SApple OSS Distributions# Install machine independent kernel header files
442*e7776783SApple OSS Distributions#
443*e7776783SApple OSS Distributions
444*e7776783SApple OSS Distributionsgenerated_top_level_build_exporthdrs_mi = $(call TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template,build_exporthdrs_mi,,setup,,1,$(FIRST_BUILD_CONFIG))
445*e7776783SApple OSS Distributionsifeq ($(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
446*e7776783SApple OSS Distributions$(warning Generate makefile fragment: $(generated_top_level_build_exporthdrs_mi))
447*e7776783SApple OSS Distributionsendif
448*e7776783SApple OSS Distributions$(eval $(generated_top_level_build_exporthdrs_mi))
449*e7776783SApple OSS Distributions
450*e7776783SApple OSS Distributionsexporthdrs_mi: build_exporthdrs_mi_bootstrap
451*e7776783SApple OSS Distributions
452*e7776783SApple OSS Distributions#
453*e7776783SApple OSS Distributions# Install machine dependent kernel header files
454*e7776783SApple OSS Distributions#
455*e7776783SApple OSS Distributions
456*e7776783SApple OSS Distributionsgenerated_top_level_build_exporthdrs_md = $(call TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template,build_exporthdrs_md,,setup,,$(KERNEL_BUILDS_IN_PARALLEL),$(PRIMARY_BUILD_CONFIGS))
457*e7776783SApple OSS Distributionsifeq ($(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
458*e7776783SApple OSS Distributions$(warning Generate makefile fragment: $(generated_top_level_build_exporthdrs_md))
459*e7776783SApple OSS Distributionsendif
460*e7776783SApple OSS Distributions$(eval $(generated_top_level_build_exporthdrs_md))
461*e7776783SApple OSS Distributions
462*e7776783SApple OSS Distributionsexporthdrs_md: build_exporthdrs_md_bootstrap
463*e7776783SApple OSS Distributions
464*e7776783SApple OSS Distributions#
465*e7776783SApple OSS Distributions# Install kernel header files
466*e7776783SApple OSS Distributions#
467*e7776783SApple OSS Distributions
468*e7776783SApple OSS Distributions.PHONY: installhdrs installhdrs_mi installhdrs_md
469*e7776783SApple OSS Distributions
470*e7776783SApple OSS Distributionsifneq ($(filter $(RC_ProjectName),xnu_debug),)
471*e7776783SApple OSS Distributionsinstallhdrs:
472*e7776783SApple OSS Distributions	@:
473*e7776783SApple OSS Distributionselse ifneq ($(filter $(RC_ProjectName),xnu_kasan),)
474*e7776783SApple OSS Distributionsinstallhdrs:
475*e7776783SApple OSS Distributions	@:
476*e7776783SApple OSS Distributionselse
477*e7776783SApple OSS Distributions
478*e7776783SApple OSS Distributionsinstallhdrs: installhdrs_mi installhdrs_md
479*e7776783SApple OSS Distributionsendif
480*e7776783SApple OSS Distributions
481*e7776783SApple OSS Distributions.PHONY: installhdrs_embedded installhdrs_release_embedded installhdrs_development_embedded installhdrs_desktop
482*e7776783SApple OSS Distributions
483*e7776783SApple OSS Distributionsinstallhdrs_embedded installhdrs_release_embedded installhdrs_desktop: installhdrs
484*e7776783SApple OSS Distributions
485*e7776783SApple OSS Distributionsinstallhdrs_development_embedded:
486*e7776783SApple OSS Distributions
487*e7776783SApple OSS Distributions#
488*e7776783SApple OSS Distributions# Install machine independent header files
489*e7776783SApple OSS Distributions#
490*e7776783SApple OSS Distributions
491*e7776783SApple OSS Distributionsgenerated_top_level_build_installhdrs_mi = $(call TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template,build_installhdrs_mi,,setup,build_exporthdrs_mi,1,$(FIRST_BUILD_CONFIG))
492*e7776783SApple OSS Distributionsifeq ($(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
493*e7776783SApple OSS Distributions$(warning Generate makefile fragment: $(generated_top_level_build_installhdrs_mi))
494*e7776783SApple OSS Distributionsendif
495*e7776783SApple OSS Distributions$(eval $(generated_top_level_build_installhdrs_mi))
496*e7776783SApple OSS Distributions
497*e7776783SApple OSS Distributionsinstallhdrs_mi: build_installhdrs_mi_bootstrap
498*e7776783SApple OSS Distributions
499*e7776783SApple OSS Distributions#
500*e7776783SApple OSS Distributions# Install machine dependent kernel header files
501*e7776783SApple OSS Distributions#
502*e7776783SApple OSS Distributions
503*e7776783SApple OSS Distributionsgenerated_top_level_build_installhdrs_md = $(call TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template,build_installhdrs_md,,setup,build_exporthdrs_md,$(KERNEL_BUILDS_IN_PARALLEL),$(PRIMARY_BUILD_CONFIGS))
504*e7776783SApple OSS Distributionsifeq ($(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
505*e7776783SApple OSS Distributions$(warning Generate makefile fragment: $(generated_top_level_build_installhdrs_md))
506*e7776783SApple OSS Distributionsendif
507*e7776783SApple OSS Distributions$(eval $(generated_top_level_build_installhdrs_md))
508*e7776783SApple OSS Distributions
509*e7776783SApple OSS Distributionsinstallhdrs_md: build_installhdrs_md_bootstrap
510*e7776783SApple OSS Distributions
511*e7776783SApple OSS Distributions.PHONY: install_textfiles install_textfiles_mi install_textfiles_md
512*e7776783SApple OSS Distributions
513*e7776783SApple OSS Distributionsinstall_textfiles: install_textfiles_mi install_textfiles_md
514*e7776783SApple OSS Distributions
515*e7776783SApple OSS Distributions#
516*e7776783SApple OSS Distributions#  Install machine independent text files (man pages, dtrace scripts, etc.)
517*e7776783SApple OSS Distributions#
518*e7776783SApple OSS Distributions
519*e7776783SApple OSS Distributionsgenerated_top_level_textfiles_install_mi = $(call TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template,textfiles_install_mi,,setup,,1,$(FIRST_BUILD_CONFIG))
520*e7776783SApple OSS Distributionsifeq ($(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
521*e7776783SApple OSS Distributions$(warning Generate makefile fragment: $(generated_top_level_textfiles_install_mi))
522*e7776783SApple OSS Distributionsendif
523*e7776783SApple OSS Distributions$(eval $(generated_top_level_textfiles_install_mi))
524*e7776783SApple OSS Distributions
525*e7776783SApple OSS Distributionsinstall_textfiles_mi: textfiles_install_mi_bootstrap
526*e7776783SApple OSS Distributions
527*e7776783SApple OSS Distributions#
528*e7776783SApple OSS Distributions#  Install machine dependent text files (man pages, dtrace scripts, etc.)
529*e7776783SApple OSS Distributions#
530*e7776783SApple OSS Distributions
531*e7776783SApple OSS Distributionsgenerated_top_level_textfiles_install_md = $(call TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template,textfiles_install_md,,setup,,$(KERNEL_BUILDS_IN_PARALLEL),$(PRIMARY_BUILD_CONFIGS))
532*e7776783SApple OSS Distributionsifeq ($(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
533*e7776783SApple OSS Distributions$(warning Generate makefile fragment: $(generated_top_level_textfiles_install_md))
534*e7776783SApple OSS Distributionsendif
535*e7776783SApple OSS Distributions$(eval $(generated_top_level_textfiles_install_md))
536*e7776783SApple OSS Distributions
537*e7776783SApple OSS Distributionsinstall_textfiles_md: textfiles_install_md_bootstrap
538*e7776783SApple OSS Distributions
539*e7776783SApple OSS Distributions#
540*e7776783SApple OSS Distributions# Build all architectures for all Configuration/Architecture options
541*e7776783SApple OSS Distributions#
542*e7776783SApple OSS Distributions
543*e7776783SApple OSS Distributionsgenerated_top_level_build_all = $(call TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template,build_all,,setup exporthdrs,,$(KERNEL_BUILDS_IN_PARALLEL),$(BUILD_CONFIGS))
544*e7776783SApple OSS Distributionsifeq ($(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
545*e7776783SApple OSS Distributions$(warning Generate makefile fragment: $(generated_top_level_build_all))
546*e7776783SApple OSS Distributionsendif
547*e7776783SApple OSS Distributions$(eval $(generated_top_level_build_all))
548*e7776783SApple OSS Distributions
549*e7776783SApple OSS Distributions.PHONY: build
550*e7776783SApple OSS Distributions
551*e7776783SApple OSS Distributionsbuild: build_all_bootstrap
552*e7776783SApple OSS Distributions
553*e7776783SApple OSS Distributions#
554*e7776783SApple OSS Distributions# Post-process build results
555*e7776783SApple OSS Distributions#
556*e7776783SApple OSS Distributions
557*e7776783SApple OSS Distributionsgenerated_top_level_config_all = $(call TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template,config_all,,setup,build_all,$(KERNEL_BUILDS_IN_PARALLEL),$(BUILD_CONFIGS))
558*e7776783SApple OSS Distributionsifeq ($(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
559*e7776783SApple OSS Distributions$(warning Generate makefile fragment: $(generated_top_level_config_all))
560*e7776783SApple OSS Distributionsendif
561*e7776783SApple OSS Distributions$(eval $(generated_top_level_config_all))
562*e7776783SApple OSS Distributions
563*e7776783SApple OSS Distributions.PHONY: all config
564*e7776783SApple OSS Distributions
565*e7776783SApple OSS Distributionsall config: config_all_bootstrap
566*e7776783SApple OSS Distributions
567*e7776783SApple OSS Distributions.PHONY: all_embedded all_release_embedded all_development_embedded all_desktop
568*e7776783SApple OSS Distributions
569*e7776783SApple OSS Distributionsall_embedded all_release_embedded all_development_embedded all_desktop: all
570*e7776783SApple OSS Distributions
571*e7776783SApple OSS Distributions#
572*e7776783SApple OSS Distributions# Install kernel files
573*e7776783SApple OSS Distributions#
574*e7776783SApple OSS Distributions
575*e7776783SApple OSS Distributionsgenerated_top_level_build_install_primary = $(call TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template,build_install_primary,,setup,config_all,1,$(PRIMARY_BUILD_CONFIGS))
576*e7776783SApple OSS Distributionsifeq ($(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
577*e7776783SApple OSS Distributions$(warning Generate makefile fragment: $(generated_top_level_build_install_primary))
578*e7776783SApple OSS Distributionsendif
579*e7776783SApple OSS Distributions$(eval $(generated_top_level_build_install_primary))
580*e7776783SApple OSS Distributions
581*e7776783SApple OSS Distributions.PHONY: install_primary
582*e7776783SApple OSS Distributions
583*e7776783SApple OSS Distributionsinstall_primary: build_install_primary_bootstrap
584*e7776783SApple OSS Distributions
585*e7776783SApple OSS Distributionsgenerated_top_level_build_install_non_primary = $(call TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template,build_install_non_primary,,setup,config_all,$(KERNEL_BUILDS_IN_PARALLEL),$(NON_PRIMARY_BUILD_CONFIGS))
586*e7776783SApple OSS Distributionsifeq ($(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
587*e7776783SApple OSS Distributions$(warning Generate makefile fragment: $(generated_top_level_build_install_non_primary))
588*e7776783SApple OSS Distributionsendif
589*e7776783SApple OSS Distributions$(eval $(generated_top_level_build_install_non_primary))
590*e7776783SApple OSS Distributions
591*e7776783SApple OSS Distributions.PHONY: install_non_primary
592*e7776783SApple OSS Distributions
593*e7776783SApple OSS Distributionsinstall_non_primary: build_install_non_primary_bootstrap
594*e7776783SApple OSS Distributions
595*e7776783SApple OSS Distributionsgenerated_top_level_config_install_primary = $(call TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template,config_install_primary,,setup,config_all,1,$(PRIMARY_BUILD_CONFIGS))
596*e7776783SApple OSS Distributionsifeq ($(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
597*e7776783SApple OSS Distributions$(warning Generate makefile fragment: $(generated_top_level_config_install_primary))
598*e7776783SApple OSS Distributionsendif
599*e7776783SApple OSS Distributions$(eval $(generated_top_level_config_install_primary))
600*e7776783SApple OSS Distributions
601*e7776783SApple OSS Distributions.PHONY: install_config_primary
602*e7776783SApple OSS Distributions
603*e7776783SApple OSS Distributionsinstall_config_primary: config_install_primary_bootstrap
604*e7776783SApple OSS Distributions
605*e7776783SApple OSS Distributions# config_install_variant iterates through products from all BUILD_CONFIGS so depends on config_all having completed overall
606*e7776783SApple OSS Distributionsgenerated_top_level_config_install_variant = $(call TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template,config_install_variant,,config_all_bootstrap,,1,$(VARIANT_CONFIGS))
607*e7776783SApple OSS Distributionsifeq ($(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
608*e7776783SApple OSS Distributions$(warning Generate makefile fragment: $(generated_top_level_config_install_variant))
609*e7776783SApple OSS Distributionsendif
610*e7776783SApple OSS Distributions$(eval $(generated_top_level_config_install_variant))
611*e7776783SApple OSS Distributions
612*e7776783SApple OSS Distributions.PHONY: install_config_variant
613*e7776783SApple OSS Distributions
614*e7776783SApple OSS Distributionsinstall_config_variant: config_install_variant_bootstrap
615*e7776783SApple OSS Distributions
616*e7776783SApple OSS Distributions# config_install iterates through products from all BUILD_CONFIGS so depends on config_all having completed overall
617*e7776783SApple OSS Distributionsgenerated_top_level_config_install = $(call TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template,config_install,,config_all_bootstrap,,1,$(FIRST_BUILD_CONFIG))
618*e7776783SApple OSS Distributionsifeq ($(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
619*e7776783SApple OSS Distributions$(warning Generate makefile fragment: $(generated_top_level_config_install))
620*e7776783SApple OSS Distributionsendif
621*e7776783SApple OSS Distributions$(eval $(generated_top_level_config_install))
622*e7776783SApple OSS Distributions
623*e7776783SApple OSS Distributions.PHONY: install_config final_touch_config_timestamps
624*e7776783SApple OSS Distributions
625*e7776783SApple OSS Distributionsinstall_config: config_install_bootstrap install_config_primary install_config_variant final_touch_config_timestamps
626*e7776783SApple OSS Distributions
627*e7776783SApple OSS Distributions
628*e7776783SApple OSS Distributions# Tell the next build the latest timestamp of any potential file in DSTROOT/SYMROOT
629*e7776783SApple OSS Distributionsfinal_touch_config_timestamps: config_install_bootstrap install_config_primary install_config_variant
630*e7776783SApple OSS Distributions	$(_v)$(TOUCH) $(OBJROOT)/.symbolset.timestamp
631*e7776783SApple OSS Distributions
632*e7776783SApple OSS Distributions#
633*e7776783SApple OSS Distributions# Aggregate install targets, which install everything appropriate for the current build alias/make target
634*e7776783SApple OSS Distributions#
635*e7776783SApple OSS Distributions
636*e7776783SApple OSS Distributions.PHONY: install
637*e7776783SApple OSS Distributions
638*e7776783SApple OSS Distributionsifneq ($(filter $(RC_ProjectName),xnu_debug),)
639*e7776783SApple OSS Distributionsinstall: install_kernels
640*e7776783SApple OSS Distributionselse ifneq ($(filter $(RC_ProjectName),xnu_kasan),)
641*e7776783SApple OSS Distributionsinstall: install_config install_kernels
642*e7776783SApple OSS Distributionselse ifneq ($(filter $(RC_ProjectName),xnu_headers_Sim),)
643*e7776783SApple OSS Distributionsinstall: installhdrs
644*e7776783SApple OSS Distributionselse ifneq ($(filter $(RC_ProjectName),xnu_headers_host),)
645*e7776783SApple OSS Distributionsinstall: installhdrs
646*e7776783SApple OSS Distributionsexport INSTALLHDRS_SKIP_HOST=YES
647*e7776783SApple OSS Distributionsexport INSTALLHDRS_MODULEMAPS_SKIP_HOST=YES
648*e7776783SApple OSS Distributionselse ifneq ($(filter $(RC_ProjectName),xnu_headers_driverkit),)
649*e7776783SApple OSS Distributionsinstall: installhdrs_desktop
650*e7776783SApple OSS Distributionselse
651*e7776783SApple OSS Distributions
652*e7776783SApple OSS Distributionsinstall: installhdrs install_textfiles install_config install_kernels install_aliases
653*e7776783SApple OSS Distributionsendif
654*e7776783SApple OSS Distributions
655*e7776783SApple OSS Distributions.PHONY: install_embedded install_release_embedded install_development_embedded install_desktop
656*e7776783SApple OSS Distributions
657*e7776783SApple OSS Distributions# By default, all kernel files, headers, text files, and pseudo-kexts are installed
658*e7776783SApple OSS Distributionsinstall_embedded install_release_embedded install_desktop: install
659*e7776783SApple OSS Distributions
660*e7776783SApple OSS Distributions# These special configs only install the kernel files
661*e7776783SApple OSS Distributionsinstall_development_embedded: install_kernels install_aliases
662*e7776783SApple OSS Distributions
663*e7776783SApple OSS Distributions.PHONY: install_kernels final_touch_kernel_timestamps install_aliases
664*e7776783SApple OSS Distributions
665*e7776783SApple OSS Distributionsinstall_kernels: build_install_primary_bootstrap build_install_non_primary_bootstrap final_touch_kernel_timestamps
666*e7776783SApple OSS Distributions
667*e7776783SApple OSS Distributions# Tell the next build the latest timestamp of any potential file in DSTROOT/SYMROOT
668*e7776783SApple OSS Distributionsfinal_touch_kernel_timestamps: build_install_primary_bootstrap build_install_non_primary_bootstrap
669*e7776783SApple OSS Distributions	$(_v)$(TOUCH) $(OBJROOT)/.mach_kernel.timestamp
670*e7776783SApple OSS Distributions	@echo "done building xnu"
671*e7776783SApple OSS Distributions
672*e7776783SApple OSS Distributions# Copy kernels that are aliases of another configuration
673*e7776783SApple OSS Distributionsgenerated_top_level_install_alias = $(call TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template,install_alias,,install_kernels,,$(KERNEL_BUILDS_IN_PARALLEL),$(ALIAS_CONFIGS))
674*e7776783SApple OSS Distributionsifeq ($(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
675*e7776783SApple OSS Distributions$(warning Generate makefile fragment: $(generated_top_level_install_alias))
676*e7776783SApple OSS Distributionsendif
677*e7776783SApple OSS Distributions$(eval $(generated_top_level_install_alias))
678*e7776783SApple OSS Distributions
679*e7776783SApple OSS Distributionsinstall_aliases: install_alias_bootstrap
680*e7776783SApple OSS Distributions
681*e7776783SApple OSS Distributions#
682*e7776783SApple OSS Distributions# Install source tree
683*e7776783SApple OSS Distributions#
684*e7776783SApple OSS Distributions.PHONY: installsrc
685*e7776783SApple OSS Distributions
686*e7776783SApple OSS Distributionsinstallsrc:
687*e7776783SApple OSS Distributions	@echo INSTALLSRC $(SRCROOT)
688*e7776783SApple OSS Distributions	$(_v)$(MKDIR) $(SRCROOT)
689*e7776783SApple OSS Distributions	$(_v)$(FIND) -x . \! \( \( -name BUILD -o -name .svn -o -name .git -o -name cscope.\* -o -name \*~ \) -prune \) -print0 | $(PAX) -rw -p a -d0 $(SRCROOT)
690*e7776783SApple OSS Distributions	$(_v)$(CHMOD) -R go+rX $(SRCROOT)
691*e7776783SApple OSS Distributions
692*e7776783SApple OSS Distributions
693*e7776783SApple OSS Distributions#
694*e7776783SApple OSS Distributions# Clean up source tree
695*e7776783SApple OSS Distributions#
696*e7776783SApple OSS Distributions.PHONY: clean
697*e7776783SApple OSS Distributions
698*e7776783SApple OSS DistributionsCLEAN_RM_DIRS= $(OBJROOT) $(SYMROOT) $(DSTROOT) \
699*e7776783SApple OSS Distributions		$(SRCROOT)/tools/test/BUILD \
700*e7776783SApple OSS Distributions		$(SRCROOT)/tools/tests/darwintests/build \
701*e7776783SApple OSS Distributions		$(SRCROOT)/tools/tests/testkext/build \
702*e7776783SApple OSS Distributions		$(SRCROOT)/libkdd/build \
703*e7776783SApple OSS Distributions		$(SRCROOT)/tools/tests/unit_tests/BUILD \
704*e7776783SApple OSS Distributions		$(SRCROOT)/tools/tests/execperf/BUILD \
705*e7776783SApple OSS Distributions		$(SRCROOT)/tools/tests/packetdrill/BUILD \
706*e7776783SApple OSS Distributions		$(SRCROOT)/tools/tests/perf_index/BUILD
707*e7776783SApple OSS Distributions
708*e7776783SApple OSS DistributionsCLEAN_ACTION_DIRS= $(SRCROOT)/tools/tests/MPMMTest \
709*e7776783SApple OSS Distributions		$(SRCROOT)/tools/tests/TLBcoherency \
710*e7776783SApple OSS Distributions		$(SRCROOT)/tools/tests/kqueue_tests \
711*e7776783SApple OSS Distributions		$(SRCROOT)/tools/tests/mktimer \
712*e7776783SApple OSS Distributions		$(SRCROOT)/tools/tests/zero-to-n \
713*e7776783SApple OSS Distributions		$(SRCROOT)/tools/tests/personas
714*e7776783SApple OSS Distributions
715*e7776783SApple OSS Distributionsclean:
716*e7776783SApple OSS Distributions	@:
717*e7776783SApple OSS Distributions	$(_v)rm -f cscope.* 2> /dev/null
718*e7776783SApple OSS Distributions	$(_v)rm -f TAGS 2> /dev/null
719*e7776783SApple OSS Distributions	$(_v)for cdir in $(CLEAN_RM_DIRS); do \
720*e7776783SApple OSS Distributions		if [ -d $${cdir} ] ; then \
721*e7776783SApple OSS Distributions			echo "Removing $${cdir}"; \
722*e7776783SApple OSS Distributions			rm -fr $${cdir} 2> /dev/null  || true ; \
723*e7776783SApple OSS Distributions		fi ; \
724*e7776783SApple OSS Distributions	done
725*e7776783SApple OSS Distributions
726*e7776783SApple OSS Distributions	$(_v)for mcdir in $(CLEAN_ACTION_DIRS); do \
727*e7776783SApple OSS Distributions		make -C $${mcdir} clean; \
728*e7776783SApple OSS Distributions	done
729*e7776783SApple OSS Distributions
730*e7776783SApple OSS Distributions
731*e7776783SApple OSS Distributions#
732*e7776783SApple OSS Distributions# Build source file list for cscope database and tags
733*e7776783SApple OSS Distributions#
734*e7776783SApple OSS Distributions.PHONY: cscope.files
735*e7776783SApple OSS Distributions
736*e7776783SApple OSS Distributionscscope.files:
737*e7776783SApple OSS Distributions	@echo "Building file list for cscope and tags"
738*e7776783SApple OSS Distributions	@find . -name '*.h' -type f | grep -v ^..BUILD > _cscope.files 2> /dev/null
739*e7776783SApple OSS Distributions	@find . -name '*.defs' -type f | grep -v ^..BUILD >> _cscope.files 2> /dev/null
740*e7776783SApple OSS Distributions	@find . -name '*.c' -type f | grep -v ^..BUILD >> _cscope.files 2> /dev/null
741*e7776783SApple OSS Distributions	@find . -name '*.cpp' -type f | grep -v ^..BUILD >> _cscope.files 2> /dev/null
742*e7776783SApple OSS Distributions	@find . -name '*.s' -type f | grep -v ^..BUILD >> _cscope.files 2> /dev/null
743*e7776783SApple OSS Distributions	@find . -name '*.h.template' -type f | grep -v ^..BUILD >> _cscope.files 2> /dev/null
744*e7776783SApple OSS Distributions	@cat $(OBJROOT)/cscope.genhdrs/* >> _cscope.files 2> /dev/null || true
745*e7776783SApple OSS Distributions	@echo -k -q -c > cscope.files 2> /dev/null
746*e7776783SApple OSS Distributions	@sort -u < _cscope.files >> cscope.files 2> /dev/null
747*e7776783SApple OSS Distributions	@rm -f _cscope.files _cscope.files2 2> /dev/null
748*e7776783SApple OSS Distributions
749*e7776783SApple OSS Distributions#
750*e7776783SApple OSS Distributions# Build cscope database
751*e7776783SApple OSS Distributions#
752*e7776783SApple OSS Distributionscscope: cscope.files
753*e7776783SApple OSS Distributions	@echo "Building cscope database"
754*e7776783SApple OSS Distributions	@cscope -bvU 2> /dev/null
755*e7776783SApple OSS Distributions
756*e7776783SApple OSS Distributions#
757*e7776783SApple OSS Distributions# Build tags
758*e7776783SApple OSS Distributions#
759*e7776783SApple OSS Distributionstags: cscope.files
760*e7776783SApple OSS Distributions	@echo "Building ctags"
761*e7776783SApple OSS Distributions	@-sed 1d cscope.files | xargs ctags -dtw 2> /dev/null || \
762*e7776783SApple OSS Distributions		echo "Phantom files detected!" 2>&1 > /dev/null
763*e7776783SApple OSS Distributions	@-[ -f TAGS ] || ${MAKE} -f $(firstword $(MAKEFILE_LIST)) TAGS
764*e7776783SApple OSS Distributions
765*e7776783SApple OSS DistributionsTAGS: cscope.files
766*e7776783SApple OSS Distributions	@echo "Building etags"
767*e7776783SApple OSS Distributions	@-cat cscope.files | etags -l auto -S - 2> /dev/null
768*e7776783SApple OSS Distributions	@rm -f cscope.files 2> /dev/null
769*e7776783SApple OSS Distributions
770*e7776783SApple OSS Distributions
771*e7776783SApple OSS Distributions.PHONY: help
772*e7776783SApple OSS Distributions
773*e7776783SApple OSS Distributionshelp:
774*e7776783SApple OSS Distributions	@cat README.md
775*e7776783SApple OSS Distributions
776*e7776783SApple OSS Distributions.PHONY: print_exports
777*e7776783SApple OSS Distributions
778*e7776783SApple OSS Distributionsprint_exports:
779*e7776783SApple OSS Distributions	$(_v)printenv | sort
780*e7776783SApple OSS Distributions
781*e7776783SApple OSS Distributionsgenerated_top_level_print_exports = $(call TOP_LEVEL_EACH_BUILD_CONFIG_BOOTSTRAP_template,print_exports,,,,1,$(FIRST_BUILD_CONFIG))
782*e7776783SApple OSS Distributionsifeq ($(VERBOSE_GENERATED_MAKE_FRAGMENTS),YES)
783*e7776783SApple OSS Distributions$(warning Generate makefile fragment: $(generated_top_level_print_exports))
784*e7776783SApple OSS Distributionsendif
785*e7776783SApple OSS Distributions$(eval $(generated_top_level_print_exports))
786*e7776783SApple OSS Distributions
787*e7776783SApple OSS Distributions.PHONY: print_exports_first_build_config
788*e7776783SApple OSS Distributions
789*e7776783SApple OSS Distributionsprint_exports_first_build_config: print_exports_bootstrap
790*e7776783SApple OSS Distributions
791*e7776783SApple OSS Distributions# vim: set ft=make:
792