Re-apply ndk-docs rule.
This time wrapped with a check for the docs directory for unbundled
branches.
Test: make checkbuild
Bug: None
Change-Id: If80f0a03850d6cad3eab6d759af02ff2a7870974
diff --git a/core/Makefile b/core/Makefile
index 4959e0e..1b1b4e5 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -70,6 +70,27 @@
@cp -f $< $@
endif
+ndk_doxygen_out := $(OUT_NDK_DOCS)
+ndk_headers := $(SOONG_OUT_DIR)/ndk/sysroot/usr/include
+ndk_docs_src_dir := frameworks/native/docs
+ndk_doxyfile := $(ndk_docs_src_dir)/Doxyfile
+ifneq ($(wildcard $(ndk_docs_src_dir)),)
+ndk_docs_srcs := $(addprefix $(ndk_docs_src_dir)/,\
+ $(call find-files-in-subdirs,$(ndk_docs_src_dir),"*",.))
+$(ndk_doxygen_out)/index.html: $(ndk_docs_srcs) $(SOONG_OUT_DIR)/ndk.timestamp
+ @mkdir -p $(ndk_doxygen_out)
+ @echo "Generating NDK docs to $(ndk_doxygen_out)"
+ @( cat $(ndk_doxyfile); \
+ echo "INPUT=$(ndk_headers)"; \
+ echo "HTML_OUTPUT=$(ndk_doxygen_out)" \
+ ) | doxygen -
+
+# Note: Not a part of the docs target because we don't have doxygen available.
+# You can run this target locally if you have doxygen installed.
+ndk-docs: $(ndk_doxygen_out)/index.html
+.PHONY: ndk-docs
+endif
+
# -----------------------------------------------------------------
# property_overrides_split_enabled
property_overrides_split_enabled :=