| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 # Copyright 2015 The Crashpad Authors. All rights reserved. | 3 # Copyright 2015 The Crashpad Authors. All rights reserved. |
| 4 # | 4 # |
| 5 # Licensed under the Apache License, Version 2.0 (the "License"); | 5 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 # you may not use this file except in compliance with the License. | 6 # you may not use this file except in compliance with the License. |
| 7 # You may obtain a copy of the License at | 7 # You may obtain a copy of the License at |
| 8 # | 8 # |
| 9 # http://www.apache.org/licenses/LICENSE-2.0 | 9 # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 # | 10 # |
| 11 # Unless required by applicable law or agreed to in writing, software | 11 # Unless required by applicable law or agreed to in writing, software |
| 12 # distributed under the License is distributed on an "AS IS" BASIS, | 12 # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 # See the License for the specific language governing permissions and | 14 # See the License for the specific language governing permissions and |
| 15 # limitations under the License. | 15 # limitations under the License. |
| 16 | 16 |
| 17 set -e | 17 set -e |
| 18 | 18 |
| 19 # Generating AsciiDoc documentation requires AsciiDoc, | 19 # Generating AsciiDoc documentation requires AsciiDoc, |
| 20 # http://www.methods.co.nz/asciidoc/. For “man” and PDF output, a DocBook | 20 # http://www.methods.co.nz/asciidoc/. For “man” and PDF output, a DocBook |
| 21 # toolchain including docbook-xml and docbook-xsl is also required. | 21 # toolchain including docbook-xml and docbook-xsl is also required. |
| 22 | 22 |
| 23 # Run from the Crashpad project root directory. | 23 # Run from the Crashpad project root directory. |
| 24 cd "$(dirname "${0}")/../.." | 24 cd "$(dirname "${0}")/../.." |
| 25 | 25 |
| 26 source doc/support/compat.sh |
| 27 |
| 26 output_dir=out/doc | 28 output_dir=out/doc |
| 27 | 29 |
| 28 rm -rf \ | 30 rm -rf \ |
| 29 "${output_dir}/doc" \ | 31 "${output_dir}/doc" \ |
| 30 "${output_dir}/man" | 32 "${output_dir}/man" |
| 31 mkdir -p \ | 33 mkdir -p \ |
| 32 "${output_dir}/doc/html" \ | 34 "${output_dir}/doc/html" \ |
| 33 "${output_dir}/man/html" \ | 35 "${output_dir}/man/html" \ |
| 34 "${output_dir}/man/man" | 36 "${output_dir}/man/man" |
| 35 | 37 |
| 36 # Some extensions of command-line tools behave differently on different systems. | |
| 37 # $sed_ext should be a sed invocation that enables extended regular expressions. | |
| 38 # $date_time_t should be a date invocation that causes it to print the date and | |
| 39 # time corresponding to a time_t string that immediately follows it. | |
| 40 uname_s="$(uname -s)" | |
| 41 case "${uname_s}" in | |
| 42 Darwin) | |
| 43 sed_ext="sed -E" | |
| 44 date_time_t="date -r" | |
| 45 ;; | |
| 46 Linux) | |
| 47 sed_ext="sed -r" | |
| 48 date_time_t="date -d@" | |
| 49 ;; | |
| 50 *) | |
| 51 echo "${0}: unknown operating system" >& 2 | |
| 52 exit 1 | |
| 53 ;; | |
| 54 esac | |
| 55 | |
| 56 # Get the version from package.h. | 38 # Get the version from package.h. |
| 57 version=$(${sed_ext} -n -e 's/^#define PACKAGE_VERSION "(.*)"$/\1/p' package.h) | 39 version=$(${sed_ext} -n -e 's/^#define PACKAGE_VERSION "(.*)"$/\1/p' package.h) |
| 58 | 40 |
| 59 generate() { | 41 generate() { |
| 60 input="$1" | 42 input="$1" |
| 61 type="$2" | 43 type="$2" |
| 62 | 44 |
| 63 case "${type}" in | 45 case "${type}" in |
| 64 doc) | 46 doc) |
| 65 doctype="article" | 47 doctype="article" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 doc/*.ad; do | 102 doc/*.ad; do |
| 121 generate "${input}" "doc" | 103 generate "${input}" "doc" |
| 122 done | 104 done |
| 123 | 105 |
| 124 for input in \ | 106 for input in \ |
| 125 handler/crashpad_handler.ad \ | 107 handler/crashpad_handler.ad \ |
| 126 tools/*.ad \ | 108 tools/*.ad \ |
| 127 tools/mac/*.ad; do | 109 tools/mac/*.ad; do |
| 128 generate "${input}" "man" | 110 generate "${input}" "man" |
| 129 done | 111 done |
| OLD | NEW |