[OCaml] PR14083, PR9606: Only pick *.odoc files from current build target.
[oota-llvm.git] / docs / Makefile
index 122c4b834bba47009bb6f35d5d467fc6472d257a..690f7726b732fad9f4cc132eee724b5324f71a0f 100644 (file)
@@ -1,10 +1,10 @@
 ##===- docs/Makefile ---------------------------------------*- Makefile -*-===##
-# 
+#
 #                     The LLVM Compiler Infrastructure
 #
 # This file is distributed under the University of Illinois Open Source
 # License. See LICENSE.TXT for details.
-# 
+#
 ##===----------------------------------------------------------------------===##
 
 LEVEL      := ..
@@ -19,7 +19,12 @@ $(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in
          -e 's/@abs_top_srcdir@/../g' \
          -e 's/@DOT@/dot/g' \
          -e 's/@PACKAGE_VERSION@/mainline/' \
-         -e 's/@abs_top_builddir@/../g' > $@
+         -e 's/@abs_top_builddir@/../g' \
+         -e 's/@enable_searchengine@/NO/g' \
+         -e 's/@searchengine_url@//g' \
+         -e 's/@enable_server_based_search@/NO/g' \
+         -e 's/@enable_external_search@/NO/g' \
+         -e 's/@extra_search_mappings@//g' > $@
 endif
 
 include $(LEVEL)/Makefile.common
@@ -77,9 +82,7 @@ doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
 
 regendoc:
        $(Echo) Building doxygen documentation
-       $(Verb) if test -e $(PROJ_OBJ_DIR)/doxygen ; then \
-         $(RM) -rf $(PROJ_OBJ_DIR)/doxygen ; \
-       fi
+       $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/doxygen
        $(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg
 
 $(PROJ_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(PROJ_OBJ_DIR)/doxygen.cfg
@@ -113,14 +116,13 @@ ocamldoc: regen-ocamldoc
 
 regen-ocamldoc:
        $(Echo) Building ocamldoc documentation
-       $(Verb) if test -e $(PROJ_OBJ_DIR)/ocamldoc ; then \
-               $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc ; \
-       fi
+       $(Verb) $(RM) -rf $(PROJ_OBJ_DIR)/ocamldoc
        $(Verb) $(MAKE) -C $(LEVEL)/bindings/ocaml ocamldoc
        $(Verb) $(MKDIR) $(PROJ_OBJ_DIR)/ocamldoc/html
        $(Verb) \
                $(OCAMLDOC) -d $(PROJ_OBJ_DIR)/ocamldoc/html -sort -colorize-code -html \
-               `$(FIND) $(LEVEL)/bindings/ocaml -name "*.odoc" -exec echo -load '{}' ';'`
+               `$(FIND) $(LEVEL)/bindings/ocaml -name "*.odoc" \
+                        -path "*/$(BuildMode)/*.odoc" -exec echo -load '{}' ';'`
 
 uninstall-local::
        $(Echo) Uninstalling Documentation