2 # Install kernel header files
6 ifeq ($(RC_ProjectName),Libsyscall)
10 if [ $${sdk} = / ] ; then \
13 xcrun -sdk "$(SDKROOT)" xcodebuild installhdrs \
14 "SRCROOT=$(SRCROOT)/libsyscall" \
15 "OBJROOT=$(OBJROOT)" \
16 "SYMROOT=$(SYMROOT)" \
17 "DSTROOT=$(DSTROOT)" \
19 else ifeq ($(findstring libkxld,$(RC_ProjectName)),libkxld)
21 make -C libkern/kxld/ installhdrs
22 else # xnu, xnu_debug, or xnu_headers_Sim
23 installhdrs: exporthdrs installhdrs_mi installhdrs_md
24 @echo "[ $(SRCROOT) ] make installhdrs installing Kernel.framework"
25 $(_v)kincpath=$(DSTROOT)/$(KINCDIR); \
26 krespath=$(DSTROOT)/$(KRESDIR); \
27 kframepath=$(DSTROOT)/$(KINCFRAME); \
28 [ -d $$krespath ] || $(MKDIR) $$krespath; \
29 [ -d $$kincpath ] || $(MKDIR) $$kincpath; \
30 cd $(SRCROOT)/EXTERNAL_HEADERS; \
31 install $(FILE_INSTALL_FLAGS) Info.plist $$krespath; \
32 $(NEWVERS) $${krespath}/Info.plist; \
33 cd $$kframepath/Versions; \
34 [ -L Current ] || $(LN) $(KINCVERS) Current; \
36 [ -L Headers ] || $(LN) Versions/Current/Headers Headers; \
37 [ -L Resources ] || $(LN) Versions/Current/Resources Resources; \
38 [ -d $(DSTROOT)/$(KPINCDIR) ] || $(MKDIR) $(DSTROOT)/$(KPINCDIR); \
39 cd $$kframepath; [ -L PrivateHeaders ] || \
40 $(LN) Versions/Current/PrivateHeaders PrivateHeaders;
41 ifeq ($(RC_ProjectName),xnu_headers_Sim)
42 @echo "[ $(SRCROOT) ] make installhdrs installing System.framework"
43 $(_v)spincpath=$(DSTROOT)/$(SPINCDIR); \
44 sframepath=$(DSTROOT)/$(SINCFRAME); \
45 [ -d $$spincpath ] || $(MKDIR) $$spincpath; \
46 cd $$sframepath/Versions; \
47 [ -L Current ] || $(LN) $(SINCVERS) Current; \
48 cd $$sframepath; [ -L PrivateHeaders ] || \
49 $(LN) Versions/Current/PrivateHeaders PrivateHeaders;
51 ifeq (iPhoneOS,$(PLATFORM))
52 $(_v)$(IPHONEOS_OPTIMIZE) $(DSTROOT)/$(KRESDIR)/Info.plist
57 # Install header files order
59 .ORDER: installhdrs_mi installhdrs_md
60 .PHONY: installhdrs_mi installhdrs_md
63 # Install machine independent header files
66 $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
67 kernel_config=$(INSTALL_TYPE); \
68 machine_config=$(MACHINE_CONFIG); \
69 arch_config=$(INSTALL_ARCH_DEFAULT); \
70 if [ $${arch_config} = ARM ] ; then \
71 if [ $${machine_config} = DEFAULT ] ; then \
72 machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
75 if [ $${machine_config} = DEFAULT ] ; then \
76 installinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
78 installinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/$${rel_path}; \
80 [ -d $${installinc_dir} ] || $(MKDIR) $${installinc_dir}; \
81 ${MAKE} ${MAKEJOBS} -C $${installinc_dir} \
82 KERNEL_CONFIG=$${kernel_config} \
83 ARCH_CONFIG=$${arch_config} \
84 MAKEFILES=${SOURCE}/Makefile \
86 TARGET=$${installinc_dir}/ \
87 build_installhdrs_mi; \
90 # Install machine dependent kernel header files
93 $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
94 kernel_config=$(INSTALL_TYPE); \
95 machine_config=$(MACHINE_CONFIG); \
96 for arch_config in $(INSTALL_ARCHS); \
98 if [ $${arch_config} = ARM ] ; then \
99 if [ $${machine_config} = DEFAULT ] ; then \
100 machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
103 if [ $${machine_config} = DEFAULT ] ; then \
104 installinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
106 installinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/$${rel_path}; \
108 [ -d $${installinc_dir} ] || $(MKDIR) $${installinc_dir}; \
109 ${MAKE} ${MAKEJOBS} -C $${installinc_dir} \
110 KERNEL_CONFIG=$${kernel_config} \
111 ARCH_CONFIG=$${arch_config} \
112 MAKEFILES=${SOURCE}/Makefile \
114 TARGET=$${installinc_dir}/ \
115 build_installhdrs_md; \
119 # Install machine independent kernel header files
123 BUILD_INSTALLHDRS_MI_SUBDIRS_TARGETS = $(addprefix build_installhdrs_mi_,$(INSTINC_SUBDIRS))
125 .PHONY: $(BUILD_INSTALLHDRS_MI_SUBDIRS_TARGETS)
127 $(BUILD_INSTALLHDRS_MI_SUBDIRS_TARGETS):
128 $(_v)installinc_subdir="$(patsubst build_installhdrs_mi_%,%,$@)"; \
129 [ -d $${installinc_subdir} ] || $(MKDIR) $${installinc_subdir}; \
130 ${MAKE} -C $${installinc_subdir} \
131 MAKEFILES=$(SOURCE)$${installinc_subdir}/Makefile \
132 SOURCE=$(SOURCE)$${installinc_subdir}/ \
133 TARGET=$(TARGET)$${installinc_subdir}/ \
134 build_installhdrs_mi;
136 build_installhdrs_mi: $(BUILD_INSTALLHDRS_MI_SUBDIRS_TARGETS)
137 $(_v)${MAKE} do_installhdrs_mi;
140 # Install machine dependent kernel header files
144 BUILD_INSTALLHDRS_MD_SUBDIRS_TARGETS = $(addprefix build_installhdrs_md_,$($(addprefix INSTINC_SUBDIRS_, $(ARCH_CONFIG))))
146 .PHONY: $(BUILD_INSTALLHDRS_MD_SUBDIRS_TARGETS)
148 $(BUILD_INSTALLHDRS_MD_SUBDIRS_TARGETS):
149 $(_v)installinc_subdir="$(patsubst build_installhdrs_md_%,%,$@)"; \
150 [ -d $${installinc_subdir} ] || $(MKDIR) $${installinc_subdir}; \
151 ${MAKE} -C $${installinc_subdir} \
152 MAKEFILES=$(SOURCE)$${installinc_subdir}/Makefile \
153 SOURCE=$(SOURCE)$${installinc_subdir}/ \
154 TARGET=$(TARGET)$${installinc_subdir}/ \
155 build_installhdrs_md;
157 build_installhdrs_md: $(BUILD_INSTALLHDRS_MD_SUBDIRS_TARGETS)
158 $(_v)${MAKE} do_installhdrs_md;
161 # Install kernel header files
165 exporthdrs: exporthdrs_mi exporthdrs_md
168 # Install header files order
170 .ORDER: exporthdrs_mi exporthdrs_md
171 .PHONY: exporthdrs_mi exporthdrs_md
174 # Install machine independent header files
179 $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
180 kernel_config=$(INSTALL_TYPE); \
181 machine_config=$(MACHINE_CONFIG); \
182 arch_config=$(INSTALL_ARCH_DEFAULT); \
183 if [ $${arch_config} = ARM ] ; then \
184 if [ $${machine_config} = DEFAULT ] ; then \
185 machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
188 if [ $${machine_config} = DEFAULT ] ; then \
189 exportinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
191 exportinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/$${rel_path}; \
193 [ -d $${exportinc_dir} ] || $(MKDIR) $${exportinc_dir}; \
194 ${MAKE} ${MAKEJOBS} -C $${exportinc_dir} \
195 KERNEL_CONFIG=$${kernel_config} \
196 ARCH_CONFIG=$${arch_config} \
197 MAKEFILES=${SOURCE}/Makefile \
199 TARGET=$${exportinc_dir}/ \
200 build_exporthdrs_mi; \
203 # Install machine dependent kernel header files
205 # Note - installation of machine dependent kernel header files only occurs for architecture
206 # defined in INSTALL_TYPE. We use skipit variable to skip over architectures that are not
207 # equal to what is in the INSTALL_TYPE variable.
208 # TARGET_CONFIGS_UC variable holds sets of three configuration options. The first item in the
209 # set is the kernel configuration. The second item in the set is the architecture and the
210 # third item is the machine configuration. There may be multiple sets to build.
212 $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
214 for my_config in $(TARGET_CONFIGS_UC); \
216 if [ $${my_counter} -eq 1 ] ; then \
219 kernel_config=$${my_config}; \
220 if [ $${kernel_config} = DEFAULT ] ; then \
221 kernel_config=$(DEFAULT_KERNEL_CONFIG); \
223 if [ $${kernel_config} != $(INSTALL_TYPE) ] ; then \
226 elif [ $${my_counter} -eq 2 ] ; then \
228 arch_config=$${my_config}; \
229 if [ $${arch_config} = DEFAULT ] ; then \
230 arch_config=`arch | $(TR) a-z A-Z`; \
234 machine_config=$${my_config}; \
235 if [ $${skipit} -eq 0 ] ; then \
236 if [ $${arch_config} = ARM ] ; then \
237 if [ $${machine_config} = DEFAULT ] ; then \
238 machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
241 if [ $${machine_config} = DEFAULT ] ; then \
242 exportinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
244 exportinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/$${rel_path}; \
246 [ -d $${exportinc_dir} ] || $(MKDIR) $${exportinc_dir}; \
247 ${MAKE} ${MAKEJOBS} -C $${exportinc_dir} \
248 KERNEL_CONFIG=$${kernel_config} \
249 ARCH_CONFIG=$${arch_config} \
250 MAKEFILES=${SOURCE}/Makefile \
252 TARGET=$${exportinc_dir}/ \
253 build_exporthdrs_md; \
259 # Install machine independent kernel header files
263 BUILD_EXPORTHDRS_MI_SUBDIRS_TARGETS = $(addprefix build_exporthdrs_mi_,$(EXPINC_SUBDIRS))
265 .PHONY: $(BUILD_EXPORTHDRS_MI_SUBDIRS_TARGETS)
267 $(BUILD_EXPORTHDRS_MI_SUBDIRS_TARGETS):
268 $(_v)exportinc_subdir="$(patsubst build_exporthdrs_mi_%,%,$@)"; \
269 [ -d $${exportinc_subdir} ] || $(MKDIR) $${exportinc_subdir}; \
270 ${MAKE} -C $${exportinc_subdir} \
271 MAKEFILES=$(SOURCE)$${exportinc_subdir}/Makefile \
272 SOURCE=$(SOURCE)$${exportinc_subdir}/ \
273 TARGET=$(TARGET)$${exportinc_subdir}/ \
276 build_exporthdrs_mi: $(BUILD_EXPORTHDRS_MI_SUBDIRS_TARGETS)
277 $(_v)${MAKE} do_exporthdrs_mi;
280 # Install machine dependent kernel header files
284 BUILD_EXPORTHDRS_MD_SUBDIRS_TARGETS = $(addprefix build_exporthdrs_md_,$($(addprefix EXPINC_SUBDIRS_, $(ARCH_CONFIG))))
286 .PHONY: $(BUILD_EXPORTHDRS_MD_SUBDIRS_TARGETS)
288 $(BUILD_EXPORTHDRS_MD_SUBDIRS_TARGETS):
289 $(_v)exportinc_subdir="$(patsubst build_exporthdrs_md_%,%,$@)"; \
290 [ -d $${exportinc_subdir} ] || $(MKDIR) $${exportinc_subdir}; \
291 ${MAKE} -C $${exportinc_subdir} \
292 MAKEFILES=$(SOURCE)$${exportinc_subdir}/Makefile \
293 SOURCE=$(SOURCE)$${exportinc_subdir}/ \
294 TARGET=$(TARGET)$${exportinc_subdir}/ \
297 build_exporthdrs_md: $(BUILD_EXPORTHDRS_MD_SUBDIRS_TARGETS)
298 $(_v)${MAKE} do_exporthdrs_md;
301 # Setup pass for all architectures for all Configuration/Architecture options
306 $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
307 kernel_config=$(INSTALL_TYPE); \
308 arch_config=$(INSTALL_ARCH_DEFAULT); \
309 setup_subdir=${OBJROOT}/$${rel_path}; \
310 [ -d $${setup_subdir} ] || $(MKDIR) $${setup_subdir}; \
311 ${MAKE} ${MAKEJOBS} -C $${setup_subdir} \
312 KERNEL_CONFIG=$${kernel_config} \
313 ARCH_CONFIG=$${arch_config} \
314 MAKEFILES=${SOURCE}/Makefile \
316 TARGET=$${setup_subdir}/ \
321 BUILD_SETUP_SUBDIRS_TARGETS = $(addprefix build_setup_,$(SETUP_SUBDIRS) $($(addprefix SETUP_SUBDIRS_, $(ARCH_CONFIG))))
323 .PHONY: $(BUILD_SETUP_SUBDIRS_TARGETS)
325 $(BUILD_SETUP_SUBDIRS_TARGETS):
326 $(_v)setup_subdir="$(patsubst build_setup_%,%,$@)"; \
327 [ -d $${setup_subdir} ] || $(MKDIR) $${setup_subdir}; \
328 ${MAKE} -C $${setup_subdir} \
329 MAKEFILES=${SOURCE}/$${setup_subdir}/Makefile \
330 SOURCE=${SOURCE}/$${setup_subdir}/ \
331 TARGET=${TARGET}/$${setup_subdir}/ \
334 build_setup: $(BUILD_SETUP_SUBDIRS_TARGETS)
335 $(_v)${MAKE} do_build_setup;
339 # Build all architectures for all Configuration/Architecture options
341 # Note - TARGET_CONFIGS_UC variable holds sets of three configuration options. The first
342 # item in the set is the kernel configuration. The second item in the set is the architecture
343 # and the third item is the machine configuration. There may be multiple sets to build.
347 ifeq ($(RC_ProjectName),Libsyscall)
351 if [ $${sdk} = / ] ; then \
354 xcrun -sdk "$(SDKROOT)" xcodebuild install \
355 "SRCROOT=$(SRCROOT)/libsyscall" \
356 "OBJROOT=$(OBJROOT)" \
357 "SYMROOT=$(SYMROOT)" \
358 "DSTROOT=$(DSTROOT)" \
360 else ifeq ($(RC_ProjectName),libkxld)
362 make -C libkern/kxld/ install
363 else ifeq ($(RC_ProjectName),libkxld_host)
365 make -C libkern/kxld/ install PRODUCT_TYPE=ARCHIVE
366 else ifeq ($(RC_ProjectName),xnu_headers_Sim)
368 else # xnu or xnu_debug
369 ifeq ($(COMPONENT), .)
370 all: exporthdrs setup
375 for my_config in $(TARGET_CONFIGS_UC); \
377 if [ $${my_counter} -eq 1 ] ; then \
379 kernel_config=$${my_config}; \
380 if [ $${kernel_config} = DEFAULT ] ; then \
381 kernel_config=$(DEFAULT_KERNEL_CONFIG); \
383 elif [ $${my_counter} -eq 2 ] ; then \
385 arch_config=$${my_config}; \
386 if [ $${arch_config} = DEFAULT ] ; then \
387 arch_config=`arch | $(TR) a-z A-Z`; \
391 machine_config=$${my_config}; \
392 if [ $${arch_config} = ARM ] ; then \
393 if [ $${machine_config} = DEFAULT ] ; then \
394 machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
397 if [ $${machine_config} = DEFAULT ] ; then \
398 build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
400 build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/$${rel_path}; \
402 [ -d $${build_subdir} ] || $(MKDIR) $${build_subdir}; \
403 ${MAKE} ${MAKEJOBS} -C $${build_subdir} \
404 KERNEL_CONFIG=$${kernel_config} \
405 ARCH_CONFIG=$${arch_config} \
406 MACHINE_CONFIG=$${machine_config} \
407 MAKEFILES=${SOURCE}/Makefile \
415 # Build all architectures for all Configuration/Architecture options
419 BUILD_ALL_SUBDIRS_TARGETS = $(addprefix build_all_,$(COMP_SUBDIRS) $($(addprefix COMP_SUBDIRS_, $(ARCH_CONFIG))))
421 .PHONY: $(BUILD_ALL_SUBDIRS_TARGETS)
423 $(BUILD_ALL_SUBDIRS_TARGETS):
424 $(_v)if [ $(MACHINE_CONFIG) = DEFAULT ] ; then \
425 TARGET=$(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)/$(COMPONENT); \
427 TARGET="$(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)_$(MACHINE_CONFIG)/$(COMPONENT)"; \
429 comp_subdir="$(patsubst build_all_%,%,$@)"; \
430 [ -d $${comp_subdir} ] || $(MKDIR) $${comp_subdir}; \
431 ${MAKE} -C $${comp_subdir} \
432 MAKEFILES=${SOURCE}/$${comp_subdir}/Makefile \
433 SOURCE=${SOURCE}$${comp_subdir}/ \
437 build_all: $(BUILD_ALL_SUBDIRS_TARGETS)
438 $(_v)if [ $(MACHINE_CONFIG) = DEFAULT ] ; then \
439 TARGET=$(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)/$(COMPONENT); \
441 TARGET="$(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)_$(MACHINE_CONFIG)/$(COMPONENT)"; \
443 ${MAKE} INCL_MAKEDEP=TRUE TARGET=$${TARGET} do_build_all; \
444 _TMP_comp_subdir="$(CONFIG_SUBDIRS) $($(addprefix CONFIG_SUBDIRS_, $(ARCH_CONFIG)))"; \
445 for comp_subdir in $${_TMP_comp_subdir}; \
447 [ -d $${comp_subdir} ] || $(MKDIR) $${comp_subdir}; \
448 ${MAKE} -C $${comp_subdir} \
449 MAKEFILES=${SOURCE}/$${comp_subdir}/Makefile \
450 SOURCE=${SOURCE}$${comp_subdir}/ \
457 # Build all architectures for all Configuration/Architecture options
459 # Note - TARGET_CONFIGS_UC variable holds sets of three configuration options. The first
460 # item in the set is the kernel configuration. The second item is the architecture
461 # and the third item is the machine configuration. There may be multiple sets to build.
465 for my_config in $(TARGET_CONFIGS_UC); \
467 if [ $${my_counter} -eq 1 ] ; then \
469 kernel_config=$${my_config}; \
470 if [ $${kernel_config} = DEFAULT ] ; then \
471 kernel_config=$(DEFAULT_KERNEL_CONFIG); \
473 elif [ $${my_counter} -eq 2 ] ; then \
475 arch_config=$${my_config}; \
476 if [ $${arch_config} = DEFAULT ] ; then \
477 arch_config=`arch | $(TR) a-z A-Z`; \
481 machine_config=$${my_config}; \
482 if [ $${arch_config} = ARM ] ; then \
483 if [ $${machine_config} = DEFAULT ] ; then \
484 machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
487 if [ $${machine_config} = DEFAULT ] ; then \
488 build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}; \
490 build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}; \
492 [ -d $${build_subdir} ] || $(MKDIR) $${build_subdir}; \
493 ${MAKE} ${MAKEJOBS} -C $${build_subdir} \
494 KERNEL_CONFIG=$${kernel_config} \
495 ARCH_CONFIG=$${arch_config} \
496 MACHINE_CONFIG=$${machine_config} \
497 MAKEFILES=${SOURCE}/Makefile \
499 TARGET=$${build_subdir}/ \
505 # Build all architectures for all Configuration/Architecture options
507 do_build_mach_kernel:
510 $(_v)${MAKE} do_build_mach_kernel;
515 # Install dependencies order
517 .ORDER: installhdrs exporthdrs all
520 # Install kernel based on RC_ARCHS for all INSTALL_TYPES
521 # Install kernel header files based on RC_ARCHS
523 install: installhdrs all installman installmachinekernels
524 ifeq ($(RC_ProjectName),Libsyscall)
526 else ifeq ($(findstring libkxld,$(RC_ProjectName)),libkxld)
527 # nothing to do, work performed in "all" action
528 else ifeq ($(RC_ProjectName),xnu_headers_Sim)
530 else # xnu or xnu_debug
531 $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
532 machine_config=$(MACHINE_CONFIG); \
533 for kernel_config in $(INSTALL_TYPE); \
535 for arch_config in $(INSTALL_ARCHS); \
537 if [ $${arch_config} = ARM ] ; then \
538 if [ $${machine_config} = DEFAULT ] ; then \
539 machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
542 if [ $${machine_config} = DEFAULT ] ; then \
543 install_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
545 install_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/$${rel_path}; \
547 [ -d $${install_subdir} ] || $(MKDIR) $${install_subdir}; \
548 ${MAKE} ${MAKEJOBS} -C $${install_subdir} \
549 KERNEL_CONFIG=$${kernel_config} \
550 ARCH_CONFIG=$${arch_config} \
551 MACHINE_CONFIG=$${machine_config} \
552 MAKEFILES=${SOURCE}/Makefile \
557 ifeq ($(RC_ProjectName),xnu_debug)
558 $(_v)$(MKDIR) $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)
559 $(_v)$(MV) $(DSTROOT)/mach_kernel* $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)
560 $(_v)$(CP) $(SYMROOT)/kgmacros $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)
561 $(_v)$(CP) -r $(SYMROOT)/System.kext $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)
562 $(_v)$(CP) -r $(SYMROOT)/mach_kernel.dSYM $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)
563 $(_v)$(CP) $(SRCROOT)/config/README.DEBUG-kernel.txt $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)
564 $(_v)$(MV) $(DSTROOT)/System $(DSTROOT)/usr $(OBJROOT)/
568 installmachinekernels:
569 @echo "[ $(SOURCE) ] make installmachinekernels"; \
571 for my_config in $(TARGET_CONFIGS_UC); \
573 if [ $${my_counter} -eq 1 ] ; then \
575 kernel_config=$${my_config}; \
576 if [ $${kernel_config} = DEFAULT ] ; then \
577 kernel_config=$(DEFAULT_KERNEL_CONFIG); \
579 elif [ $${my_counter} -eq 2 ] ; then \
581 arch_config=$${my_config}; \
582 if [ $${arch_config} = DEFAULT ] ; then \
583 arch_config=`arch | $(TR) a-z A-Z`; \
587 machine_config=$${my_config}; \
588 if [ $${machine_config} != DEFAULT ] ; then \
589 build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}; \
590 install_kernel_file=mach.`printf "%s" "$${kernel_config}" | $(TR) A-Z a-z`.`printf "%s" "$${machine_config}" | $(TR) A-Z a-z`; \
591 [ -d $${build_subdir} ] || $(MKDIR) $${build_subdir}; \
592 ${MAKE} ${MAKEJOBS} -C $${build_subdir} \
593 INSTALL_KERNEL_FILE=$${install_kernel_file} \
594 KERNEL_CONFIG=$${kernel_config} \
595 ARCH_CONFIG=$${arch_config} \
596 MACHINE_CONFIG=$${machine_config} \
597 MAKEFILES=${SOURCE}/Makefile \
599 TARGET=$${build_subdir}/ \
606 # Install for all architectures for all Configuration/Architecture options
612 BUILD_INSTALL_SUBDIRS_TARGETS = $(addprefix build_install_,$(INST_SUBDIRS))
614 .PHONY: $(BUILD_INSTALL_SUBDIRS_TARGETS)
616 $(BUILD_INSTALL_SUBDIRS_TARGETS):
617 $(_v)if [ $(MACHINE_CONFIG) = DEFAULT ] ; then \
618 TARGET=${OBJROOT}/$(KERNEL_CONFIG)_$(ARCH_CONFIG)/$(COMPONENT); \
620 TARGET="$(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)_$(MACHINE_CONFIG)/$(COMPONENT)"; \
622 ${MAKE} TARGET=$${TARGET} setup_build_install; \
623 kernel_config=$(KERNEL_CONFIG); \
624 install_subdir="$(patsubst build_install_%,%,$@)"; \
625 [ -d $${install_subdir} ] || $(MKDIR) $${install_subdir}; \
626 ${MAKE} -C $${install_subdir} \
627 KERNEL_CONFIG=$${kernel_config} \
628 MAKEFILES=${SOURCE}/$${install_subdir}/Makefile \
629 SOURCE=${SOURCE}$${install_subdir}/ \
633 build_install: $(BUILD_INSTALL_SUBDIRS_TARGETS)
634 $(_v)if [ $(MACHINE_CONFIG) = DEFAULT ] ; then \
635 TARGET=${OBJROOT}/$(KERNEL_CONFIG)_$(ARCH_CONFIG)/$(COMPONENT); \
637 TARGET="$(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)_$(MACHINE_CONFIG)/$(COMPONENT)"; \
639 ${MAKE} TARGET=$${TARGET} do_build_install;
643 # Install source tree
648 $(_v)($(TAR) -c --mode go=r,+X --no-ignore-case --exclude .svn --exclude .git --exclude cscope.\* --exclude BUILD --exclude \*~ -f - .) | (cd $(SRCROOT) && $(TAR) --no-same-owner -xf -)
652 # Clean up source tree
659 # Build source file list for cscope database and tags
662 @echo "Building file list for cscope and tags"
663 @find . -name '*.h' -type f | grep -v ^..BUILD > _cscope.files 2> /dev/null
664 @find . -name '*.defs' -type f | grep -v ^..BUILD >> _cscope.files 2> /dev/null
665 @find . -name '*.c' -type f | grep -v ^..BUILD >> _cscope.files 2> /dev/null
666 @find . -name '*.cpp' -type f | grep -v ^..BUILD >> _cscope.files 2> /dev/null
667 @find . -name '*.s' -type f | grep -v ^..BUILD >> _cscope.files 2> /dev/null
668 @find . -name '*.h.template' -type f | grep -v ^..BUILD >> _cscope.files 2> /dev/null
669 @echo -k -q -c > cscope.files 2> /dev/null
670 @sort -u < _cscope.files >> cscope.files 2> /dev/null
671 @rm -f _cscope.files _cscope.files2 2> /dev/null
674 # Build cscope database
677 @echo "Building cscope database"
678 @cscope -bvU 2> /dev/null
685 @echo "Building ctags"
686 @-sed 1d cscope.files | xargs ctags -dtw 2> /dev/null || \
687 echo "Phantom files detected!" 2>&1 > /dev/null
688 @-[ -f TAGS ] || ${MAKE} TAGS
691 @echo "Building etags"
692 @-cat cscope.files | etags -l auto -S - 2> /dev/null
700 ifeq ($(RC_ProjectName),Libsyscall)
702 else ifeq ($(findstring libkxld,$(RC_ProjectName)),libkxld)
704 else ifeq ($(findstring xnu_,$(RC_ProjectName)),xnu_)
708 @echo "[ $(SRCROOT) ] Installing man pages"
709 $(_v)manpath=$(DSTROOT)/$(MANDIR); \
710 [ -d $$manpath ] || $(MKDIR) $$manpath; \
711 ${MAKE} ${MAKEJOBS} MAKEFILES=${SOURCE}/Makefile \
715 ${SRCROOT}/config/compress-man-pages.pl ${DSTROOT}/${MANDIR}
720 BUILD_INSTALLMAN_SUBDIRS_TARGETS = $(addprefix build_installman_,$(INSTMAN_SUBDIRS))
722 .PHONY: $(BUILD_INSTALLMAN_SUBDIRS_TARGETS)
724 $(BUILD_INSTALLMAN_SUBDIRS_TARGETS):
725 $(_v)installman_subdir="$(patsubst build_installman_%,%,$@)"; \
726 ${MAKE} -C $${installman_subdir} -r \
727 MAKEFILES=$(SOURCE)$${installman_subdir}/Makefile \
728 SOURCE=$(SOURCE)$${installman_subdir}/ \
729 TARGET=$(TARGET)$${installman_subdir}/ \
732 build_installman: $(BUILD_INSTALLMAN_SUBDIRS_TARGETS)
733 $(_v)if [ -n "$(strip $(INSTALL_MAN_LIST))" ]; then \
734 ${MAKE} do_installman; \