xref: /xnu-8792.61.2/makedefs/MakeInc.kernel (revision 42e220869062b56f8d7d0726fd4c88954f87902c)
1*42e22086SApple OSS Distributions# -*- mode: makefile;-*-
2*42e22086SApple OSS Distributions#
3*42e22086SApple OSS Distributions# Copyright (C) 1999-2020 Apple Inc. All rights reserved.
4*42e22086SApple OSS Distributions#
5*42e22086SApple OSS Distributions# MakeInc.kernel augments the single-architecture
6*42e22086SApple OSS Distributions# recursive build system with rules specific
7*42e22086SApple OSS Distributions# to assembling and linking a kernel.
8*42e22086SApple OSS Distributions#
9*42e22086SApple OSS Distributions
10*42e22086SApple OSS Distributions#
11*42e22086SApple OSS Distributions# Validate configuration options
12*42e22086SApple OSS Distributions#
13*42e22086SApple OSS Distributionsifeq ($(filter $(CURRENT_ARCH_CONFIG),$(SUPPORTED_ARCH_CONFIGS)),)
14*42e22086SApple OSS Distributions$(error Unsupported CURRENT_ARCH_CONFIG $(CURRENT_ARCH_CONFIG))
15*42e22086SApple OSS Distributionsendif
16*42e22086SApple OSS Distributions
17*42e22086SApple OSS Distributionsifeq ($(filter $(CURRENT_KERNEL_CONFIG),$(SUPPORTED_KERNEL_CONFIGS)),)
18*42e22086SApple OSS Distributions$(error Unsupported CURRENT_KERNEL_CONFIG $(CURRENT_KERNEL_CONFIG))
19*42e22086SApple OSS Distributionsendif
20*42e22086SApple OSS Distributions
21*42e22086SApple OSS Distributionsifeq ($(filter $(CURRENT_MACHINE_CONFIG),$(SUPPORTED_$(CURRENT_ARCH_CONFIG)_MACHINE_CONFIGS)),)
22*42e22086SApple OSS Distributions$(error Unsupported CURRENT_MACHINE_CONFIG $(CURRENT_MACHINE_CONFIG))
23*42e22086SApple OSS Distributionsendif
24*42e22086SApple OSS Distributions
25*42e22086SApple OSS Distributionsifeq ($(filter $(PLATFORM),$(SUPPORTED_PLATFORMS)),)
26*42e22086SApple OSS Distributions$(error Unsupported PLATFORM $(PLATFORM))
27*42e22086SApple OSS Distributionsendif
28*42e22086SApple OSS Distributions
29*42e22086SApple OSS Distributionsifeq ($(BUILD_JSON_COMPILATION_DATABASE),1)
30*42e22086SApple OSS Distributionsdo_build_setup::
31*42e22086SApple OSS Distributions	$(_v)$(CAT) > $(OBJPATH)/compile_commands.json < /dev/null
32*42e22086SApple OSS Distributionsendif
33*42e22086SApple OSS Distributions
34*42e22086SApple OSS Distributionsifeq ($(BUILD_STATIC_LINK),1)
35*42e22086SApple OSS Distributionsifeq ($(USE_LTO),1)
36*42e22086SApple OSS Distributions# <rdar://problem/46252406>
37*42e22086SApple OSS Distributions# To run LTO in the xnu project while linking the final result in KCB, without losing debugging info,
38*42e22086SApple OSS Distributions# run ld -r on only the LTO bitcode object files to produce one mach-o for KCB to use, which is added
39*42e22086SApple OSS Distributions# to the static link archive, along with the non-LTO objects (not linked, since ld -r on mach-o objects
40*42e22086SApple OSS Distributions# does not preserve DWARF.)
41*42e22086SApple OSS DistributionsPRE_LTO=1
42*42e22086SApple OSS Distributionsendif
43*42e22086SApple OSS Distributionsendif
44*42e22086SApple OSS Distributions
45*42e22086SApple OSS Distributions#
46*42e22086SApple OSS Distributions# Rules for the highly parallel "build" phase, where each build configuration
47*42e22086SApple OSS Distributions# writes into their own $(TARGET) independent of other build configs
48*42e22086SApple OSS Distributions#
49*42e22086SApple OSS Distributions# There are 5 primary build outputs:
50*42e22086SApple OSS Distributions# 1) $(KERNEL_FILE_NAME).unstripped    (raw linked kernel, unstripped)
51*42e22086SApple OSS Distributions# 2) $(KERNEL_FILE_NAME)               (stripped kernel, with optional CTF data)
52*42e22086SApple OSS Distributions# 3) $(KERNEL_FILE_NAME).dSYM          (dSYM)
53*42e22086SApple OSS Distributions# 4) $(KERNEL_FILE_NAME).link          (bits for static linking)
54*42e22086SApple OSS Distributions# 5) lib$(KERNEL_FILE_NAME).a          (static archive for testing)
55*42e22086SApple OSS Distributions
56*42e22086SApple OSS Distributionsifeq ($(BUILD_STATIC_LINK),1)
57*42e22086SApple OSS Distributionsifeq ($(BUILD_XNU_LIBRARY),1)
58*42e22086SApple OSS Distributions
59*42e22086SApple OSS DistributionsKERNEL_STATIC_LINK_TARGETS = \
60*42e22086SApple OSS Distributions	$(TARGET)/lib$(KERNEL_FILE_NAME).a
61*42e22086SApple OSS DistributionsKERNEL_STATIC_LINK_DST = \
62*42e22086SApple OSS Distributions	$(DSTROOT)/$(INSTALL_KERNEL_DIR)/lib$(KERNEL_FILE_NAME).a
63*42e22086SApple OSS Distributions
64*42e22086SApple OSS Distributionselse
65*42e22086SApple OSS Distributions
66*42e22086SApple OSS DistributionsKERNEL_STATIC_LINK_TARGETS = \
67*42e22086SApple OSS Distributions	$(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).a
68*42e22086SApple OSS Distributions
69*42e22086SApple OSS DistributionsKERNEL_STATIC_LINK_DST = \
70*42e22086SApple OSS Distributions			$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).a             \
71*42e22086SApple OSS Distributions			$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).linkarguments \
72*42e22086SApple OSS Distributions			$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).linkarchives  \
73*42e22086SApple OSS Distributions			$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).exp           \
74*42e22086SApple OSS Distributions			$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).alias.exp     \
75*42e22086SApple OSS Distributions			$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros                   \
76*42e22086SApple OSS Distributions			$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_LLDBBOOTSTRAP_NAME)
77*42e22086SApple OSS Distributions
78*42e22086SApple OSS Distributionsendif
79*42e22086SApple OSS Distributionsendif
80*42e22086SApple OSS Distributions
81*42e22086SApple OSS Distributionsdo_build_all:: do_build_kernel
82*42e22086SApple OSS Distributions
83*42e22086SApple OSS Distributions.PHONY: do_build_kernel
84*42e22086SApple OSS Distributions
85*42e22086SApple OSS Distributionsifeq ($(BUILD_XNU_LIBRARY),1)
86*42e22086SApple OSS Distributionsdo_build_kernel: $(KERNEL_STATIC_LINK_TARGETS)
87*42e22086SApple OSS Distributions
88*42e22086SApple OSS Distributionselse
89*42e22086SApple OSS Distributions
90*42e22086SApple OSS Distributionsdo_build_kernel: $(TARGET)/$(KERNEL_FILE_NAME) $(TARGET)/$(KERNEL_FILE_NAME).unstripped $(KERNEL_STATIC_LINK_TARGETS)
91*42e22086SApple OSS Distributions	@:
92*42e22086SApple OSS Distributions
93*42e22086SApple OSS Distributionsifeq ($(BUILD_DSYM),1)
94*42e22086SApple OSS Distributionsdo_build_all:: do_build_kernel_dSYM
95*42e22086SApple OSS Distributionsendif
96*42e22086SApple OSS Distributions
97*42e22086SApple OSS Distributions.PHONY: do_build_kernel_dSYM
98*42e22086SApple OSS Distributions
99*42e22086SApple OSS Distributionsdo_build_kernel_dSYM: $(TARGET)/$(KERNEL_FILE_NAME).dSYM
100*42e22086SApple OSS Distributions	@:
101*42e22086SApple OSS Distributions
102*42e22086SApple OSS Distributionsendif
103*42e22086SApple OSS Distributions
104*42e22086SApple OSS Distributions.LDFLAGS: ALWAYS
105*42e22086SApple OSS Distributions	$(_v)$(REPLACECONTENTS) $@ $(LD) $(LDFLAGS_KERNEL) $(LDFLAGS_KERNEL_ONLY) $(LD_KERNEL_LIBS)
106*42e22086SApple OSS Distributions.CFLAGS: ALWAYS
107*42e22086SApple OSS Distributions	$(_v)$(REPLACECONTENTS) $@ $(KCC) $(CFLAGS) $(INCFLAGS)
108*42e22086SApple OSS Distributions
109*42e22086SApple OSS Distributions$(TARGET)/$(KERNEL_FILE_NAME): $(TARGET)/$(KERNEL_FILE_NAME).unstripped $(TARGET)/$(KERNEL_FILE_NAME).dSYM
110*42e22086SApple OSS Distributions	@$(LOG_STRIP) "$(@F)"
111*42e22086SApple OSS Distributions	$(_v)$(STRIP) $(STRIP_FLAGS) $< -o $@
112*42e22086SApple OSS Distributions	@echo "built kernel at $@"
113*42e22086SApple OSS Distributions	$(_v)$(RM) [email protected]
114*42e22086SApple OSS Distributionsifeq ($(DO_CTFMERGE),1)
115*42e22086SApple OSS Distributions	@$(LOG_CTFCONVERT) "$(@F)"
116*42e22086SApple OSS Distributions	$(_v)$(CTFCONVERT) -c -l xnu -u xnu -o [email protected] $(TARGET)/$(KERNEL_FILE_NAME).dSYM/Contents/Resources/DWARF/$(KERNEL_FILE_NAME)
117*42e22086SApple OSS Distributions	@$(LOG_CTFMERGE) "$(@F)"
118*42e22086SApple OSS Distributions	$(_v)$(CTFMERGE) -l xnu -o $@ -Z [email protected] [email protected]
119*42e22086SApple OSS Distributions	-$(_v)$(CTFDUMP) -S [email protected] $(_vstdout) $(_vstderr)
120*42e22086SApple OSS Distributions	$(_v)if [ -s [email protected] ]; then                          \
121*42e22086SApple OSS Distributions		$(LOG_CTFINSERT) "$(@F)";                            \
122*42e22086SApple OSS Distributions		$(CTFINSERT) $@	$(ARCH_FLAGS_$(CURRENT_ARCH_CONFIG)) \
123*42e22086SApple OSS Distributions			     [email protected] -o $@;                           \
124*42e22086SApple OSS Distributions	fi;
125*42e22086SApple OSS Distributionsendif
126*42e22086SApple OSS Distributions	$(_v)$(LN) $(call function_convert_build_config_to_objdir,$(CURRENT_BUILD_CONFIG))/$(KERNEL_FILE_NAME) $(OBJROOT)/$(KERNEL_FILE_NAME)
127*42e22086SApple OSS Distributions
128*42e22086SApple OSS Distributions$(TARGET)/$(KERNEL_FILE_NAME).dSYM: $(TARGET)/$(KERNEL_FILE_NAME).unstripped
129*42e22086SApple OSS Distributions	@$(LOG_DSYMUTIL) "$(@F)"
130*42e22086SApple OSS Distributions	$(_v)$(BASH) -c "$(DSYMUTIL) $(DSYMUTIL_FLAGS) $< -o $@ $(_vstdout) 2> >(grep -v '^warning:.*could not find object file symbol for symbol' 1>&2)"
131*42e22086SApple OSS Distributions	$(_v)$(MV) $@/$(DSYMDWARFDIR)/$(KERNEL_FILE_NAME).unstripped $@/$(DSYMDWARFDIR)/$(KERNEL_FILE_NAME)
132*42e22086SApple OSS Distributions	$(_v)$(TOUCH) $@
133*42e22086SApple OSS Distributions
134*42e22086SApple OSS Distributionsifeq ($(BUILD_XNU_LIBRARY),1)
135*42e22086SApple OSS Distributions$(TARGET)/lib$(KERNEL_FILE_NAME).a: $(addprefix $(TARGET)/,$(foreach component,$(COMPONENT_LIST),$(component)/$(CURRENT_KERNEL_CONFIG)/$(component).libfilelist)) nonlto.o $(SRCROOT)/config/version.c $(SRCROOT)/config/MasterVersion .LDFLAGS $(filter %/MakeInc.kernel,$(MAKEFILE_LIST))
136*42e22086SApple OSS Distributions	$(_v)${MAKE} -f $(firstword $(MAKEFILE_LIST)) version.o
137*42e22086SApple OSS Distributions	@$(LOG_LIBTOOL) "$(@F)"
138*42e22086SApple OSS Distributions	$(_v)$(CAT) $(filter %.libfilelist,$+) < /dev/null > link.filelist
139*42e22086SApple OSS Distributions	$(_v)$(LIBTOOL) -static -csD -filelist link.filelist -o $@
140*42e22086SApple OSS Distributions	$(_v)$(LN) $(call function_convert_build_config_to_objdir,$(CURRENT_BUILD_CONFIG))/lib$(KERNEL_FILE_NAME).a $(OBJROOT)/lib$(KERNEL_FILE_NAME).a
141*42e22086SApple OSS Distributionsendif
142*42e22086SApple OSS Distributions
143*42e22086SApple OSS Distributions$(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 $(LDFILES_KERNEL_ONLY) .LDFLAGS $(filter %/MakeInc.kernel,$(MAKEFILE_LIST))
144*42e22086SApple OSS Distributions	$(_v)${MAKE} -f $(firstword $(MAKEFILE_LIST)) version.o
145*42e22086SApple OSS Distributionsifeq ($(PRE_LTO),1)
146*42e22086SApple OSS Distributions	@$(LOG_LTO) "$(@F)"
147*42e22086SApple OSS Distributions	$(_v)$(RM) ltolink.filelist
148*42e22086SApple OSS Distributions	$(_v)$(RM) nonltolink.filelist
149*42e22086SApple OSS Distributions	$(_v)$(RM) -r $(TARGET)/justlto.o
150*42e22086SApple OSS Distributions	$(_v)files="$$($(CAT) $(filter %.filelist,$+)) version.o $(filter %.o,$+)"; \
151*42e22086SApple OSS Distributions	for ofile in $$files; \
152*42e22086SApple OSS Distributions	do \
153*42e22086SApple OSS Distributions		hdr=$$(od -An -N 4 -t x4 $$ofile); \
154*42e22086SApple OSS Distributions		if [ $$hdr = "0b17c0de" ]; \
155*42e22086SApple OSS Distributions			then \
156*42e22086SApple OSS Distributions				if [ -z "$$lto" ]; \
157*42e22086SApple OSS Distributions					then \
158*42e22086SApple OSS Distributions						lto="$$ofile"; \
159*42e22086SApple OSS Distributions					else \
160*42e22086SApple OSS Distributions						lto="$$(printf '%s\n%s' "$$lto" "$$ofile")"; \
161*42e22086SApple OSS Distributions				fi; \
162*42e22086SApple OSS Distributions			else \
163*42e22086SApple OSS Distributions				if [ -z "$$nonlto" ]; \
164*42e22086SApple OSS Distributions					then \
165*42e22086SApple OSS Distributions						nonlto="$$ofile"; \
166*42e22086SApple OSS Distributions					else \
167*42e22086SApple OSS Distributions						nonlto="$$(printf '%s\n%s' "$$nonlto" "$$ofile")"; \
168*42e22086SApple OSS Distributions				fi; \
169*42e22086SApple OSS Distributions			fi; \
170*42e22086SApple OSS Distributions	done; \
171*42e22086SApple OSS Distributions	printf '%s\n' "$$lto" >ltolink.filelist; \
172*42e22086SApple OSS Distributions	printf '%s\n' "$$nonlto" >nonltolink.filelist
173*42e22086SApple OSS Distributions	@$(LOG_LD) "$(@F)"
174*42e22086SApple OSS Distributions	$(_v)if [ -s ltolink.filelist ]; \
175*42e22086SApple OSS Distributions	then \
176*42e22086SApple OSS Distributions		$(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 && \
177*42e22086SApple OSS Distributions		if test -d $(TARGET)/justlto.o; \
178*42e22086SApple OSS Distributions		then \
179*42e22086SApple OSS Distributions		    $(LD) $(LDFLAGS_KERNEL) $(LDFLAGS_KERNEL_ONLY) -filelist nonltolink.filelist $(TARGET)/justlto.o/*.o $(LDFLAGS_KERNEL_STRIP_LTO) -o $@ $(LD_KERNEL_LIBS) $(LD_KERNEL_ARCHIVES); \
180*42e22086SApple OSS Distributions		else \
181*42e22086SApple OSS Distributions		    $(LD) $(LDFLAGS_KERNEL) $(LDFLAGS_KERNEL_ONLY) -filelist nonltolink.filelist $(TARGET)/justlto.o $(LDFLAGS_KERNEL_STRIP_LTO) -o $@ $(LD_KERNEL_LIBS) $(LD_KERNEL_ARCHIVES); \
182*42e22086SApple OSS Distributions		fi; \
183*42e22086SApple OSS Distributions	else \
184*42e22086SApple OSS Distributions		$(LD) $(LDFLAGS_KERNEL) $(LDFLAGS_KERNEL_ONLY) -filelist nonltolink.filelist -o $@ $(LD_KERNEL_LIBS) $(LD_KERNEL_ARCHIVES); \
185*42e22086SApple OSS Distributions	fi
186*42e22086SApple OSS Distributionselse
187*42e22086SApple OSS Distributions	@$(LOG_LD) "$(@F)"
188*42e22086SApple OSS Distributions	$(_v)$(CAT) $(filter %.filelist,$+) < /dev/null > link.filelist
189*42e22086SApple OSS Distributions	$(_v)$(LD) $(LDFLAGS_KERNEL) $(LDFLAGS_KERNEL_ONLY) -filelist link.filelist version.o $(filter %.o,$+) -o $@ $(LD_KERNEL_LIBS) $(LD_KERNEL_ARCHIVES)
190*42e22086SApple OSS Distributionsendif
191*42e22086SApple OSS Distributions
192*42e22086SApple OSS Distributions# for now, rename LASTDATA_CONST to LAST on static kernel cache builds
193*42e22086SApple OSS DistributionsEXTRA_KC_LINKARGS = -Wl,-rename_segment,__LASTDATA_CONST,__LAST
194*42e22086SApple OSS Distributions
195*42e22086SApple OSS Distributions$(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).a:   $(TARGET)/$(KERNEL_FILE_NAME).unstripped .LDFLAGS $(filter %/MakeInc.kernel,$(MAKEFILE_LIST))
196*42e22086SApple OSS Distributions	@$(LOG_LIBTOOL) "$(@F)"
197*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(dir $@)
198*42e22086SApple OSS Distributionsifeq ($(PRE_LTO),1)
199*42e22086SApple OSS Distributions	$(_v)if [ -d $(TARGET)/justlto.o ]; \
200*42e22086SApple OSS Distributions	then \
201*42e22086SApple OSS Distributions	    $(LIBTOOL) -ca $(TARGET)/justlto.o/*.o -filelist nonltolink.filelist -o $@; \
202*42e22086SApple OSS Distributions	else \
203*42e22086SApple OSS Distributions	    $(LIBTOOL) -ca $(TARGET)/justlto.o -filelist nonltolink.filelist -o $@; \
204*42e22086SApple OSS Distributions	fi
205*42e22086SApple OSS Distributionselse
206*42e22086SApple OSS Distributions	$(_v)$(LIBTOOL) -ca -filelist link.filelist version.o lastkerneldataconst.o lastkernelconstructor.o -o $@
207*42e22086SApple OSS Distributionsendif
208*42e22086SApple OSS Distributions	$(_v)cp $(TARGET)/all-kpi.exp $(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).exp
209*42e22086SApple OSS Distributions	$(_v)cp $(TARGET)/all-alias.exp $(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).alias.exp
210*42e22086SApple OSS Distributions	$(_v)echo "$(LD_KERNEL_ARCHIVES)" >$(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).linkarchives
211*42e22086SApple OSS Distributions	$(_v)echo "$(LDFLAGS_KERNEL) $(LD_KERNEL_LIBS) $(EXTRA_KC_LINKARGS)" >$(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).linkarguments
212*42e22086SApple OSS Distributions	$(_v)$(LN) $(call function_convert_build_config_to_objdir,$(CURRENT_BUILD_CONFIG))/$(KERNEL_FILE_NAME).link $(OBJROOT)/$(KERNEL_FILE_NAME).link
213*42e22086SApple OSS Distributions
214*42e22086SApple OSS Distributionsnonlto.o: .CFLAGS $(filter %/MakeInc.kernel,$(MAKEFILE_LIST))
215*42e22086SApple OSS Distributionsnonlto.o:   $(SRCROOT)/libsa/nonlto.c
216*42e22086SApple OSS Distributions	${C_RULE_0}
217*42e22086SApple OSS Distributions	${C_RULE_1A}$< $(CFLAGS_NOLTO_FLAG)
218*42e22086SApple OSS Distributions	${C_RULE_2}
219*42e22086SApple OSS Distributions
220*42e22086SApple OSS Distributions-include version.d
221*42e22086SApple OSS Distributionsversion.o: .CFLAGS $(filter %/MakeInc.kernel,$(MAKEFILE_LIST))
222*42e22086SApple OSS Distributionsversion.o: $(OBJPATH)/version.c
223*42e22086SApple OSS Distributions	${C_RULE_0}
224*42e22086SApple OSS Distributions	${C_RULE_1A}$<
225*42e22086SApple OSS Distributions	${C_RULE_2}
226*42e22086SApple OSS Distributions	${C_RULE_4}
227*42e22086SApple OSS Distributions
228*42e22086SApple OSS Distributions# Always recreate version.sh
229*42e22086SApple OSS Distributions$(OBJPATH)/version.c: $(SRCROOT)/config/version.c $(NEWVERS) $(SRCROOT)/config/MasterVersion ALWAYS
230*42e22086SApple OSS Distributions	$(_v)$(CP) $< $@
231*42e22086SApple OSS Distributions	$(_v)$(NEWVERS) $(OBJPATH)/version.c > /dev/null;
232*42e22086SApple OSS Distributions
233*42e22086SApple OSS Distributions
234*42e22086SApple OSS Distributions-include lastkerneldataconst.d
235*42e22086SApple OSS Distributionslastkerneldataconst.o: .CFLAGS $(filter %/MakeInc.kernel,$(MAKEFILE_LIST))
236*42e22086SApple OSS Distributionslastkerneldataconst.o: $(SRCROOT)/libsa/lastkerneldataconst.c
237*42e22086SApple OSS Distributions	${C_RULE_0}
238*42e22086SApple OSS Distributions	${C_RULE_1A}$<
239*42e22086SApple OSS Distributions	${C_RULE_2}
240*42e22086SApple OSS Distributions
241*42e22086SApple OSS Distributions
242*42e22086SApple OSS Distributionslastkernelconstructor.o_CFLAGS_RM = -fprofile-instr-generate
243*42e22086SApple OSS Distributions# the LAST segment is mapped read-only on arm, so if we include llvm profiling
244*42e22086SApple OSS Distributions# here it will segfault the kernel.  (see arm_vm_init.c) We don't currently have
245*42e22086SApple OSS Distributions# a way of retrieving these counters from LAST anyway, so there's no harm in just
246*42e22086SApple OSS Distributions# disabling them.
247*42e22086SApple OSS Distributions
248*42e22086SApple OSS DistributionsLAST_FILES=lastkernelconstructor.o
249*42e22086SApple OSS Distributions-include lastkernelconstructor.d
250*42e22086SApple OSS Distributionslastkernelconstructor.o: .CFLAGS $(filter %/MakeInc.kernel,$(MAKEFILE_LIST))
251*42e22086SApple OSS Distributionslastkernelconstructor.o: $(SRCROOT)/libsa/lastkernelconstructor.c
252*42e22086SApple OSS Distributions	${C_RULE_0}
253*42e22086SApple OSS Distributions	${C_RULE_1A}$< $(CFLAGS_NOLTO_FLAG)
254*42e22086SApple OSS Distributions	${C_RULE_2}
255*42e22086SApple OSS Distributions	${C_RULE_3}
256*42e22086SApple OSS Distributions	${C_RULE_4}
257*42e22086SApple OSS Distributions	$(_v)for last_file in ${LAST_FILES};				\
258*42e22086SApple OSS Distributions	do							\
259*42e22086SApple OSS Distributions		$(SEG_HACK) -s __DATA -n __LASTDATA_CONST -o $${last_file}__ $${last_file} || exit 1; \
260*42e22086SApple OSS Distributions		mv $${last_file}__ $${last_file} || exit 1;		\
261*42e22086SApple OSS Distributions	done
262*42e22086SApple OSS DistributionsEXTRA_KC_LINKARGS = -Wl,-rename_segment,__LASTDATA_CONST,__LAST
263*42e22086SApple OSS Distributions
264*42e22086SApple OSS Distributions#
265*42e22086SApple OSS Distributions# Install rules. Each build config is classified as "primary" (the first
266*42e22086SApple OSS Distributions# config for an architecture) or "non-primary". Primary build configs
267*42e22086SApple OSS Distributions# have the semantic of competing to *combine* single-architecture
268*42e22086SApple OSS Distributions# files into a multi-architecture output in the DSTROOT, like
269*42e22086SApple OSS Distributions# $(DSTROOT)/$(KERNEL_FILE_NAME), and consequently each primary build config
270*42e22086SApple OSS Distributions# has its install target run serially with respect to other primary
271*42e22086SApple OSS Distributions# build configs. Non-primary build configs will never compete for
272*42e22086SApple OSS Distributions# files in the DSTROOT or SYMROOT, and can be installed in parallel
273*42e22086SApple OSS Distributions# with other non-primary configs (and even primary configs)
274*42e22086SApple OSS Distributions#
275*42e22086SApple OSS Distributions
276*42e22086SApple OSS Distributionsdo_build_install_primary:: do_install_machine_specific_kernel
277*42e22086SApple OSS Distributionsifeq ($(BUILD_DSYM),1)
278*42e22086SApple OSS Distributionsdo_build_install_primary:: do_install_machine_specific_kernel_dSYM
279*42e22086SApple OSS Distributionsendif
280*42e22086SApple OSS Distributions
281*42e22086SApple OSS Distributionsdo_build_install_non_primary:: do_install_machine_specific_kernel
282*42e22086SApple OSS Distributionsifeq ($(BUILD_DSYM),1)
283*42e22086SApple OSS Distributionsdo_build_install_non_primary:: do_install_machine_specific_kernel_dSYM
284*42e22086SApple OSS Distributionsendif
285*42e22086SApple OSS Distributions
286*42e22086SApple OSS Distributionsifeq ($(BUILD_DSYM),1)
287*42e22086SApple OSS Distributionsifeq ($(INSTALL_KERNEL_SYM_TO_KDK),1)
288*42e22086SApple OSS Distributionsdo_build_install_primary:: do_install_machine_specific_KDK_dSYM
289*42e22086SApple OSS Distributionsdo_build_install_non_primary:: do_install_machine_specific_KDK_dSYM
290*42e22086SApple OSS Distributionsendif
291*42e22086SApple OSS Distributionsendif
292*42e22086SApple OSS Distributions
293*42e22086SApple OSS Distributionsifneq ($(BUILD_XNU_LIBRARY),1)
294*42e22086SApple OSS Distributionsifeq ($(INSTALL_XNU_DEBUG_FILES),1)
295*42e22086SApple OSS Distributionsdo_build_install_primary:: do_install_xnu_debug_files
296*42e22086SApple OSS Distributionsendif
297*42e22086SApple OSS Distributions
298*42e22086SApple OSS Distributions.PHONY: do_install_xnu_debug_files
299*42e22086SApple OSS Distributions
300*42e22086SApple OSS Distributionsdo_install_xnu_debug_files:	$(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/README.DEBUG-kernel.txt
301*42e22086SApple OSS Distributions	@:
302*42e22086SApple OSS Distributionsendif
303*42e22086SApple OSS Distributions
304*42e22086SApple OSS Distributions#
305*42e22086SApple OSS Distributions# If the timestamp indicates the DSTROOT kernel is out of
306*42e22086SApple OSS Distributions# date, start over. Normal dependencies don't work because we can have
307*42e22086SApple OSS Distributions# ( BUILDA, BUILDB, INSTALLB, INSTALLA ) in which case at INSTALLA time
308*42e22086SApple OSS Distributions# the timestamps would $(DSTROOT)/$(KERNEL_FILE_NAME) is not out of date compared
309*42e22086SApple OSS Distributions# to BUILDA. So we maintain a separate file at the time make(1)
310*42e22086SApple OSS Distributions# was run and use it to determine what actions to take
311*42e22086SApple OSS Distributions#
312*42e22086SApple OSS Distributions
313*42e22086SApple OSS Distributions$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME): $(TARGET)/$(KERNEL_FILE_NAME) ALWAYS
314*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(dir $@)
315*42e22086SApple OSS Distributions	@$(LOG_INSTALL) "$(@F)$(Color0) ($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))"
316*42e22086SApple OSS Distributions    # -nt and -ot are evaluated differently by bash, dash, and zsh (and are not part of the POSIX specification).
317*42e22086SApple OSS Distributions    # Explicitly specify what should happen when the right hand file doesn't exist.
318*42e22086SApple OSS Distributions	$(_v)if [ $(OBJROOT)/.mach_kernel.timestamp -nt $@ -o \( -e $(OBJROOT)/.mach_kernel.timestamp -a \! -e $@ \) ]; then	\
319*42e22086SApple OSS Distributions		$(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@;			\
320*42e22086SApple OSS Distributions		cmdstatus=$$?;						\
321*42e22086SApple OSS Distributions	else								\
322*42e22086SApple OSS Distributions		$(LIPO) -create $@ $< -output $@;			\
323*42e22086SApple OSS Distributions		cmdstatus=$$?;						\
324*42e22086SApple OSS Distributions	fi;								\
325*42e22086SApple OSS Distributions	exit $$cmdstatus
326*42e22086SApple OSS Distributions
327*42e22086SApple OSS Distributionsifeq ($(BUILD_STATIC_LINK),1)
328*42e22086SApple OSS Distributionsifeq ($(BUILD_XNU_LIBRARY),1)
329*42e22086SApple OSS Distributions
330*42e22086SApple OSS Distributions$(DSTROOT)/$(INSTALL_KERNEL_DIR)/lib$(KERNEL_FILE_NAME).a: $(TARGET)/lib$(KERNEL_FILE_NAME).a ALWAYS
331*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(dir $@)
332*42e22086SApple OSS Distributions	@$(LOG_INSTALL) "$(@F)"
333*42e22086SApple OSS Distributions	$(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
334*42e22086SApple OSS Distributions
335*42e22086SApple OSS Distributionselse
336*42e22086SApple OSS Distributions$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).a: $(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).a ALWAYS
337*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(dir $@)
338*42e22086SApple OSS Distributions	@$(LOG_INSTALL) "$(@F)"
339*42e22086SApple OSS Distributions	$(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
340*42e22086SApple OSS Distributions
341*42e22086SApple OSS Distributions$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).linkarguments: $(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).linkarguments ALWAYS
342*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(dir $@)
343*42e22086SApple OSS Distributions	@$(LOG_INSTALL) "$(@F)"
344*42e22086SApple OSS Distributions	$(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
345*42e22086SApple OSS Distributions
346*42e22086SApple OSS Distributions$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).linkarchives: $(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).linkarchives ALWAYS
347*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(dir $@)
348*42e22086SApple OSS Distributions	@$(LOG_INSTALL) "$(@F)"
349*42e22086SApple OSS Distributions	$(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
350*42e22086SApple OSS Distributions
351*42e22086SApple OSS Distributions$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).exp: $(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).exp ALWAYS
352*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(dir $@)
353*42e22086SApple OSS Distributions	@$(LOG_INSTALL) "$(@F)"
354*42e22086SApple OSS Distributions	$(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
355*42e22086SApple OSS Distributions
356*42e22086SApple OSS Distributions$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).alias.exp: $(TARGET)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).alias.exp ALWAYS
357*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(dir $@)
358*42e22086SApple OSS Distributions	@$(LOG_INSTALL) "$(@F)"
359*42e22086SApple OSS Distributions	$(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
360*42e22086SApple OSS Distributionsendif
361*42e22086SApple OSS Distributions
362*42e22086SApple OSS Distributions# BUILD_STATIC_LINK
363*42e22086SApple OSS Distributionsendif
364*42e22086SApple OSS Distributions
365*42e22086SApple OSS Distributions$(SYMROOT)/$(KERNEL_FILE_NAME): $(TARGET)/$(KERNEL_FILE_NAME).unstripped ALWAYS
366*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(dir $@)
367*42e22086SApple OSS Distributions	@$(LOG_INSTALLSYM) "$(@F)$(Color0) ($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))"
368*42e22086SApple OSS Distributions    # -nt and -ot are evaluated differently by bash, dash, and zsh (and are not part of the POSIX specification).
369*42e22086SApple OSS Distributions    # Explicitly specify what should happen when the right hand file doesn't exist.
370*42e22086SApple OSS Distributions	$(_v)if [ $(OBJROOT)/.mach_kernel.timestamp -nt $@ -o \( -e $(OBJROOT)/.mach_kernel.timestamp -a \! -e $@ \) ]; then		\
371*42e22086SApple OSS Distributions		$(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@;				\
372*42e22086SApple OSS Distributions		cmdstatus=$$?;							\
373*42e22086SApple OSS Distributions	else									\
374*42e22086SApple OSS Distributions		$(LIPO) -create $@ $< -output $@;				\
375*42e22086SApple OSS Distributions		cmdstatus=$$?;							\
376*42e22086SApple OSS Distributions	fi;									\
377*42e22086SApple OSS Distributions	exit $$cmdstatus
378*42e22086SApple OSS Distributions
379*42e22086SApple OSS Distributions
380*42e22086SApple OSS Distributions$(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros                                                                     \
381*42e22086SApple OSS Distributions$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros                      \
382*42e22086SApple OSS Distributions$(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros:                                          \
383*42e22086SApple OSS Distributions$(TARGET)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros
384*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(dir $@)
385*42e22086SApple OSS Distributions	@$(LOG_INSTALLMACROS) "$(@F)$(Color0) $(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))"
386*42e22086SApple OSS Distributions	$(_v)$(CP) -r $< $(dir $@)
387*42e22086SApple OSS Distributions	$(_v)$(TOUCH) $@
388*42e22086SApple OSS Distributions
389*42e22086SApple OSS Distributions$(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_LLDBBOOTSTRAP_NAME)                                                   \
390*42e22086SApple OSS Distributions$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME).link/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_LLDBBOOTSTRAP_NAME)    \
391*42e22086SApple OSS Distributions$(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_LLDBBOOTSTRAP_NAME):                        \
392*42e22086SApple OSS Distributions$(TARGET)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_LLDBBOOTSTRAP_NAME)
393*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(dir $@)
394*42e22086SApple OSS Distributions	@$(LOG_INSTALLMACROS) "$(@F)$(Color0) ($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))"
395*42e22086SApple OSS Distributions	$(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
396*42e22086SApple OSS Distributions
397*42e22086SApple OSS Distributions$(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)/README.DEBUG-kernel.txt: $(SRCROOT)/config/README.DEBUG-kernel.txt
398*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(dir $@)
399*42e22086SApple OSS Distributions	@$(LOG_INSTALL) "$(@F)"
400*42e22086SApple OSS Distributions	$(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
401*42e22086SApple OSS Distributions
402*42e22086SApple OSS Distributions$(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
403*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(dir $@)
404*42e22086SApple OSS Distributions	@$(LOG_INSTALLSYM) "$(ColorL)dSYM$(Color0) $(ColorF)$(@F)$(Color0) ($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))"
405*42e22086SApple OSS Distributions	$(_v)$(INSTALL) $(INSTALL_FLAGS) $< $@
406*42e22086SApple OSS Distributions
407*42e22086SApple OSS Distributions$(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
408*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(dir $@)
409*42e22086SApple OSS Distributions	@$(LOG_INSTALLSYM) "$(ColorL)dSYM$(Color0) $(ColorF)$(@F).dSYM$(ColorF) ($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0))"
410*42e22086SApple OSS Distributions    # -nt and -ot are evaluated differently by bash, dash, and zsh (and are not part of the POSIX specification).
411*42e22086SApple OSS Distributions    # Explicitly specify what should happen when the right hand file doesn't exist.
412*42e22086SApple OSS Distributions	$(_v)if [ $(OBJROOT)/.mach_kernel.timestamp -nt $@ -o \( -e $(OBJROOT)/.mach_kernel.timestamp -a \! -e $@ \) ]; then			\
413*42e22086SApple OSS Distributions		$(INSTALL) $(EXEC_INSTALL_FLAGS) $< $@;					\
414*42e22086SApple OSS Distributions		cmdstatus=$$?;								\
415*42e22086SApple OSS Distributions	else										\
416*42e22086SApple OSS Distributions		$(LIPO) -create $@ $< -output $@;					\
417*42e22086SApple OSS Distributions		cmdstatus=$$?;								\
418*42e22086SApple OSS Distributions	fi;										\
419*42e22086SApple OSS Distributions	exit $$cmdstatus
420*42e22086SApple OSS Distributions
421*42e22086SApple OSS Distributions.PHONY: do_install_machine_specific_kernel do_install_machine_specific_kernel_dSYM
422*42e22086SApple OSS Distributions.PHONY: do_install_machine_specific_KDK_dSYM
423*42e22086SApple OSS Distributions
424*42e22086SApple OSS Distributionsifeq ($(BUILD_XNU_LIBRARY),1)
425*42e22086SApple OSS Distributions
426*42e22086SApple OSS Distributionsdo_install_machine_specific_kernel: $(KERNEL_STATIC_LINK_DST)
427*42e22086SApple OSS Distributions	@:
428*42e22086SApple OSS Distributionsdo_install_machine_specific_kernel_dSYM:
429*42e22086SApple OSS Distributions	@:
430*42e22086SApple OSS Distributions
431*42e22086SApple OSS Distributionselse
432*42e22086SApple OSS Distributions
433*42e22086SApple OSS Distributionsdo_install_machine_specific_kernel: $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME)                \
434*42e22086SApple OSS Distributions			$(SYMROOT)/$(KERNEL_FILE_NAME)                                                              \
435*42e22086SApple OSS Distributions			$(KERNEL_STATIC_LINK_DST)
436*42e22086SApple OSS Distributions	@:
437*42e22086SApple OSS Distributions
438*42e22086SApple OSS Distributionsdo_install_machine_specific_kernel_dSYM: \
439*42e22086SApple OSS Distributions			$(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMINFODIR)/Info.plist \
440*42e22086SApple OSS Distributions			$(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros \
441*42e22086SApple OSS Distributions			$(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_LLDBBOOTSTRAP_NAME) \
442*42e22086SApple OSS Distributions			$(SYMROOT)/$(KERNEL_FILE_NAME).dSYM/$(DSYMDWARFDIR)/$(KERNEL_FILE_NAME)
443*42e22086SApple OSS Distributions	@:
444*42e22086SApple OSS Distributions
445*42e22086SApple OSS Distributionsdo_install_machine_specific_KDK_dSYM: \
446*42e22086SApple OSS Distributions			$(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMINFODIR)/Info.plist \
447*42e22086SApple OSS Distributions			$(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/lldbmacros \
448*42e22086SApple OSS Distributions			$(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMLLDBMACROSDIR)/$(KERNEL_LLDBBOOTSTRAP_NAME) \
449*42e22086SApple OSS Distributions			$(DSTROOT)/$(INSTALL_KERNEL_SYM_DIR)/$(KERNEL_FILE_NAME).dSYM/$(DSYMDWARFDIR)/$(KERNEL_FILE_NAME)
450*42e22086SApple OSS Distributions	@:
451*42e22086SApple OSS Distributions
452*42e22086SApple OSS Distributionsendif
453*42e22086SApple OSS Distributions
454*42e22086SApple OSS Distributions# The $(RM) is needed so that the $(LN) doesn't dereference an existing
455*42e22086SApple OSS Distributions# symlink during incremental builds and create a new symlink inside
456*42e22086SApple OSS Distributions# the target of the existing symlink
457*42e22086SApple OSS Distributionsdo_installhdrs_mi:: $(DSTROOT)/$(KRESDIR)/Info.plist
458*42e22086SApple OSS Distributionsifneq ($(INSTALLHDRS_SKIP_HOST),YES)
459*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(DSTROOT)/$(KINCFRAME)
460*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(DSTROOT)/$(KPINCDIR)
461*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(DSTROOT)/$(KRESDIR)
462*42e22086SApple OSS Distributions	$(_v)$(RM) $(DSTROOT)/$(KINCFRAME)/Versions/Current
463*42e22086SApple OSS Distributions	$(_v)$(LN) $(KINCVERS) $(DSTROOT)/$(KINCFRAME)/Versions/Current
464*42e22086SApple OSS Distributions	$(_v)$(RM) $(DSTROOT)/$(KINCFRAME)/Headers
465*42e22086SApple OSS Distributions	$(_v)$(LN) Versions/Current/Headers			\
466*42e22086SApple OSS Distributions		   $(DSTROOT)/$(KINCFRAME)/Headers
467*42e22086SApple OSS Distributions	$(_v)$(RM) $(DSTROOT)/$(KINCFRAME)/PrivateHeaders
468*42e22086SApple OSS Distributions	$(_v)$(LN) Versions/Current/PrivateHeaders		\
469*42e22086SApple OSS Distributions		   $(DSTROOT)/$(KINCFRAME)/PrivateHeaders
470*42e22086SApple OSS Distributions	$(_v)$(RM) $(DSTROOT)/$(KINCFRAME)/Resources
471*42e22086SApple OSS Distributions	$(_v)$(LN) Versions/Current/Resources			\
472*42e22086SApple OSS Distributions		   $(DSTROOT)/$(KINCFRAME)/Resources
473*42e22086SApple OSS Distributionsendif
474*42e22086SApple OSS Distributions
475*42e22086SApple OSS Distributions$(DSTROOT)/$(KRESDIR)/Info.plist: $(SOURCE)/EXTERNAL_HEADERS/Info.plist
476*42e22086SApple OSS Distributionsifneq ($(INSTALLHDRS_SKIP_HOST),YES)
477*42e22086SApple OSS Distributions	$(_v)$(MKDIR) $(DSTROOT)/$(KRESDIR)
478*42e22086SApple OSS Distributions	$(_v)$(INSTALL) $(DATA_INSTALL_FLAGS) $< $@
479*42e22086SApple OSS Distributions	$(_v)$(NEWVERS) $@ $(_vstdout)
480*42e22086SApple OSS Distributionsifeq ($(USE_BINARY_PLIST),1)
481*42e22086SApple OSS Distributions	$(_v)$(PLUTIL) -convert binary1 -o $@ $@
482*42e22086SApple OSS Distributionsendif
483*42e22086SApple OSS Distributionsendif
484*42e22086SApple OSS Distributions
485*42e22086SApple OSS Distributions$(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(ALIAS_FILE_NAME): ALWAYS
486*42e22086SApple OSS Distributions	@$(LOG_ALIAS) "$(@F)$(Color0) ($(ColorLF)$(CURRENT_ARCH_CONFIG_LC)$(Color0) $(ColorLF)$(CURRENT_MACHINE_CONFIG_LC)$(Color0) $(ColorLF)$(CURRENT_ALIAS_MACHINE_CONFIG_LC)$(Color0))"
487*42e22086SApple OSS Distributions	$(_v)$(INSTALL) $(EXEC_INSTALL_FLAGS) $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(KERNEL_FILE_NAME) $@
488*42e22086SApple OSS Distributions
489*42e22086SApple OSS Distributionsinstall_alias: $(DSTROOT)/$(INSTALL_KERNEL_DIR)/$(ALIAS_FILE_NAME)
490*42e22086SApple OSS Distributions
491*42e22086SApple OSS Distributionsprint_exports:
492*42e22086SApple OSS Distributions	$(_v)printenv | sort
493*42e22086SApple OSS Distributions
494*42e22086SApple OSS Distributions# vim: set ft=make:
495