Differences From
Artifact [e19ff3649f]:
47 47 *) say "cannot determine correct binary format to use for target $target"; exit 1;;
48 48 esac
49 49
50 50 # first, we establish the
51 51 # parameters of the build
52 52 has cc && _cc=cc
53 53 has clang && _cc=clang
54 -has gcc && _cc=gcc
54 +has gcc && _cc=gcc # prefer gcc
55 55 cc=${cc:-$_cc}
56 56 has m4 && _m4=m4
57 57 m4=${m4:-$_m4}
58 58 has nasm && asm=nasm
59 -has yasm && asm=yasm
59 +has yasm && asm=yasm # prefer yasm
60 60 export gen=${gen:-gen}
61 61 library=${libkind:-static} # {static|shared|both}
62 62
63 +doc=${doc:-yes}
64 +export doc_html=${doc_html:-yes}
65 +export doc_pdf=${doc_pdf:-yes}
66 +export doc_man=${doc_man:-yes}
67 +
63 68 case $library in
64 69 static) build_static_library=yes
65 70 build_shared_library=no;;
66 71
67 72 shared) build_static_library=no
68 73 build_shared_library=yes;;
69 74
................................................................................
129 134
130 135 # generate errno tables
131 136 grep -h "#[ ]*define[ ]\+E" $p_headers_errno | sed 's;^#[\t ]*define[\t ]\+\(E[A-Z0-9]\+\).*$;k_platform_error_\1 \1;' > $gen/error_names.tbl
132 137 cat $p_headers_errno $gen/error_names.tbl | cpp -P >$gen/error_numbers.tbl
133 138 awk -f arch/errtbl.awk <$gen/error_numbers.tbl >$gen/error_table.h
134 139
135 140 # generate symbol tables for error handling functions
136 -mkdir -p $out/k
141 +mkdir -p "$out/k"
137 142 awk -f global/gen-conds.awk <global/modules >$out/k/internal.egroup.h
138 143 awk -f global/gen-ident.awk <global/modules >$gen/internal.ident.c
139 144 comp_co $gen/internal.ident.c $out/internal.ident.o
140 145
141 146 # first pass: copy all headers into place,
142 147 # including ones we need to generate
143 148
................................................................................
153 158 comp_mac "$h" "$out/k/$dest"
154 159 done
155 160 done
156 161
157 162 # second pass: generate manpage, html, and pdf
158 163 # versions of the documentation from the md src
159 164
160 -mkdir -p $out/doc/{man,html,pdf}
161 -global/build-manpage.sh libk.md
162 -for mod in ${modules[@]}; do
163 - for doc in $(scan $mod '*.md'); do
164 - base="$(basename $doc)"
165 - stem="${base%%.md}"
166 - global/build-manpage.sh "$doc"
167 - global/build-html.sh "$doc"
168 - global/build-pdf.sh "$doc"
165 +if test "$doc" = "yes"; then
166 + global/build-manpage.sh libk.md
167 + for mod in ${modules[@]}; do
168 + for doc in $(scan $mod '*.md'); do
169 + base="$(basename $doc)"
170 + stem="${base%%.md}"
171 + global/build-manpage.sh "$doc"
172 + done
169 173 done
170 -done
174 +fi
171 175
172 176 # third pass: compile sources and save the
173 177 # resulting object files to $out, tracking
174 178 # which is a runtime or function unit. exe's
175 179 # will not be compiled until a later pass
176 180
177 181 fn_objects=()