1 # -*- mode: makefile;-*-
3 # Copyright (C) 1999-2016 Apple Inc. All rights reserved.
5 # MakeInc.kernel augments the single-architecture
6 # recursive build system with rules specific
7 # to assembling and linking a kernel.
11 # Validate configuration options
13 ifeq ($(filter $(CURRENT_ARCH_CONFIG),$(SUPPORTED_ARCH_CONFIGS)),)
14 $(error Unsupported CURRENT_ARCH_CONFIG $(CURRENT_ARCH_CONFIG))
17 ifeq ($(filter $(CURRENT_KERNEL_CONFIG),$(SUPPORTED_KERNEL_CONFIGS)),)
18 $(error Unsupported CURRENT_KERNEL_CONFIG $(CURRENT_KERNEL_CONFIG))
21 ifeq ($(filter $(CURRENT_MACHINE_CONFIG),$(SUPPORTED_$(CURRENT_ARCH_CONFIG)_MACHINE_CONFIGS)),)
22 $(error Unsupported CURRENT_MACHINE_CONFIG $(CURRENT_MACHINE_CONFIG))
25 ifeq ($(filter $(PLATFORM),$(SUPPORTED_PLATFORMS)),)
26 $(error Unsupported PLATFORM $(PLATFORM))
29 ifeq ($(BUILD_JSON_COMPILATION_DATABASE),1)
31 $(_v)$(CAT) > $(OBJPATH)/compile_commands.json < /dev/null
34 ifeq ($(BUILD_STATIC_LINK),1)
36 # <rdar://problem/46252406>
37 # To run LTO in the xnu project while linking the final result in KCB, without losing debugging info,
38 # run ld -r on only the LTO bitcode object files to produce one mach-o for KCB to use, which is added
39 # to the static link archive, along with the non-LTO objects (not linked, since ld -r on mach-o objects
40 # does not preserve DWARF.)
46 # Rules for the highly parallel "build" phase, where each build configuration
47 # writes into their own $(TARGET) independent of other build configs
49 # There are 4 primary build outputs:
50 # 1) $(KERNEL_FILE_NAME).unstripped (raw linked kernel, unstripped)
51 # 2) $(KERNEL_FILE_NAME) (stripped kernel, with optional CTF data)
52 # 3) $(KERNEL_FILE_NAME).dSYM (dSYM)
53 # 4) $(KERNEL_FILE_NAME).link (bits for static linking)
55 ifeq ($(BUILD_STATIC_LINK),1)
57 KERNEL_STATIC_LINK_TARGETS = \
58 $(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).a
60 KERNEL_STATIC_LINK_DST = \
61 $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).a \
62 $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).linkarguments \
63 $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).linkarchives \
64 $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).exp \
65 $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).alias.exp \
66 $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros \
67 $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_LLDBBOOTSTRAP_NAME)
71 do_build_all:: do_build_kernel
73 .PHONY: do_build_kernel
75 do_build_kernel: $(TARGET)/$(KERNEL_FILE_NAME) $(TARGET)/$(KERNEL_FILE_NAME).unstripped $(KERNEL_STATIC_LINK_TARGETS)
78 ifeq ($(BUILD_DSYM),1)
79 do_build_all:: do_build_kernel_dSYM
82 .PHONY: do_build_kernel_dSYM
84 do_build_kernel_dSYM: $(TARGET)/$(KERNEL_FILE_NAME).dSYM
88 $(_v)$(REPLACECONTENTS) $@ $(LD) $(LDFLAGS_KERNEL) $(LDFLAGS_KERNEL_ONLY) $(LD_KERNEL_LIBS)
90 $(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS)
92 $(TARGET)/$(KERNEL_FILE_NAME): $(TARGET)/$(KERNEL_FILE_NAME).unstripped $(TARGET)/$(KERNEL_FILE_NAME).dSYM
94 $(_v)$(STRIP) $(STRIP_FLAGS) $< -o $@
95 @echo "built kernel at $@"
97 ifeq ($(DO_CTFMERGE),1)
98 @$(LOG_CTFCONVERT) "$(@F)"
99 $(_v)$(CTFCONVERT) -c -l xnu -u xnu -o $@.ctf $(TARGET)/$(KERNEL_FILE_NAME).dSYM/Contents/Resources/DWARF/$(KERNEL_FILE_NAME)
100 @$(LOG_CTFMERGE) "$(@F)"
101 $(_v)$(CTFMERGE) -l xnu -o $@ -Z $@.ctfdata $@.ctf
102 $(_v)if [ -s $@.ctfdata ]; then \
103 $(LOG_CTFINSERT) "$(@F)"; \
104 $(CTFINSERT) $@ $(ARCH_FLAGS_$(CURRENT_ARCH_CONFIG)) \
108 $(_v)$(LN) $(call function_convert_build_config_to_objdir,$(CURRENT_BUILD_CONFIG))/$(KERNEL_FILE_NAME) $(OBJROOT)/$(KERNEL_FILE_NAME)
110 $(TARGET)/$(KERNEL_FILE_NAME).dSYM: $(TARGET)/$(KERNEL_FILE_NAME).unstripped
111 @$(LOG_DSYMUTIL) "$(@F)"
112 $(_v)bash -c "$(DSYMUTIL) $(DSYMUTIL_FLAGS) $< -o $@ $(_vstdout) 2> >(grep -v '^warning:.*could not find object file symbol for symbol' 1>&2)"
113 $(_v)$(MV) $@/$(DSYMDWARFDIR)/$(KERNEL_FILE_NAME).unstripped $@/$(DSYMDWARFDIR)/$(KERNEL_FILE_NAME)
116 $(TARGET)/$(KERNEL_FILE_NAME).unstripped: $(addprefix $(TARGET)/,$(foreach component,$(COMPONENT_LIST),$(component)/$(CURRENT_KERNEL_CONFIG)/$(component).filelist)) lastkerneldataconst.o lastkernelconstructor.o nonlto.o $(SRCROOT)/config/version.c $(SRCROOT)/config/MasterVersion .LDFLAGS $(filter %/MakeInc.kernel,$(MAKEFILE_LIST))
117 $(_v)${MAKE} -f $(firstword $(MAKEFILE_LIST)) version.o
120 $(_v)rm -f ltolink.filelist
121 $(_v)rm -f nonltolink.filelist
122 $(_v)files="$$($(CAT) $(filter %.filelist,$+)) version.o $(filter %.o,$+)"; \
123 for ofile in $$files; \
125 hdr=$$(od -An -N 4 -t x4 $$ofile); \
126 if [ $$hdr == "0b17c0de" ]; \
128 lto="$$lto$$ofile"$$'\n'; \
130 nonlto="$$nonlto$$ofile"$$'\n'; \
133 printf "$$lto" >ltolink.filelist; \
134 printf "$$nonlto" >nonltolink.filelist
136 $(_v)if [ -s ltolink.filelist ]; \
138 $(LD) $($(addsuffix $(CURRENT_ARCH_CONFIG),ARCH_FLAGS_)) -r nonlto.o -filelist ltolink.filelist $(LDFLAGS_KERNEL_LTO) -Wl,-object_path_lto,$(TARGET)/justlto.o -o $(TARGET)/justlto.tmp.o && \
139 $(LD) $(LDFLAGS_KERNEL) $(LDFLAGS_KERNEL_ONLY) -filelist nonltolink.filelist $(TARGET)/justlto.o $(LDFLAGS_KERNEL_STRIP_LTO) -o $@ $(LD_KERNEL_LIBS) $(LD_KERNEL_ARCHIVES); \
141 $(LD) $(LDFLAGS_KERNEL) $(LDFLAGS_KERNEL_ONLY) -filelist nonltolink.filelist -o $@ $(LD_KERNEL_LIBS) $(LD_KERNEL_ARCHIVES); \
145 $(_v)$(CAT) $(filter %.filelist,$+) < /dev/null > link.filelist
146 $(_v)$(LD) $(LDFLAGS_KERNEL) $(LDFLAGS_KERNEL_ONLY) -filelist link.filelist version.o $(filter %.o,$+) -o $@ $(LD_KERNEL_LIBS) $(LD_KERNEL_ARCHIVES)
149 # for now, rename LASTDATA_CONST to LAST on static kernel cache builds
150 EXTRA_KC_LINKARGS = -Wl,-rename_segment,__LASTDATA_CONST,__LAST
152 $(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).a: $(TARGET)/$(KERNEL_FILE_NAME).unstripped .LDFLAGS $(filter %/MakeInc.kernel,$(MAKEFILE_LIST))
153 @$(LOG_LIBTOOL) "$(@F)"
154 $(_v)$(MKDIR) $(dir $@)
156 $(_v)$(LIBTOOL) -ca $(TARGET)/justlto.o -filelist nonltolink.filelist -o $@
158 $(_v)$(LIBTOOL) -ca -filelist link.filelist version.o lastkerneldataconst.o lastkernelconstructor.o -o $@
160 $(_v)cp $(TARGET)/all-kpi.exp $(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).exp
161 $(_v)cp $(TARGET)/all-alias.exp $(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).alias.exp
162 $(_v)echo "$(LD_KERNEL_ARCHIVES)" >$(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).linkarchives
163 $(_v)echo "$(LDFLAGS_KERNEL) $(LD_KERNEL_LIBS) $(EXTRA_KC_LINKARGS)" >$(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).linkarguments
164 $(_v)$(LN) $(call function_convert_build_config_to_objdir,$(CURRENT_BUILD_CONFIG))/$(KERNEL_FILE_NAME).link $(OBJROOT)/$(KERNEL_FILE_NAME).link
166 nonlto.o: .CFLAGS $(filter %/MakeInc.kernel,$(MAKEFILE_LIST))
167 nonlto.o: $(SRCROOT)/libsa/nonlto.c
169 ${C_RULE_1A}$< $(CFLAGS_NOLTO_FLAG)
173 version.o: .CFLAGS $(filter %/MakeInc.kernel,$(MAKEFILE_LIST))
174 version.o: $(OBJPATH)/version.c
180 # Always recreate version.sh
181 $(OBJPATH)/version.c: $(SRCROOT)/config/version.c $(NEWVERS) $(SRCROOT)/config/MasterVersion ALWAYS
183 $(_v)$(NEWVERS) $(OBJPATH)/version.c > /dev/null;
186 -include lastkerneldataconst.d
187 lastkerneldataconst.o: .CFLAGS $(filter %/MakeInc.kernel,$(MAKEFILE_LIST))
188 lastkerneldataconst.o: $(SRCROOT)/libsa/lastkerneldataconst.c
194 lastkernelconstructor.o_CFLAGS_RM = -fprofile-instr-generate
195 # the LAST segment is mapped read-only on arm, so if we include llvm profiling
196 # here it will segfault the kernel. (see arm_vm_init.c) We don't currently have
197 # a way of retrieving these counters from LAST anyway, so there's no harm in just
200 LAST_FILES=lastkernelconstructor.o
201 -include lastkernelconstructor.d
202 lastkernelconstructor.o: .CFLAGS $(filter %/MakeInc.kernel,$(MAKEFILE_LIST))
203 lastkernelconstructor.o: $(SRCROOT)/libsa/lastkernelconstructor.c
205 ${C_RULE_1A}$< $(CFLAGS_NOLTO_FLAG)
209 $(_v)for last_file in ${LAST_FILES}; \
211 $(SEG_HACK) -s __DATA -n __LASTDATA_CONST -o $${last_file}__ $${last_file} || exit 1; \
212 mv $${last_file}__ $${last_file} || exit 1; \
214 EXTRA_KC_LINKARGS = -Wl,-rename_segment,__LASTDATA_CONST,__LAST
217 # Install rules. Each build config is classified as "primary" (the first
218 # config for an architecture) or "non-primary". Primary build configs
219 # have the semantic of competing to *combine* single-architecture
220 # files into a multi-architecture output in the DSTROOT, like
221 # $(DSTROOT)/$(KERNEL_FILE_NAME), and consequently each primary build config
222 # has its install target run serially with respect to other primary
223 # build configs. Non-primary build configs will never compete for
224 # files in the DSTROOT or SYMROOT, and can be installed in parallel
225 # with other non-primary configs (and even primary configs)
228 do_build_install_primary:: do_install_machine_specific_kernel
229 ifeq ($(BUILD_DSYM),1)
230 do_build_install_primary:: do_install_machine_specific_kernel_dSYM
233 do_build_install_non_primary:: do_install_machine_specific_kernel
234 ifeq ($(BUILD_DSYM),1)
235 do_build_install_non_primary:: do_install_machine_specific_kernel_dSYM
238 ifeq ($(BUILD_DSYM),1)
239 ifeq ($(INSTALL_KERNEL_SYM_TO_KDK),1)
240 do_build_install_primary:: do_install_machine_specific_KDK_dSYM
241 do_build_install_non_primary:: do_install_machine_specific_KDK_dSYM
245 ifeq ($(INSTALL_XNU_DEBUG_FILES),1)
246 do_build_install_primary:: do_install_xnu_debug_files
249 .PHONY: do_install_xnu_debug_files
251 do_install_xnu_debug_files: $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/README.DEBUG-kernel.txt
255 # If the timestamp indicates the DSTROOT kernel is out of
256 # date, start over. Normal dependencies don't work because we can have
257 # ( BUILDA, BUILDB, INSTALLB, INSTALLA ) in which case at INSTALLA time
258 # the timestamps would $(DSTROOT)/$(KERNEL_FILE_NAME) is not out of date compared
259 # to BUILDA. So we maintain a separate file at the time make(1)
260 # was run and use it to determine what actions to take
263 $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME): $(TARGET)/$(KERNEL_FILE_NAME) ALWAYS
264 $(_v)$(MKDIR) $(dir $@)
265 @$(LOG_INSTALL) "$(@F)$(Color0) ($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))"
266 $(_v)if [ $(OBJROOT)/.mach_kernel.timestamp -nt $@ ]; then \
267 $(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@; \
270 $(LIPO) -create $@ $< -output $@; \
275 ifeq ($(BUILD_STATIC_LINK),1)
277 $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).a: $(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).a ALWAYS
278 $(_v)$(MKDIR) $(dir $@)
279 @$(LOG_INSTALL) "$(@F)"
280 $(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
282 $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).linkarguments: $(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).linkarguments ALWAYS
283 $(_v)$(MKDIR) $(dir $@)
284 @$(LOG_INSTALL) "$(@F)"
285 $(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
287 $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).linkarchives: $(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).linkarchives ALWAYS
288 $(_v)$(MKDIR) $(dir $@)
289 @$(LOG_INSTALL) "$(@F)"
290 $(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
292 $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).exp: $(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).exp ALWAYS
293 $(_v)$(MKDIR) $(dir $@)
294 @$(LOG_INSTALL) "$(@F)"
295 $(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
297 $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).alias.exp: $(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).alias.exp ALWAYS
298 $(_v)$(MKDIR) $(dir $@)
299 @$(LOG_INSTALL) "$(@F)"
300 $(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
305 $(SYMROOT)/$(KERNEL_FILE_NAME): $(TARGET)/$(KERNEL_FILE_NAME).unstripped ALWAYS
306 $(_v)$(MKDIR) $(dir $@)
307 @$(LOG_INSTALLSYM) "$(@F)$(Color0) ($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))"
308 $(_v)if [ $(OBJROOT)/.mach_kernel.timestamp -nt $@ ]; then \
309 $(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@; \
312 $(LIPO) -create $@ $< -output $@; \
318 $(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros \
319 $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros \
320 $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros: \
321 $(TARGET)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros
322 $(_v)$(MKDIR) $(dir $@)
323 @$(LOG_INSTALLMACROS) "$(@F)$(Color0) $(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))"
324 $(_v)$(CP) -r $< $(dir $@)
327 $(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_LLDBBOOTSTRAP_NAME) \
328 $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_LLDBBOOTSTRAP_NAME) \
329 $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_LLDBBOOTSTRAP_NAME): \
330 $(TARGET)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_LLDBBOOTSTRAP_NAME)
331 $(_v)$(MKDIR) $(dir $@)
332 @$(LOG_INSTALLMACROS) "$(@F)$(Color0) ($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))"
333 $(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
335 $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/README.DEBUG-kernel.txt: $(SRCROOT)/config/README.DEBUG-kernel.txt
336 $(_v)$(MKDIR) $(dir $@)
337 @$(LOG_INSTALL) "$(@F)"
338 $(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
340 $(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMINFODIR)/Info.plist $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMINFODIR)/Info.plist: $(TARGET)/$(KERNEL_FILE_NAME).dSYM/$(DSYMINFODIR)/Info.plist
341 $(_v)$(MKDIR) $(dir $@)
342 @$(LOG_INSTALLSYM) "$(ColorL)dSYM$(Color0) $(ColorF)$(@F)$(Color0) ($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))"
343 $(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
345 $(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMDWARFDIR)/$(KERNEL_FILE_NAME) $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMDWARFDIR)/$(KERNEL_FILE_NAME): $(TARGET)/$(KERNEL_FILE_NAME).dSYM/$(DSYMDWARFDIR)/$(KERNEL_FILE_NAME) ALWAYS
346 $(_v)$(MKDIR) $(dir $@)
347 @$(LOG_INSTALLSYM) "$(ColorL)dSYM$(Color0) $(ColorF)$(@F).dSYM$(ColorF) ($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))"
348 $(_v)if [ $(OBJROOT)/.mach_kernel.timestamp -nt $@ ]; then \
349 $(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@; \
352 $(LIPO) -create $@ $< -output $@; \
357 .PHONY: do_install_machine_specific_kernel do_install_machine_specific_kernel_dSYM
359 do_install_machine_specific_kernel: $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME) \
360 $(SYMROOT)/$(KERNEL_FILE_NAME) \
361 $(KERNEL_STATIC_LINK_DST)
364 do_install_machine_specific_kernel_dSYM: \
365 $(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMINFODIR)/Info.plist \
366 $(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros \
367 $(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_LLDBBOOTSTRAP_NAME) \
368 $(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMDWARFDIR)/$(KERNEL_FILE_NAME)
371 .PHONY: do_install_machine_specific_KDK_dSYM
373 do_install_machine_specific_KDK_dSYM: \
374 $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMINFODIR)/Info.plist \
375 $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros \
376 $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_LLDBBOOTSTRAP_NAME) \
377 $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMDWARFDIR)/$(KERNEL_FILE_NAME)
380 # The $(RM) is needed so that the $(LN) doesn't dereference an existing
381 # symlink during incremental builds and create a new symlink inside
382 # the target of the existing symlink
383 do_installhdrs_mi:: $(DSTROOT)/$(KRESDIR)/Info.plist
384 ifneq ($(INSTALLHDRS_SKIP_HOST),YES)
385 $(_v)$(MKDIR) $(DSTROOT)/$(KINCFRAME)
386 $(_v)$(MKDIR) $(DSTROOT)/$(KPINCDIR)
387 $(_v)$(MKDIR) $(DSTROOT)/$(KRESDIR)
388 $(_v)$(RM) $(DSTROOT)/$(KINCFRAME)/Versions/Current
389 $(_v)$(LN) $(KINCVERS) $(DSTROOT)/$(KINCFRAME)/Versions/Current
390 $(_v)$(RM) $(DSTROOT)/$(KINCFRAME)/Headers
391 $(_v)$(LN) Versions/Current/Headers \
392 $(DSTROOT)/$(KINCFRAME)/Headers
393 $(_v)$(RM) $(DSTROOT)/$(KINCFRAME)/PrivateHeaders
394 $(_v)$(LN) Versions/Current/PrivateHeaders \
395 $(DSTROOT)/$(KINCFRAME)/PrivateHeaders
396 $(_v)$(RM) $(DSTROOT)/$(KINCFRAME)/Resources
397 $(_v)$(LN) Versions/Current/Resources \
398 $(DSTROOT)/$(KINCFRAME)/Resources
401 $(DSTROOT)/$(KRESDIR)/Info.plist: $(SOURCE)/EXTERNAL_HEADERS/Info.plist
402 ifneq ($(INSTALLHDRS_SKIP_HOST),YES)
403 $(_v)$(MKDIR) $(DSTROOT)/$(KRESDIR)
404 $(_v)$(INSTALL) $(DATA_INSTALL_FLAGS) $< $@
405 $(_v)$(NEWVERS) $@ $(_vstdout)
406 ifeq ($(USE_BINARY_PLIST),1)
407 $(_v)$(PLUTIL) -convert binary1 -o $@ $@
411 $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(ALIAS_FILE_NAME): ALWAYS
412 @$(LOG_ALIAS) "$(@F)$(Color0) ($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0) $(ColorLF)$(CURRENT_MACHINE_CONFIG_LC)$(Color0) $(ColorLF)$(CURRENT_ALIAS_MACHINE_CONFIG_LC)$(Color0))"
413 $(_v)$(INSTALL) $(EXEC_INSTALL_FLAGS) $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME) $@
415 install_alias: $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(ALIAS_FILE_NAME)