make it clear :)
[oota-llvm.git] / docs / Makefile
index dc1f74cca24a3564ca6e5ef35f957ee88a8d3896..a66d5ae4e8db90907109028c2e23232fe486957b 100644 (file)
@@ -2,14 +2,26 @@
 # 
 #                     The LLVM Compiler Infrastructure
 #
-# This file was developed by the LLVM research group and is distributed under
-# the University of Illinois Open Source License. See LICENSE.TXT for details.
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
 # 
 ##===----------------------------------------------------------------------===##
 
 LEVEL      := ..
 DIRS       := CommandGuide
 
+ifdef BUILD_FOR_WEBSITE
+PROJ_OBJ_DIR = .
+DOXYGEN = doxygen
+
+$(PROJ_OBJ_DIR)/doxygen.cfg: doxygen.cfg.in
+       cat $< | sed \
+         -e 's/@abs_top_srcdir@/../g' \
+         -e 's/@DOT@/dot/g' \
+         -e 's/@PACKAGE_VERSION@/mainline/' \
+         -e 's/@abs_top_builddir@/../g' > $@
+endif
+
 include $(LEVEL)/Makefile.common
 
 HTML       := $(wildcard $(PROJ_SRC_DIR)/*.html) \
@@ -51,21 +63,26 @@ install-doxygen: doxygen
          $(FIND) . -type f -exec \
            $(DataInstall) {} $(PROJ_docsdir)/html/doxygen \;
 
-doxygen: $(PROJ_OBJ_DIR)/doxygen.tar.gz
+doxygen: regendoc $(PROJ_OBJ_DIR)/doxygen.tar.gz
 
-$(PROJ_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(PROJ_OBJ_DIR)/doxygen.cfg
+regendoc:
        $(Echo) Building doxygen documentation
        $(Verb) if test -e $(PROJ_OBJ_DIR)/doxygen ; then \
          $(RM) -rf $(PROJ_OBJ_DIR)/doxygen ; \
        fi
        $(Verb) $(DOXYGEN) $(PROJ_OBJ_DIR)/doxygen.cfg
+
+$(PROJ_OBJ_DIR)/doxygen.tar.gz: $(DOXYFILES) $(PROJ_OBJ_DIR)/doxygen.cfg
        $(Echo) Packaging doxygen documentation
        $(Verb) $(RM) -rf $@ $(PROJ_OBJ_DIR)/doxygen.tar
        $(Verb) $(TAR) cf $(PROJ_OBJ_DIR)/doxygen.tar doxygen
        $(Verb) $(GZIP) $(PROJ_OBJ_DIR)/doxygen.tar
+       $(Verb) $(CP) $(PROJ_OBJ_DIR)/doxygen.tar.gz $(PROJ_OBJ_DIR)/doxygen/html/
+
+userloc: $(LLVM_SRC_ROOT)/docs/userloc.html
 
-userloc.html:
+$(LLVM_SRC_ROOT)/docs/userloc.html:
        $(Echo) Making User LOC Table
        $(Verb) cd $(LLVM_SRC_ROOT) ; ./utils/userloc.pl -details -recurse \
-         -html lib include tools runtime utils examples autoconf test > userloc.html
+         -html lib include tools runtime utils examples autoconf test > docs/userloc.html