summaryrefslogtreecommitdiff
path: root/project/config
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2021-06-13 09:09:23 +0000
committermidipix <writeonce@midipix.org>2021-06-13 09:09:23 +0000
commit4f906926d0af8278575cf6b03e87da59c9dcc186 (patch)
treed7d85388d02a230a69707b9047116e1420a58937 /project/config
parent7a15355d31c7c88a97dcd302091f16c22486e893 (diff)
downloadsbmake-4f906926d0af8278575cf6b03e87da59c9dcc186.tar.bz2
sbmake-4f906926d0af8278575cf6b03e87da59c9dcc186.tar.xz
project: cfgdefs.sh: cfgdefs_bootstrap(): enhanced output and logging.
Diffstat (limited to 'project/config')
-rw-r--r--project/config/cfgdefs.sh48
1 files changed, 39 insertions, 9 deletions
diff --git a/project/config/cfgdefs.sh b/project/config/cfgdefs.sh
index 42096ef..34bd609 100644
--- a/project/config/cfgdefs.sh
+++ b/project/config/cfgdefs.sh
@@ -40,49 +40,79 @@ cfgdefs_bootstrap()
cfgdefs_sources="$cfgdefs_sources lst.c main.c make_malloc.c meta.c metachar.c parse.c"
cfgdefs_sources="$cfgdefs_sources str.c suff.c targ.c trace.c util.c var.c"
- cfgdefs_cflags="-I${mb_source_dir}/src/internal"
+ cfgdefs_cflags=
+ cfgdefs_cflags="$cfgdefs_cflags -I${mb_source_dir}/src/internal"
cfgdefs_cflags="$cfgdefs_cflags -D_PATH_DEFSYSPATH=\"${mb_source_dir}/mk\""
cfgdefs_cflags="$cfgdefs_cflags $cfgdefs_added_defs"
+ cfgtest_native_section
+
+ if cfgtest_compiler_switch -std=c99; then
+ cfgdefs_cflags="$cfgdefs_cflags -std=c99"
+ fi
+
cfgdefs_make="$mb_pwd/bootstrap/make"
mkdir -p "$mb_pwd/bootstrap"
- printf '\n\n'
+ output_section_break
+ output_script_status 'bootstrapping' './bootstrap/make'
for src in $cfgdefs_utilsrc; do
obj=${src%%.c}.o
cfgdefs_objs="$cfgdefs_objs $mb_pwd/bootstrap/${obj}"
- set -x
+ output_step_prolog 'compiling' "./bootstrap/${obj}"
+
+ printf '\n$ %s %s\n' "$mb_native_cc $cfgdefs_cflags" '\' >&3
+ printf '\t-c %s %s\n' "$mb_source_dir/src/${src}" '\' >&3
+ printf '\t-o %s %s\n\n\n' "$mb_pwd/bootstrap/${obj}" >&3
"$mb_native_cc" $mb_native_cflags $cfgdefs_cflags \
-c "$mb_source_dir/src/${src}" \
- -o "$mb_pwd/bootstrap/${obj}"
+ -o "$mb_pwd/bootstrap/${obj}" \
+ 2>&3
- set +x
+ output_step_epilog
done
for src in $cfgdefs_sources; do
obj=${src%%.c}.o
cfgdefs_objs="$cfgdefs_objs $mb_pwd/bootstrap/${obj}"
- set -x
+ output_step_prolog 'compiling' "./bootstrap/${obj}"
+
+ printf '\n$ %s %s\n' "$mb_native_cc $cfgdefs_cflags" '\' >&3
+ printf '\t-c %s %s\n' "$mb_source_dir/src/logic/${src}" '\' >&3
+ printf '\t-o %s %s\n\n\n' "$mb_pwd/bootstrap/${obj}" >&3
"$mb_native_cc" $mb_native_cflags $cfgdefs_cflags \
-c "$mb_source_dir/src/logic/${src}" \
- -o "$mb_pwd/bootstrap/${obj}"
+ -o "$mb_pwd/bootstrap/${obj}" \
+ 2>&3
- set +x
+ output_step_epilog
done
+ output_step_prolog 'linking' './bootstrap/make'
+
+ printf '\n$ %s %s\n' "$mb_native_cc $cfgdefs_cflags" '\' >&3
+ printf '\t %s %s\n' "$mb_native_ldflags" '\' >&3
+ printf '\t %s %s\n' "$cfgdefs_objs" '\' >&3
+ printf '\t-o %s %s\n\n\n' "$cfgdefs_make" >&3
+
"$mb_native_cc" $mb_native_cflags $cfgdefs_cflags \
$mb_native_ldflags $cfgdefs_objs \
- -o "$cfgdefs_make"
+ -o "$cfgdefs_make" \
+ 2>&3
+
+ output_step_epilog
mb_make="$cfgdefs_make"
cfgdefs_bootstrap_done='yes'
+
+ output_section_break
}