fix validation issues.
[oota-llvm.git] / docs / Makefile
index 92ba96107ca5ed988a850bdc6ec0a0a5bf245845..10b31d1076f82aec515be839227888e3a33b6bcc 100644 (file)
@@ -2,14 +2,29 @@
 # 
 #                     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
+# Extract version number from the AC_INT line in configure.ac
+# AC_INIT([[llvm]],[[2.1svn]],[llvmbugs@cs.uiuc.edu])
+PACKAGE_VERSION = $(shell grep AC_INIT ../autoconf/configure.ac | sed -e 's/^[^0-9]*\([0-9_.a-zA-Z-]*\).*/\1/' )
+
+$(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@/$(PACKAGE_VERSION)/' \
+         -e 's/@abs_top_builddir@/../g' > $@
+endif
+
 include $(LEVEL)/Makefile.common
 
 HTML       := $(wildcard $(PROJ_SRC_DIR)/*.html) \
@@ -51,14 +66,16 @@ 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