-#
-# Install kernel header files
-#
-installhdrs: SRCROOT DSTROOT OBJROOT exporthdrs installhdrs_mi installhdrs_md
- @echo "[ $(SRCROOT) ] make installhdrs installing Kernel.framework"; \
- kincpath=$(DSTROOT)/$(KINCDIR); \
- kframepath=$(DSTROOT)/$(KINCFRAME); \
- $(MKDIR) $$kincpath; \
- chmod -R +w $$kincpath; \
- for i in $(COMPONENT_LIST); do \
- if [ -d $(OBJROOT)/EXPORT_HDRS/$$i ]; then ( \
- cd $(OBJROOT)/EXPORT_HDRS/$$i; \
- pax -ruw -s '/.*CVS.*//' . $$kincpath || true ; \
- ) fi \
- done; \
- cd $(SRCROOT)/EXTERNAL_HEADERS; \
- pax -ruw -s '/.*CVS.*//' . $$kincpath || true; \
- cd $$kframepath/Versions; \
- [ -L Current ] || $(LN) $(KINCVERS) Current; \
- cd $$kframepath; \
- [ -L Headers ] || $(LN) Versions/Current/Headers Headers; \
- $(MKDIR) $(DSTROOT)/$(KPINCDIR); \
- cd $$kframepath; [ -L PrivateHeaders ] || \
- $(LN) Versions/Current/PrivateHeaders PrivateHeaders; \
- find $$kframepath -type f | xargs -s 32000 chmod a-w
-
-#
-# Install header files order
-#
-.ORDER: installhdrs_mi installhdrs_md
+# -*- mode: makefile;-*-
+#
+# Copyright (C) 1999-2012 Apple Inc. All rights reserved.
+#
+# MakeInc.dir contains the recursion rules for the build system.
+# For instance, the "build_installhdrs_md" target is auto-generated
+# such that make(1) recurses into a specified set of subdirectories
+# (building "build_installhdrs_md" in turn at each level) before
+# building the special "do_installhdrs_md" target at the current
+# level. "do_installhdrs_md" is defined in MakeInc.rule.
+#
+
+# $(1) is the name of the target to produce that will perform the
+# recursive behavior via dependencies
+# $(2) is a list of subdirectories to recurse into
+# $(3) is the target to build with a sub-make after
+# the subdirectories have been recursed into
+# $(4) should be "1" if TARGET should be pinned to the per-arch
+# build COMPONENT directory, or empty if it should recurse
+# in lockstep with the source recursion
+define RECURSIVE_BUILD_RULES_template
+$(1)_recurse_target_list = $$(addprefix $(1)_recurse_into_,$(2))
+
+.PHONY: $$($(1)_recurse_target_list)
+
+$$($(1)_recurse_target_list):
+ $$(_v)$$(MKDIR) $$(CURDIR)/$$(patsubst $(1)_recurse_into_%,%,$$@)
+ $$(_v)$${MAKE} -C $$(CURDIR)/$$(patsubst $(1)_recurse_into_%,%,$$@) \
+ -f $$(SOURCE)$$(patsubst $(1)_recurse_into_%,%,$$@)/Makefile \
+ CURRENT_KERNEL_CONFIG=$${CURRENT_KERNEL_CONFIG} \
+ CURRENT_ARCH_CONFIG=$${CURRENT_ARCH_CONFIG} \
+ CURRENT_MACHINE_CONFIG=$${CURRENT_MACHINE_CONFIG} \
+ CURRENT_BUILD_CONFIG=$${CURRENT_BUILD_CONFIG} \
+ SOURCE=$$(SOURCE)$$(patsubst $(1)_recurse_into_%,%,$$@)/ \
+ RELATIVE_SOURCE_PATH=$$(RELATIVE_SOURCE_PATH)/$$(patsubst $(1)_recurse_into_%,%,$$@) \
+ TARGET=$(if $(4),$${OBJPATH}/$$(COMPONENT),$$(TARGET)$$(patsubst $(1)_recurse_into_%,%,$$@)/) \
+ OBJPATH=$${OBJPATH} \
+ $(1);
+
+.PHONY: $(1)
+
+$(1): $$($(1)_recurse_target_list)
+ $$(_v)$${MAKE} -C $$(CURDIR) \
+ -f $$(firstword $$(MAKEFILE_LIST)) \
+ CURRENT_KERNEL_CONFIG=$${CURRENT_KERNEL_CONFIG} \
+ CURRENT_ARCH_CONFIG=$${CURRENT_ARCH_CONFIG} \
+ CURRENT_MACHINE_CONFIG=$${CURRENT_MACHINE_CONFIG} \
+ CURRENT_BUILD_CONFIG=$${CURRENT_BUILD_CONFIG} \
+ SOURCE=$$(SOURCE) \
+ RELATIVE_SOURCE_PATH=$$(RELATIVE_SOURCE_PATH) \
+ TARGET=$$(TARGET) \
+ OBJPATH=$${OBJPATH} \
+ $(3);
+endef