2 # Install kernel header files
4 ifeq ($(RC_ProjectName),Libsyscall)
6 bsdmake -C libsyscall installhdrs
7 else ifeq ($(findstring libkxld,$(RC_ProjectName)),libkxld)
9 make -C libkern/kxld/ installhdrs
10 else ifeq ($(RC_ProjectName),xnu_debug)
13 installhdrs: exporthdrs installhdrs_mi installhdrs_md
14 @echo "[ $(SRCROOT) ] make installhdrs installing Kernel.framework"
15 $(_v)kincpath=$(DSTROOT)/$(KINCDIR); \
16 krespath=$(DSTROOT)/$(KRESDIR); \
17 kframepath=$(DSTROOT)/$(KINCFRAME); \
18 [ -d $$krespath ] || $(MKDIR) $$krespath; \
19 [ -d $$kincpath ] || $(MKDIR) $$kincpath; \
20 cd $(SRCROOT)/EXTERNAL_HEADERS; \
21 install $(FILE_INSTALL_FLAGS) Info.plist $$krespath; \
22 $(NEWVERS) $${krespath}/Info.plist; \
23 cd $$kframepath/Versions; \
24 [ -L Current ] || $(LN) $(KINCVERS) Current; \
26 [ -L Headers ] || $(LN) Versions/Current/Headers Headers; \
27 [ -L Resources ] || $(LN) Versions/Current/Resources Resources; \
28 [ -d $(DSTROOT)/$(KPINCDIR) ] || $(MKDIR) $(DSTROOT)/$(KPINCDIR); \
29 cd $$kframepath; [ -L PrivateHeaders ] || \
30 $(LN) Versions/Current/PrivateHeaders PrivateHeaders;
34 # Install header files order
36 .ORDER: installhdrs_mi installhdrs_md
39 # Install machine independent header files
42 $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
43 kernel_config=$(INSTALL_TYPE); \
44 arch_config=$(INSTALL_ARCH_DEFAULT); \
45 installinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
46 [ -d $${installinc_dir} ] ||$(MKDIR) $${installinc_dir}; \
47 ${MAKE} ${MAKEJOBS} -C $${installinc_dir} \
48 KERNEL_CONFIG=$${kernel_config} \
49 ARCH_CONFIG=$${arch_config} \
50 MAKEFILES=${SOURCE}/Makefile \
52 TARGET=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}/ \
53 build_installhdrs_mi; \
56 # Install machine dependent kernel header files
59 $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
60 kernel_config=$(INSTALL_TYPE); \
61 machine_config=$(MACHINE_CONFIG); \
62 for arch_config in $(INSTALL_ARCHS); \
64 if [ $${arch_config} = ARM ] ; then \
65 if [ $${machine_config} = DEFAULT ] ; then \
66 machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
69 if [ $${machine_config} = DEFAULT ] ; then \
70 objpath=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
72 objpath=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/$${rel_path}; \
74 [ -d $${objpath} ] || $(MKDIR) $${objpath}; \
75 ${MAKE} ${MAKEJOBS} -C $${objpath} \
76 KERNEL_CONFIG=$${kernel_config} \
77 ARCH_CONFIG=$${arch_config} \
78 MAKEFILES=${SOURCE}/Makefile \
81 build_installhdrs_md; \
85 # Install machine independent kernel header files
89 BUILD_INSTALLHDRS_MI_SUBDIRS_TARGETS = $(addprefix build_installhdrs_mi_,$(INSTINC_SUBDIRS))
91 .PHONY: $(BUILD_INSTALLHDRS_MI_SUBDIRS_TARGETS)
93 $(BUILD_INSTALLHDRS_MI_SUBDIRS_TARGETS):
94 $(_v)installinc_subdir="$(patsubst build_installhdrs_mi_%,%,$@)"; \
95 [ -d $${installinc_subdir} ] || $(MKDIR) $${installinc_subdir}; \
96 ${MAKE} -C $${installinc_subdir} \
97 MAKEFILES=$(SOURCE)$${installinc_subdir}/Makefile \
98 SOURCE=$(SOURCE)$${installinc_subdir}/ \
99 TARGET=$(TARGET)$${installinc_subdir}/ \
100 build_installhdrs_mi;
102 build_installhdrs_mi: $(BUILD_INSTALLHDRS_MI_SUBDIRS_TARGETS)
103 $(_v)${MAKE} do_installhdrs_mi;
106 # Install machine dependent kernel header files
110 BUILD_INSTALLHDRS_MD_SUBDIRS_TARGETS = $(addprefix build_installhdrs_md_,$($(addprefix INSTINC_SUBDIRS_, $(ARCH_CONFIG))))
112 .PHONY: $(BUILD_INSTALLHDRS_MD_SUBDIRS_TARGETS)
114 $(BUILD_INSTALLHDRS_MD_SUBDIRS_TARGETS):
115 $(_v)installinc_subdir="$(patsubst build_installhdrs_md_%,%,$@)"; \
116 [ -d $${installinc_subdir} ] || $(MKDIR) $${installinc_subdir}; \
117 ${MAKE} -C $${installinc_subdir} \
118 MAKEFILES=$(SOURCE)$${installinc_subdir}/Makefile \
119 SOURCE=$(SOURCE)$${installinc_subdir}/ \
120 TARGET=$(TARGET)$${installinc_subdir}/ \
121 build_installhdrs_md;
123 build_installhdrs_md: $(BUILD_INSTALLHDRS_MD_SUBDIRS_TARGETS)
124 $(_v)${MAKE} do_installhdrs_md;
127 # Install kernel header files
129 exporthdrs: exporthdrs_mi exporthdrs_md
132 # Install header files order
134 .ORDER: exporthdrs_mi exporthdrs_md
137 # Install machine independent header files
142 $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
143 kernel_config=$(INSTALL_TYPE); \
144 arch_config=$(INSTALL_ARCH_DEFAULT); \
145 exportinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
146 [ -d $${exportinc_dir} ] || $(MKDIR) $${exportinc_dir}; \
147 ${MAKE} ${MAKEJOBS} -C $${exportinc_dir} \
148 KERNEL_CONFIG=$${kernel_config} \
149 ARCH_CONFIG=$${arch_config} \
150 MAKEFILES=${SOURCE}/Makefile \
152 TARGET=$${exportinc_dir}/ \
153 build_exporthdrs_mi; \
156 # Install machine dependent kernel header files
158 # Note - installation of machine dependent kernel header files only occurs for architecture
159 # defined in INSTALL_TYPE. We use skipit variable to skip over architectures that are not
160 # equal to what is in the INSTALL_TYPE variable.
161 # TARGET_CONFIGS_UC variable holds sets of three configuration options. The first item in the
162 # set is the kernel configuration. The second item in the set is the architecture and the
163 # third item is the machine configuration. There may be multiple sets to build.
165 $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
167 for my_config in $(TARGET_CONFIGS_UC); \
169 if [ $${my_counter} -eq 1 ] ; then \
172 kernel_config=$${my_config}; \
173 if [ $${kernel_config} = DEFAULT ] ; then \
174 kernel_config=$(DEFAULT_KERNEL_CONFIG); \
176 if [ $${kernel_config} != $(INSTALL_TYPE) ] ; then \
179 elif [ $${my_counter} -eq 2 ] ; then \
181 arch_config=$${my_config}; \
182 if [ $${arch_config} = DEFAULT ] ; then \
183 arch_config=`arch | $(TR) a-z A-Z`; \
187 machine_config=$${my_config}; \
188 if [ $${skipit} -eq 0 ] ; then \
189 if [ $${arch_config} = ARM ] ; then \
190 if [ $${machine_config} = DEFAULT ] ; then \
191 machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
194 if [ $${machine_config} = DEFAULT ] ; then \
195 exportinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
197 exportinc_dir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/$${rel_path}; \
199 [ -d $${exportinc_dir} ] || $(MKDIR) $${exportinc_dir}; \
200 ${MAKE} ${MAKEJOBS} -C $${exportinc_dir} \
201 KERNEL_CONFIG=$${kernel_config} \
202 ARCH_CONFIG=$${arch_config} \
203 MAKEFILES=${SOURCE}/Makefile \
205 TARGET=$${exportinc_dir}/ \
206 build_exporthdrs_md; \
212 # Install machine independent kernel header files
216 BUILD_EXPORTHDRS_MI_SUBDIRS_TARGETS = $(addprefix build_exporthdrs_mi_,$(EXPINC_SUBDIRS))
218 .PHONY: $(BUILD_EXPORTHDRS_MI_SUBDIRS_TARGETS)
220 $(BUILD_EXPORTHDRS_MI_SUBDIRS_TARGETS):
221 $(_v)exportinc_subdir="$(patsubst build_exporthdrs_mi_%,%,$@)"; \
222 [ -d $${exportinc_subdir} ] || $(MKDIR) $${exportinc_subdir}; \
223 ${MAKE} -C $${exportinc_subdir} \
224 MAKEFILES=$(SOURCE)$${exportinc_subdir}/Makefile \
225 SOURCE=$(SOURCE)$${exportinc_subdir}/ \
226 TARGET=$(TARGET)$${exportinc_subdir}/ \
229 build_exporthdrs_mi: $(BUILD_EXPORTHDRS_MI_SUBDIRS_TARGETS)
230 $(_v)${MAKE} do_exporthdrs_mi;
233 # Install machine dependent kernel header files
237 BUILD_EXPORTHDRS_MD_SUBDIRS_TARGETS = $(addprefix build_exporthdrs_md_,$($(addprefix EXPINC_SUBDIRS_, $(ARCH_CONFIG))))
239 .PHONY: $(BUILD_EXPORTHDRS_MD_SUBDIRS_TARGETS)
241 $(BUILD_EXPORTHDRS_MD_SUBDIRS_TARGETS):
242 $(_v)exportinc_subdir="$(patsubst build_exporthdrs_md_%,%,$@)"; \
243 [ -d $${exportinc_subdir} ] || $(MKDIR) $${exportinc_subdir}; \
244 ${MAKE} -C $${exportinc_subdir} \
245 MAKEFILES=$(SOURCE)$${exportinc_subdir}/Makefile \
246 SOURCE=$(SOURCE)$${exportinc_subdir}/ \
247 TARGET=$(TARGET)$${exportinc_subdir}/ \
250 build_exporthdrs_md: $(BUILD_EXPORTHDRS_MD_SUBDIRS_TARGETS)
251 $(_v)${MAKE} do_exporthdrs_md;
254 # Setup pass for all architectures for all Configuration/Architecture options
257 $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
258 for kernel_config in $(KERNEL_CONFIGS); \
260 for arch_config in $(ARCH_CONFIGS); \
262 setup_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
263 [ -d $${setup_subdir} ] || $(MKDIR) $${setup_subdir}; \
264 ${MAKE} -C $${setup_subdir} \
265 KERNEL_CONFIG=$${kernel_config} \
266 ARCH_CONFIG=$${arch_config} \
267 MAKEFILES=${SOURCE}/Makefile \
269 TARGET=$${setup_subdir}/ \
276 BUILD_SETUP_SUBDIRS_TARGETS = $(addprefix build_setup_,$(SETUP_SUBDIRS) $($(addprefix SETUP_SUBDIRS_, $(ARCH_CONFIG))))
278 .PHONY: $(BUILD_SETUP_SUBDIRS_TARGETS)
280 $(BUILD_SETUP_SUBDIRS_TARGETS):
281 $(_v)setup_subdir="$(patsubst build_setup_%,%,$@)"; \
282 [ -d $${setup_subdir} ] || $(MKDIR) $${setup_subdir}; \
283 ${MAKE} -C $${setup_subdir} \
284 MAKEFILES=${SOURCE}/$${setup_subdir}/Makefile \
285 SOURCE=${SOURCE}/$${setup_subdir}/ \
286 TARGET=${TARGET}/$${setup_subdir}/ \
289 build_setup: $(BUILD_SETUP_SUBDIRS_TARGETS)
290 $(_v)${MAKE} do_build_setup;
294 # Build all architectures for all Configuration/Architecture options
296 # Note - TARGET_CONFIGS_UC variable holds sets of three configuration options. The first
297 # item in the set is the kernel configuration. The second item in the set is the architecture
298 # and the third item is the machine configuration. There may be multiple sets to build.
300 ifeq ($(RC_ProjectName),Libsyscall)
302 bsdmake -C libsyscall install
303 else ifeq ($(findstring libkxld,$(RC_ProjectName)),libkxld)
305 make -C libkern/kxld/ install
306 else # xnu or xnu_debug
307 ifeq ($(COMPONENT), .)
313 for my_config in $(TARGET_CONFIGS_UC); \
315 if [ $${my_counter} -eq 1 ] ; then \
317 kernel_config=$${my_config}; \
318 if [ $${kernel_config} = DEFAULT ] ; then \
319 kernel_config=$(DEFAULT_KERNEL_CONFIG); \
321 elif [ $${my_counter} -eq 2 ] ; then \
323 arch_config=$${my_config}; \
324 if [ $${arch_config} = DEFAULT ] ; then \
325 arch_config=`arch | $(TR) a-z A-Z`; \
329 machine_config=$${my_config}; \
330 if [ $${arch_config} = ARM ] ; then \
331 if [ $${machine_config} = DEFAULT ] ; then \
332 machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
335 if [ $${machine_config} = DEFAULT ] ; then \
336 build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
338 build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/$${rel_path}; \
340 [ -d $${build_subdir} ] || $(MKDIR) $${build_subdir}; \
341 ${MAKE} ${MAKEJOBS} -C $${build_subdir} \
342 KERNEL_CONFIG=$${kernel_config} \
343 ARCH_CONFIG=$${arch_config} \
344 MACHINE_CONFIG=$${machine_config} \
345 MAKEFILES=${SOURCE}/Makefile \
353 # Build all architectures for all Configuration/Architecture options
357 BUILD_ALL_SUBDIRS_TARGETS = $(addprefix build_all_,$(COMP_SUBDIRS) $($(addprefix COMP_SUBDIRS_, $(ARCH_CONFIG))))
359 .PHONY: $(BUILD_ALL_SUBDIRS_TARGETS)
361 $(BUILD_ALL_SUBDIRS_TARGETS):
362 $(_v)if [ $(MACHINE_CONFIG) = DEFAULT ] ; then \
363 TARGET=$(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)/$(COMPONENT); \
365 TARGET="$(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)_$(MACHINE_CONFIG)/$(COMPONENT)"; \
367 comp_subdir="$(patsubst build_all_%,%,$@)"; \
368 [ -d $${comp_subdir} ] || $(MKDIR) $${comp_subdir}; \
369 ${MAKE} -C $${comp_subdir} \
370 MAKEFILES=${SOURCE}/$${comp_subdir}/Makefile \
371 SOURCE=${SOURCE}$${comp_subdir}/ \
375 build_all: $(BUILD_ALL_SUBDIRS_TARGETS)
376 $(_v)if [ $(MACHINE_CONFIG) = DEFAULT ] ; then \
377 TARGET=$(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)/$(COMPONENT); \
379 TARGET="$(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)_$(MACHINE_CONFIG)/$(COMPONENT)"; \
381 ${MAKE} INCL_MAKEDEP=TRUE TARGET=$${TARGET} do_build_all; \
382 _TMP_comp_subdir="$(CONFIG_SUBDIRS) $($(addprefix CONFIG_SUBDIRS_, $(ARCH_CONFIG)))"; \
383 for comp_subdir in $${_TMP_comp_subdir}; \
385 [ -d $${comp_subdir} ] || $(MKDIR) $${comp_subdir}; \
386 ${MAKE} -C $${comp_subdir} \
387 MAKEFILES=${SOURCE}/$${comp_subdir}/Makefile \
388 SOURCE=${SOURCE}$${comp_subdir}/ \
395 # Build all architectures for all Configuration/Architecture options
397 # Note - TARGET_CONFIGS_UC variable holds sets of three configuration options. The first
398 # item in the set is the kernel configuration. The second item is the architecture
399 # and the third item is the machine configuration. There may be multiple sets to build.
403 for my_config in $(TARGET_CONFIGS_UC); \
405 if [ $${my_counter} -eq 1 ] ; then \
407 kernel_config=$${my_config}; \
408 if [ $${kernel_config} = DEFAULT ] ; then \
409 kernel_config=$(DEFAULT_KERNEL_CONFIG); \
411 elif [ $${my_counter} -eq 2 ] ; then \
413 arch_config=$${my_config}; \
414 if [ $${arch_config} = DEFAULT ] ; then \
415 arch_config=`arch | $(TR) a-z A-Z`; \
419 machine_config=$${my_config}; \
420 if [ $${arch_config} = ARM ] ; then \
421 if [ $${machine_config} = DEFAULT ] ; then \
422 machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
425 if [ $${machine_config} = DEFAULT ] ; then \
426 build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}; \
428 build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}; \
430 [ -d $${build_subdir} ] || $(MKDIR) $${build_subdir}; \
431 ${MAKE} ${MAKEJOBS} -C $${build_subdir} \
432 KERNEL_CONFIG=$${kernel_config} \
433 ARCH_CONFIG=$${arch_config} \
434 MACHINE_CONFIG=$${machine_config} \
435 MAKEFILES=${SOURCE}/Makefile \
437 TARGET=$${build_subdir}/ \
443 # Build all architectures for all Configuration/Architecture options
445 do_build_mach_kernel:
448 $(_v)${MAKE} do_build_mach_kernel;
453 # Install dependencies order
455 .ORDER: installhdrs exporthdrs all
458 # Install kernel based on RC_ARCHS for all INSTALL_TYPES
459 # Install kernel header files based on RC_ARCHS
461 install: installhdrs all installman installmachinekernels
462 ifeq ($(RC_ProjectName),Libsyscall)
464 else ifeq ($(findstring libkxld,$(RC_ProjectName)),libkxld)
466 else # xnu or xnu_debug
467 $(_v)rel_path=$(shell $(RELPATH) $(SRCROOT) $(SOURCE)); \
468 machine_config=$(MACHINE_CONFIG); \
469 for kernel_config in $(INSTALL_TYPE); \
471 for arch_config in $(INSTALL_ARCHS); \
473 if [ $${arch_config} = ARM ] ; then \
474 if [ $${machine_config} = DEFAULT ] ; then \
475 machine_config=$(DEFAULT_ARM_MACHINE_CONFIG); \
478 if [ $${machine_config} = DEFAULT ] ; then \
479 install_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}/$${rel_path}; \
481 install_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}/$${rel_path}; \
483 [ -d $${install_subdir} ] || $(MKDIR) $${install_subdir}; \
484 ${MAKE} ${MAKEJOBS} -C $${install_subdir} \
485 KERNEL_CONFIG=$${kernel_config} \
486 ARCH_CONFIG=$${arch_config} \
487 MACHINE_CONFIG=$${machine_config} \
488 MAKEFILES=${SOURCE}/Makefile \
493 ifeq ($(RC_ProjectName),xnu_debug)
494 $(_v)$(MKDIR) $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)
495 $(_v)$(MV) $(DSTROOT)/mach_kernel* $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)
496 $(_v)$(CP) $(SYMROOT)/kgmacros $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)
497 $(_v)$(CP) -r $(SYMROOT)/System.kext $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)
498 $(_v)$(CP) -r $(SYMROOT)/mach_kernel.dSYM $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)
499 $(_v)$(CP) $(SRCROOT)/config/README.DEBUG-kernel.txt $(DSTROOT)/$(DEVELOPER_EXTRAS_DIR)
500 $(_v)$(MV) $(DSTROOT)/System $(DSTROOT)/usr $(OBJROOT)/
504 installmachinekernels:
505 @echo "[ $(SOURCE) ] make installmachinekernels"; \
507 for my_config in $(TARGET_CONFIGS_UC); \
509 if [ $${my_counter} -eq 1 ] ; then \
511 kernel_config=$${my_config}; \
512 if [ $${kernel_config} = DEFAULT ] ; then \
513 kernel_config=$(DEFAULT_KERNEL_CONFIG); \
515 elif [ $${my_counter} -eq 2 ] ; then \
517 arch_config=$${my_config}; \
518 if [ $${arch_config} = DEFAULT ] ; then \
519 arch_config=`arch | $(TR) a-z A-Z`; \
523 machine_config=$${my_config}; \
524 if [ $${machine_config} != DEFAULT ] ; then \
525 build_subdir=${OBJROOT}/$${kernel_config}_$${arch_config}_$${machine_config}; \
526 install_file_list=mach.`printf "%s" "$${kernel_config}" | $(TR) A-Z a-z`.`printf "%s" "$${machine_config}" | $(TR) A-Z a-z`; \
527 [ -d $${build_subdir} ] || $(MKDIR) $${build_subdir}; \
528 ${MAKE} ${MAKEJOBS} -C $${build_subdir} \
529 INSTALL_FILE_LIST=$${install_file_list} \
530 KERNEL_CONFIG=$${kernel_config} \
531 ARCH_CONFIG=$${arch_config} \
532 MACHINE_CONFIG=$${machine_config} \
533 MAKEFILES=${SOURCE}/Makefile \
535 TARGET=$${build_subdir}/ \
542 # Install for all architectures for all Configuration/Architecture options
548 BUILD_INSTALL_SUBDIRS_TARGETS = $(addprefix build_install_,$(INST_SUBDIRS))
550 .PHONY: $(BUILD_INSTALL_SUBDIRS_TARGETS)
552 $(BUILD_INSTALL_SUBDIRS_TARGETS):
553 $(_v)if [ $(MACHINE_CONFIG) = DEFAULT ] ; then \
554 TARGET=${OBJROOT}/$(KERNEL_CONFIG)_$(ARCH_CONFIG)/$(COMPONENT); \
556 TARGET="$(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)_$(MACHINE_CONFIG)/$(COMPONENT)"; \
558 ${MAKE} TARGET=$${TARGET} setup_build_install; \
559 kernel_config=$(KERNEL_CONFIG); \
560 install_subdir="$(patsubst build_install_%,%,$@)"; \
561 [ -d $${install_subdir} ] || $(MKDIR) $${install_subdir}; \
562 ${MAKE} -C $${install_subdir} \
563 KERNEL_CONFIG=$${kernel_config} \
564 MAKEFILES=${SOURCE}/$${install_subdir}/Makefile \
565 SOURCE=${SOURCE}$${install_subdir}/ \
569 build_install: $(BUILD_INSTALL_SUBDIRS_TARGETS)
570 $(_v)if [ $(MACHINE_CONFIG) = DEFAULT ] ; then \
571 TARGET=${OBJROOT}/$(KERNEL_CONFIG)_$(ARCH_CONFIG)/$(COMPONENT); \
573 TARGET="$(OBJROOT)/$(KERNEL_CONFIG)_$(ARCH_CONFIG)_$(MACHINE_CONFIG)/$(COMPONENT)"; \
575 ${MAKE} TARGET=$${TARGET} do_build_install;
579 # Install source tree
582 $(_v)($(TAR) -c --mode go=r,+X --no-ignore-case --exclude .svn --exclude cscope.\* --exclude BUILD --exclude \*~ -f - .) | (cd $(SRCROOT) && $(TAR) --no-same-owner -xf -)
586 # Clean up source tree
591 # Build source file list for cscope database and tags
594 @echo "Building file list for cscope and tags"
595 @find . -name '*.h' -type f | grep -v ^..BUILD > _cscope.files 2> /dev/null
596 @find . -name '*.defs' -type f | grep -v ^..BUILD >> _cscope.files 2> /dev/null
597 @find . -name '*.c' -type f | grep -v ^..BUILD >> _cscope.files 2> /dev/null
598 @find . -name '*.cpp' -type f | grep -v ^..BUILD >> _cscope.files 2> /dev/null
599 @find . -name '*.s' -type f | grep -v ^..BUILD >> _cscope.files 2> /dev/null
600 @find . -name '*.h.template' -type f | grep -v ^..BUILD >> _cscope.files 2> /dev/null
601 @echo -k -q -c > cscope.files 2> /dev/null
602 @sort -u < _cscope.files >> cscope.files 2> /dev/null
603 @rm -f _cscope.files _cscope.files2 2> /dev/null
606 # Build cscope database
609 @echo "Building cscope database"
610 @cscope -bvU 2> /dev/null
617 @echo "Building ctags"
618 @-sed 1d cscope.files | xargs ctags -dtw 2> /dev/null || \
619 echo "Phantom files detected!" 2>&1 > /dev/null
620 @-[ -f TAGS ] || ${MAKE} TAGS
623 @echo "Building etags"
624 @-cat cscope.files | etags -l auto -S - 2> /dev/null
630 ifeq ($(RC_ProjectName),Libsyscall)
631 bsdmake -C libsyscall install-man
632 else ifeq ($(findstring libkxld,$(RC_ProjectName)),libkxld)
634 else # xnu or xnu_debug
635 @echo "[ $(SRCROOT) ] Installing man pages"
636 $(_v)manpath=$(DSTROOT)/$(MANDIR); \
637 [ -d $$manpath ] || $(MKDIR) $$manpath; \
638 ${MAKE} ${MAKEJOBS} MAKEFILES=${SOURCE}/Makefile \
642 ${SRCROOT}/config/compress-man-pages.pl ${DSTROOT}/${MANDIR}
647 BUILD_INSTALLMAN_SUBDIRS_TARGETS = $(addprefix build_installman_,$(INSTMAN_SUBDIRS))
649 .PHONY: $(BUILD_INSTALLMAN_SUBDIRS_TARGETS)
651 $(BUILD_INSTALLMAN_SUBDIRS_TARGETS):
652 $(_v)installman_subdir="$(patsubst build_installman_%,%,$@)"; \
653 ${MAKE} -C $${installman_subdir} -r \
654 MAKEFILES=$(SOURCE)$${installman_subdir}/Makefile \
655 SOURCE=$(SOURCE)$${installman_subdir}/ \
656 TARGET=$(TARGET)$${installman_subdir}/ \
659 build_installman: $(BUILD_INSTALLMAN_SUBDIRS_TARGETS)
660 $(_v)if [ -n "$(strip $(INSTALL_MAN_LIST))" ]; then \
661 ${MAKE} do_installman; \