]> git.saurik.com Git - apple/xnu.git/blame - makedefs/MakeInc.kernel
xnu-2422.1.72.tar.gz
[apple/xnu.git] / makedefs / MakeInc.kernel
CommitLineData
39236c6e
A
1# -*- mode: makefile;-*-
2#
3# Copyright (C) 1999-2012 Apple Inc. All rights reserved.
4#
5# MakeInc.kernel augments the single-architecture
6# recursive build system with rules specific
7# to assembling and linking a kernel.
8#
9
10#
11# Validate configuration options
12#
13ifeq ($(filter $(CURRENT_ARCH_CONFIG),$(SUPPORTED_ARCH_CONFIGS)),)
14$(error Unsupported CURRENT_ARCH_CONFIG $(CURRENT_ARCH_CONFIG))
15endif
16
17ifeq ($(filter $(CURRENT_KERNEL_CONFIG),$(SUPPORTED_KERNEL_CONFIGS)),)
18$(error Unsupported CURRENT_KERNEL_CONFIG $(CURRENT_KERNEL_CONFIG))
19endif
20
21ifeq ($(filter $(CURRENT_MACHINE_CONFIG),$(SUPPORTED_$(CURRENT_ARCH_CONFIG)_MACHINE_CONFIGS)),)
22$(error Unsupported CURRENT_MACHINE_CONFIG $(CURRENT_MACHINE_CONFIG))
23endif
24
25ifeq ($(filter $(PLATFORM),$(SUPPORTED_PLATFORMS)),)
26$(error Unsupported PLATFORM $(PLATFORM))
27endif
28
29STATIC_KMODS = $(SRCROOT)/kmods.a
30
31#
32# File names in DSTROOT
33#
34
35KERNEL_FILE_NAME_SUFFIX =
36
37KERNEL_FILE_NAME = mach_kernel$(KERNEL_FILE_NAME_SUFFIX)
38
39ifeq ($(CURRENT_MACHINE_CONFIG),NONE)
40ALT_KERNEL_FILE_NAME = mach$(KERNEL_FILE_NAME_SUFFIX).$(CURRENT_KERNEL_CONFIG_LC)
41ALT_KERNEL_LLDBBOOTSTRAP_NAME = mach$(KERNEL_FILE_NAME_SUFFIX).py
42else
43ALT_KERNEL_FILE_NAME = mach$(KERNEL_FILE_NAME_SUFFIX).$(CURRENT_KERNEL_CONFIG_LC).$(CURRENT_MACHINE_CONFIG_LC)
44ALT_KERNEL_LLDBBOOTSTRAP_NAME = mach$(KERNEL_FILE_NAME_SUFFIX)_$(CURRENT_KERNEL_CONFIG_LC).py
45endif
46
47#
48# Rules for the highly parallel "build" phase, where each build configuration
49# writes into their own $(TARGET) independent of other build configs
50#
51
52do_build_all:: do_build_mach_kernel
53
54.PHONY: do_build_mach_kernel
55
56do_build_mach_kernel: $(TARGET)/mach_kernel $(TARGET)/mach_kernel.sys
57 $(_v)if [ $(CURRENT_MACHINE_CONFIG) != NONE ] ; then \
58 $(LN) $(call function_convert_build_config_to_objdir,$(CURRENT_BUILD_CONFIG))/mach_kernel $(OBJROOT)/mach.$(CURRENT_KERNEL_CONFIG_LC).$(CURRENT_MACHINE_CONFIG_LC); \
59 fi;
60
61ifeq ($(BUILD_DSYM),1)
62do_build_all:: do_build_mach_kernel_dSYM
63endif
64
65.PHONY: do_build_mach_kernel_dSYM
66
67do_build_mach_kernel_dSYM: $(TARGET)/mach_kernel.sys.dSYM
68 @:
69
70$(TARGET)/mach_kernel: $(TARGET)/mach_kernel.sys
71 @echo STRIP mach_kernel
72 $(_v)$(STRIP) $(STRIP_FLAGS) $< -o $@
73 $(_v)$(RM) $@.ctfdata
74ifeq ($(DO_CTFMERGE),1)
75 @echo CTFMERGE mach_kernel
76 $(_v)$(FIND) $(TARGET)/ -name \*.ctf -size +0 | \
77 $(XARGS) $(CTFMERGE) -l xnu -o $@ -Z $@.ctfdata || true
78endif
79 $(_v)if [ -s $@.ctfdata ]; then \
80 echo CTFINSERT mach_kernel; \
81 $(CTFINSERT) $@ $(ARCH_FLAGS_$(CURRENT_ARCH_CONFIG)) \
82 $@.ctfdata -o $@; \
83 fi;
84
85$(TARGET)/mach_kernel.sys.dSYM: $(TARGET)/mach_kernel.sys
86 $(_v)echo DSYMUTIL mach_kernel.sys
87 $(_v)$(DSYMUTIL) $(DSYMUTIL_FLAGS) $< -o $@
88 $(_v)$(TOUCH) $@
89
90$(TARGET)/mach_kernel.sys: $(addprefix $(TARGET)/,$(foreach component,$(COMPONENT_LIST),$(component)/$(CURRENT_KERNEL_CONFIG)/$(component).filelist)) lastkernelconstructor.o $(SRCROOT)/config/version.c $(SRCROOT)/config/MasterVersion
91 $(_v)${MAKE} -f $(firstword $(MAKEFILE_LIST)) version.o
92 @echo LD mach_kernel.sys
93 $(_v)$(CAT) $(filter %.filelist,$+) < /dev/null > link.filelist
94 $(_v)$(LD) $(LDFLAGS_KERNEL) -filelist link.filelist version.o $(filter %.o,$+) `if [ -e $(STATIC_KMODS) ]; then echo $(STATIC_KMODS); fi` \
95 -o $@ $(LD_KERNEL_LIBS)
96
97version.o: $(OBJPATH)/version.c
98 ${C_RULE_1A}$<
99 ${C_RULE_2}
100 ${C_RULE_4}
101
102# Always recreate version.sh
103$(OBJPATH)/version.c: $(SRCROOT)/config/version.c $(NEWVERS) $(SRCROOT)/config/MasterVersion ALWAYS
104 $(_v)$(CP) $< $@
105 $(_v)$(NEWVERS) $(OBJPATH)/version.c > /dev/null;
106
107lastkernelconstructor.o: $(SRCROOT)/libsa/lastkernelconstructor.c
108 ${C_RULE_1A}$< $(CFLAGS_NOLTO_FLAG)
109 ${C_RULE_2}
110 ${C_RULE_3}
111 ${C_RULE_4}
112 $(_v)$(SEG_HACK) -s __DATA -n __LAST -o $@__ $@
113 $(_v)$(MV) $@__ $@
114
115# invalidate current kernel in $(SYMROOT)
116do_build_setup::
117 $(_v)$(TOUCH) $(OBJROOT)/.mach_kernel.timestamp
118 $(_v)$(TOUCH) $(OBJROOT)/.symbolset.timestamp
119
120#
121# Install rules. Each build config is classified as "primary" (the first
122# config for an architecture) or "non-primary". Primary build configs
123# have the semantic of competing to *combine* single-architecture
124# files into a multi-architecture output in the DSTROOT, like
125# $(DSTROOT)/mach_kernel, and consequently each primary build config
126# has its install target run serially with respect to other primary
127# build configs. Non-primary build configs will never compete for
128# files in the DSTROOT or SYMROOT, and can be installed in parallel
129# with other non-primary configs (and even primary configs)
130#
131
132do_build_install_primary:: do_install_kernel_framework
133
134ifeq ($(INSTALL_PRIMARY_KERNEL_LIKE_NON_PRIMARY),1)
135do_build_install_primary:: do_install_machine_specific_kernel
136ifeq ($(BUILD_DSYM),1)
137do_build_install_primary:: do_install_machine_specific_kernel_dSYM
138endif
139else
140do_build_install_primary:: do_install_mach_kernel
141ifeq ($(BUILD_DSYM),1)
142do_build_install_primary:: do_install_mach_kernel_dSYM
143endif
144endif
145
146do_build_install_non_primary:: do_install_machine_specific_kernel
147ifeq ($(BUILD_DSYM),1)
148do_build_install_non_primary:: do_install_machine_specific_kernel_dSYM
149endif
150
151ifeq ($(BUILD_DSYM),1)
152ifeq ($(INSTALL_KERNEL_SYM_TO_KDK),1)
153do_build_install_primary:: do_install_machine_specific_KDK_dSYM
154do_build_install_non_primary:: do_install_machine_specific_KDK_dSYM
155endif
156endif
157
158ifeq ($(INSTALL_XNU_DEBUG_FILES),1)
159do_build_install_primary:: do_install_xnu_debug_files
160ifeq ($(BUILD_DSYM),1)
161do_build_install_primary:: do_install_xnu_debug_mach_kernel_dSYM
162endif
163endif
164
165.PHONY: do_install_mach_kernel do_install_mach_kernel_dSYM do_install_xnu_debug_files do_install_xnu_debug_mach_kernel_dSYM
166
167do_install_mach_kernel: $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME) \
168 $(SYMROOT)/$(KERNEL_FILE_NAME)
169
170do_install_mach_kernel_dSYM: \
171 $(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMINFODIR)/Info.plist \
172 $(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros \
173 $(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_FILE_NAME).py \
174 $(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMDWARFDIR)/$(KERNEL_FILE_NAME)
175 @:
176
177do_install_xnu_debug_files: $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/README.DEBUG-kernel.txt
178 @:
179
180do_install_xnu_debug_mach_kernel_dSYM: \
181 $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMINFODIR)/Info.plist \
182 $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros \
183 $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_FILE_NAME).py \
184 $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMDWARFDIR)/$(KERNEL_FILE_NAME)
185 @:
186
187#
188# If the timestamp indicates the DSTROOT kernel is out of
189# date, start over. Normal dependencies don't work because we can have
190# ( BUILDA, BUILDB, INSTALLB, INSTALLA ) in which case at INSTALLA time
191# the timestamps would $(DSTROOT)/mach_kernel is not out of date compared
192# to BUILDA. So we maintain a separate file at the time make(1)
193# was run and use it to determine what actions to take
194#
195
196$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME): $(TARGET)/mach_kernel ALWAYS
197 $(_v)$(MKDIR) $(dir $@)
198 $(_v)if [ $(OBJROOT)/.mach_kernel.timestamp -nt $@ ]; then \
199 echo INSTALL $(notdir $@) "($(CURRENT_ARCH_CONFIG_LC))"; \
200 $(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@; \
201 cmdstatus=$$?; \
202 else \
203 echo INSTALL $(notdir $@) "($(CURRENT_ARCH_CONFIG_LC))"; \
204 $(LIPO) -create $@ $< -output $@; \
205 cmdstatus=$$?; \
206 fi; \
207 exit $$cmdstatus
208
209$(SYMROOT)/$(KERNEL_FILE_NAME): $(TARGET)/mach_kernel.sys ALWAYS
210 $(_v)$(MKDIR) $(dir $@)
211 $(_v)if [ $(OBJROOT)/.mach_kernel.timestamp -nt $@ ]; then \
212 echo INSTALLSYM $(notdir $@) "($(CURRENT_ARCH_CONFIG_LC))"; \
213 $(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@; \
214 cmdstatus=$$?; \
215 else \
216 echo INSTALLSYM $(notdir $@) "($(CURRENT_ARCH_CONFIG_LC))"; \
217 $(LIPO) -create $@ $< -output $@; \
218 cmdstatus=$$?; \
219 fi; \
220 exit $$cmdstatus
221
222$(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros: $(TARGET)/$(DSYMKERNELSYSDIR)/$(DSYMLLDBMACROSDIR)/lldbmacros
223 $(_v)$(MKDIR) $(dir $@)
224 @echo INSTALLMACROS $(notdir $@) "($(CURRENT_ARCH_CONFIG_LC))"
225 $(_v)$(CP) -r $< $(dir $@)
226 $(_v)$(TOUCH) $@
227
228$(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_FILE_NAME).py $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_FILE_NAME).py: $(TARGET)/$(DSYMKERNELSYSDIR)/$(DSYMLLDBMACROSDIR)/lldbmacros/core/xnu_lldb_init.py
229 $(_v)$(MKDIR) $(dir $@)
230 @echo INSTALLMACROS $(notdir $@) "($(CURRENT_ARCH_CONFIG_LC))"
231 $(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
232
233$(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/README.DEBUG-kernel.txt: $(SRCROOT)/config/README.DEBUG-kernel.txt
234 $(_v)$(MKDIR) $(dir $@)
235 @echo INSTALL $(notdir $@)
236 $(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
237
238$(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMINFODIR)/Info.plist $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMINFODIR)/Info.plist: $(TARGET)/$(DSYMKERNELSYSDIR)/$(DSYMINFODIR)/Info.plist
239 $(_v)$(MKDIR) $(dir $@)
240 @echo INSTALLSYM dSYM $(notdir $@) "($(CURRENT_ARCH_CONFIG_LC))"
241 $(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
242
243$(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMDWARFDIR)/$(KERNEL_FILE_NAME) $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMDWARFDIR)/$(KERNEL_FILE_NAME): $(TARGET)/$(DSYMKERNELSYSDIR)/$(DSYMDWARFDIR)/mach_kernel.sys ALWAYS
244 $(_v)$(MKDIR) $(dir $@)
245 $(_v)if [ $(OBJROOT)/.mach_kernel.timestamp -nt $@ ]; then \
246 echo INSTALLSYM dSYM $(notdir $@).dSYM "($(CURRENT_ARCH_CONFIG_LC))"; \
247 $(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@; \
248 cmdstatus=$$?; \
249 else \
250 echo INSTALLSYM dSYM $(notdir $@).dSYM "($(CURRENT_ARCH_CONFIG_LC))"; \
251 $(LIPO) -create $@ $< -output $@; \
252 cmdstatus=$$?; \
253 fi; \
254 exit $$cmdstatus
255
256.PHONY: do_install_machine_specific_kernel do_install_machine_specific_kernel_dSYM
257
258do_install_machine_specific_kernel: $(DSTROOT)/$(ALT_KERNEL_FILE_NAME) \
259 $(SYMROOT)/$(ALT_KERNEL_FILE_NAME)
260 @:
261
262do_install_machine_specific_kernel_dSYM: \
263 $(SYMROOT)/$(ALT_KERNEL_FILE_NAME).dSYM/$(DSYMINFODIR)/Info.plist \
264 $(SYMROOT)/$(ALT_KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros \
265 $(SYMROOT)/$(ALT_KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(ALT_KERNEL_LLDBBOOTSTRAP_NAME) \
266 $(SYMROOT)/$(ALT_KERNEL_FILE_NAME).dSYM/$(DSYMDWARFDIR)/$(ALT_KERNEL_FILE_NAME)
267 @:
268
269.PHONY: do_install_machine_specific_KDK_dSYM
270
271do_install_machine_specific_KDK_dSYM: \
272 $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(ALT_KERNEL_FILE_NAME) \
273 $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(ALT_KERNEL_FILE_NAME).dSYM/$(DSYMINFODIR)/Info.plist \
274 $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(ALT_KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros \
275 $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(ALT_KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(ALT_KERNEL_LLDBBOOTSTRAP_NAME) \
276 $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(ALT_KERNEL_FILE_NAME).dSYM/$(DSYMDWARFDIR)/$(ALT_KERNEL_FILE_NAME)
277 @:
278
279$(DSTROOT)/$(ALT_KERNEL_FILE_NAME): $(TARGET)/mach_kernel ALWAYS
280 $(_v)$(MKDIR) $(dir $@)
281 $(_v)if [ $(OBJROOT)/.mach_kernel.timestamp -nt $@ ]; then \
282 echo INSTALL $(notdir $@) "($(CURRENT_ARCH_CONFIG_LC) $(CURRENT_MACHINE_CONFIG_LC))"; \
283 $(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@; \
284 cmdstatus=$$?; \
285 else \
286 echo INSTALL $(notdir $@) "($(CURRENT_ARCH_CONFIG_LC) $(CURRENT_MACHINE_CONFIG_LC))"; \
287 $(LIPO) -create $@ $< -output $@; \
288 cmdstatus=$$?; \
289 fi; \
290 exit $$cmdstatus
291
292$(SYMROOT)/$(ALT_KERNEL_FILE_NAME) $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(ALT_KERNEL_FILE_NAME): $(TARGET)/mach_kernel.sys ALWAYS
293 $(_v)$(MKDIR) $(dir $@)
294 $(_v)if [ $(OBJROOT)/.mach_kernel.timestamp -nt $@ ]; then \
295 echo INSTALLSYM $(notdir $@) "($(CURRENT_ARCH_CONFIG_LC) $(CURRENT_MACHINE_CONFIG_LC))"; \
296 $(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@; \
297 cmdstatus=$$?; \
298 else \
299 echo INSTALLSYM $(notdir $@) "($(CURRENT_ARCH_CONFIG_LC) $(CURRENT_MACHINE_CONFIG_LC))"; \
300 $(LIPO) -create $@ $< -output $@; \
301 cmdstatus=$$?; \
302 fi; \
303 exit $$cmdstatus
304
305$(SYMROOT)/$(ALT_KERNEL_FILE_NAME).dSYM/$(DSYMINFODIR)/Info.plist $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(ALT_KERNEL_FILE_NAME).dSYM/$(DSYMINFODIR)/Info.plist: $(TARGET)/$(DSYMKERNELSYSDIR)/$(DSYMINFODIR)/Info.plist
306 $(_v)$(MKDIR) $(dir $@)
307 @echo INSTALLSYM dSYM $(notdir $@) "($(CURRENT_ARCH_CONFIG_LC) $(CURRENT_MACHINE_CONFIG_LC))"
308ifeq ($(USE_BINARY_PLIST),1)
309 $(_v)$(PLUTIL) -convert binary1 -o $@ $<
310else
311 $(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
312endif
313
314$(SYMROOT)/$(ALT_KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(ALT_KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros: $(TARGET)/$(DSYMKERNELSYSDIR)/$(DSYMLLDBMACROSDIR)/lldbmacros
315 $(_v)$(MKDIR) $(dir $@)
316 @echo INSTALLMACROS $(notdir $@) "($(CURRENT_ARCH_CONFIG_LC))"
317 $(_v)$(CP) -r $< $(dir $@)
318 $(_v)$(TOUCH) $@
319
320$(SYMROOT)/$(ALT_KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(ALT_KERNEL_LLDBBOOTSTRAP_NAME) $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(ALT_KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(ALT_KERNEL_LLDBBOOTSTRAP_NAME): $(TARGET)/$(DSYMKERNELSYSDIR)/$(DSYMLLDBMACROSDIR)/lldbmacros/core/xnu_lldb_init.py
321 $(_v)$(MKDIR) $(dir $@)
322 @echo INSTALLMACROS $(notdir $@) "($(CURRENT_ARCH_CONFIG_LC) $(CURRENT_MACHINE_CONFIG_LC))"
323 $(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
324
325$(SYMROOT)/$(ALT_KERNEL_FILE_NAME).dSYM/$(DSYMDWARFDIR)/$(ALT_KERNEL_FILE_NAME) $(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(ALT_KERNEL_FILE_NAME).dSYM/$(DSYMDWARFDIR)/$(ALT_KERNEL_FILE_NAME): $(TARGET)/$(DSYMKERNELSYSDIR)/$(DSYMDWARFDIR)/mach_kernel.sys ALWAYS
326 $(_v)$(MKDIR) $(dir $@)
327 $(_v)if [ $(OBJROOT)/.mach_kernel.timestamp -nt $@ ]; then \
328 echo INSTALLSYM dSYM $(notdir $@).dSYM "($(CURRENT_ARCH_CONFIG_LC) $(CURRENT_MACHINE_CONFIG_LC))"; \
329 $(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@; \
330 cmdstatus=$$?; \
331 else \
332 echo INSTALLSYM dSYM $(notdir $@).dSYM "($(CURRENT_ARCH_CONFIG_LC) $(CURRENT_MACHINE_CONFIG_LC))"; \
333 $(LIPO) -create $@ $< -output $@; \
334 cmdstatus=$$?; \
335 fi; \
336 exit $$cmdstatus
337
338# The $(RM) is needed so that the $(LN) doesn't dereference an existing
339# symlink during incremental builds and create a new symlink inside
340# the target of the existing symlink
341do_installhdrs_mi::
342 $(_v)$(MKDIR) $(DSTROOT)/$(KINCFRAME)
343 $(_v)$(MKDIR) $(DSTROOT)/$(KPINCDIR)
344 $(_v)$(RM) $(DSTROOT)/$(KINCFRAME)/Versions/Current
345 $(_v)$(LN) $(KINCVERS) $(DSTROOT)/$(KINCFRAME)/Versions/Current
346 $(_v)$(RM) $(DSTROOT)/$(KINCFRAME)/Headers
347 $(_v)$(LN) Versions/Current/Headers \
348 $(DSTROOT)/$(KINCFRAME)/Headers
349 $(_v)$(RM) $(DSTROOT)/$(KINCFRAME)/PrivateHeaders
350 $(_v)$(LN) Versions/Current/PrivateHeaders \
351 $(DSTROOT)/$(KINCFRAME)/PrivateHeaders
352ifeq ($(INSTALL_SYSTEM_FRAMEWORK_SYMLINKS),1)
353 $(_v)$(MKDIR) $(DSTROOT)/$(SINCFRAME)/Versions
354 $(_v)$(RM) $(DSTROOT)/$(SINCFRAME)/Versions/Current
355 $(_v)$(LN) $(SINCVERS) $(DSTROOT)/$(SINCFRAME)/Versions/Current
356 $(_v)$(RM) $(DSTROOT)/$(SINCFRAME)/PrivateHeaders
357 $(_v)$(LN) Versions/Current/PrivateHeaders \
358 $(DSTROOT)/$(SINCFRAME)/PrivateHeaders
359endif
360
361$(DSTROOT)/$(KRESDIR)/Info.plist: $(SOURCE)/EXTERNAL_HEADERS/Info.plist
362 $(_v)$(MKDIR) $(DSTROOT)/$(KRESDIR)
363 $(_v)$(INSTALL) $(DATA_INSTALL_FLAGS) $< $@
364 $(_v)$(NEWVERS) $@ $(_vstdout)
365ifeq ($(USE_BINARY_PLIST),1)
366 $(_v)$(PLUTIL) -convert binary1 -o $@ $@
367endif
368
369.PHONY: do_install_kernel_framework
370
371do_install_kernel_framework: $(DSTROOT)/$(KRESDIR)/Info.plist
372 $(_v)$(MKDIR) $(DSTROOT)/$(KRESDIR)
373 $(_v)$(RM) $(DSTROOT)/$(KINCFRAME)/Resources
374 $(_v)$(LN) Versions/Current/Resources \
375 $(DSTROOT)/$(KINCFRAME)/Resources
376ifeq ($(DELETE_KERNEL_FRAMEWORK_AND_MISC),1)
377 $(_v)$(FIND) $(DSTROOT)/$(KINCFRAME) \
378 $(DSTROOT)/$(INSTALL_EXTENSIONS_DIR) \
379 $(DSTROOT)/$(INSTALL_SHARE_MISC_DIR) \
380 $(DSTROOT)/$(INSTALL_DTRACE_SCRIPTS_DIR) \
381 \( -type f -o -type l \) -exec $(RM) "{}" \;
382 $(_v)$(FIND) -d $(DSTROOT)/$(KINCFRAME) \
383 $(DSTROOT)/$(INSTALL_EXTENSIONS_DIR) \
384 $(DSTROOT)/$(INSTALL_SHARE_MISC_DIR) \
385 $(DSTROOT)/$(INSTALL_DTRACE_SCRIPTS_DIR) \
386 \( -type d \) -exec $(RMDIR) "{}" \;
387endif
388
389print_exports:
390 $(_v)printenv | sort