+
+xnu_tests_driverkit:
+ $(MAKE) -C $(SRCROOT)/tests/driverkit $(if $(filter -j,$(MAKEFLAGS)),,$(MAKEJOBS)) \
+ SRCROOT=$(SRCROOT)/tests/driverkit
+
+
+include $(MakeInc_cmd)
+
+#
+# The "analyze" target defined below invokes Clang Static Analyzer
+# with a predefined set of checks and options for the project.
+#
+
+# By default, analysis results are available in BUILD/StaticAnalyzer.
+# Set this variable in your make invocation to use a different directory.
+# Note that these results are only deleted when the build directory
+# is cleaned. They aren't deleted every time the analyzer is re-run,
+# but they are deleted after "make clean".
+STATIC_ANALYZER_OUTPUT_DIR ?= $(SRCROOT)/BUILD/StaticAnalyzer
+
+# By default, the default make target is analyzed. You can analyze
+# other targets by setting this variable in your make invocation.
+STATIC_ANALYZER_TARGET ?=
+
+# You can pass additional flags to scan-build by setting this variable
+# in your make invocation. For example, you can enable additional checks.
+STATIC_ANALYZER_EXTRA_FLAGS ?=
+
+analyze:
+# This is where the reports are going to be available.
+# Old reports are deleted on make clean only.
+ $(_v)$(MKDIR) $(STATIC_ANALYZER_OUTPUT_DIR)
+
+# Recursively build the requested target under scan-build.
+# Exclude checks that weren't deemed to be security critical,
+# like null pointer dereferences.
+ $(_v)$(XCRUN) $(SCAN_BUILD) -o $(STATIC_ANALYZER_OUTPUT_DIR) \
+ -disable-checker deadcode.DeadStores \
+ -disable-checker core.NullDereference \
+ -disable-checker core.DivideZero \
+ $(STATIC_ANALYZER_EXTRA_FLAGS) \
+ $(MAKE) $(STATIC_ANALYZER_TARGET) QUIET=1 2>&1 | $(GREP) "^scan-build:"
+
+.PHONY: analyze