summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2011-04-22 18:29:36 (GMT)
committerEvan Martin <martine@danga.com>2011-04-22 18:29:36 (GMT)
commitfd8c47a8a27430eeb41d75df8faf694288d0c54c (patch)
treea015eccda04f4377098935ea1c2d3847a47eafbe
parent4f6ad36ebde27874f4aa054de0fa00e06ff166fe (diff)
parent2ff127093b246cd03ef8b2001cb79d255b728c7b (diff)
downloadNinja-fd8c47a8a27430eeb41d75df8faf694288d0c54c.zip
Ninja-fd8c47a8a27430eeb41d75df8faf694288d0c54c.tar.gz
Ninja-fd8c47a8a27430eeb41d75df8faf694288d0c54c.tar.bz2
Merge branch 'doxygen'
-rw-r--r--.gitignore2
-rw-r--r--build.ninja4
-rwxr-xr-xgen_doxygen_mainpage.sh34
3 files changed, 35 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore
index 8876a6c..f2f11bb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,4 +6,4 @@ TAGS
/README.html
/config.ninja
/manual.html
-doxygen
+/doxygen
diff --git a/build.ninja b/build.ninja
index 77b95fc..e780603 100644
--- a/build.ninja
+++ b/build.ninja
@@ -99,8 +99,8 @@ doxygen_mainpage_generator = ./gen_doxygen_mainpage.sh
rule doxygen_mainpage
command = $doxygen_mainpage_generator $in > $out
- description = DOXYGEN_MAINPAGE
+ description = DOXYGEN_MAINPAGE $out
build $builddir/doxygen_mainpage: doxygen_mainpage \
README HACKING COPYING | $doxygen_mainpage_generator
-build doxygen: doxygen doxygen.config || $builddir/doxygen_mainpage
+build doxygen: doxygen doxygen.config | $builddir/doxygen_mainpage || $builddir/doxygen_mainpage
diff --git a/gen_doxygen_mainpage.sh b/gen_doxygen_mainpage.sh
index 157e878..d159947 100755
--- a/gen_doxygen_mainpage.sh
+++ b/gen_doxygen_mainpage.sh
@@ -1,18 +1,44 @@
#!/bin/sh
+# Copyright 2011 Google Inc. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
set -o errexit
set -o nounset
STATUS=0
# Print each of its arguments on stderr (one per line) prefixed by the
+# basename of this script.
+stderr()
+{
+ local me=$(basename "$0")
+ local i
+ for i
+ do
+ echo >&2 "$me: $i"
+ done
+}
+
+# Print each of its arguments on stderr (one per line) prefixed by the
# basename of this script and 'error'.
error()
{
local i
for i
do
- echo >&2 "error: $i"
+ stderr "error: $i"
done
STATUS=1
}
@@ -35,7 +61,11 @@ EOF
include_file()
{
local file="$1"
- test -r "$file" || fatal "'$file' is not readable."
+ if ! [ -r "$file" ]
+ then
+ error "'$file' is not readable."
+ return
+ fi
cat <<EOF
* \\section $file
* \\verbatim