From 093a8b0903127959ae530af2d505701e8af2fc4e Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sat, 7 Dec 2019 23:29:34 +0100 Subject: [PATCH] bootstrap: Build files only once. * build-aux/bootstrap.sh.in: Build files only once. --- build-aux/bootstrap.sh.in | 32 +++++++++++++++++---------- build-aux/configure-lib.sh | 4 ++-- lib/mes/{write.c => mini-write.c} | 0 lib/posix/{read.c => buffered-read.c} | 0 4 files changed, 22 insertions(+), 14 deletions(-) rename lib/mes/{write.c => mini-write.c} (100%) rename lib/posix/{read.c => buffered-read.c} (100%) diff --git a/build-aux/bootstrap.sh.in b/build-aux/bootstrap.sh.in index 4c2b376b..108d577b 100644 --- a/build-aux/bootstrap.sh.in +++ b/build-aux/bootstrap.sh.in @@ -49,32 +49,38 @@ cp crt1.s $mes_cpu-mes objects= for c in $libc_mini_SOURCES; do - echo "CC $c" - $CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS ${srcdest}$c o=$(basename $c .c).o + if test ${srcdest}$c -nt $o; then + echo " CC $c" + $CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS ${srcdest}$c + fi objects="$objects $o" done -echo "AR $mes_cpu-mes/libc-mini.a" +echo " AR $mes_cpu-mes/libc-mini.a" $AR crD $mes_cpu-mes/libc-mini.a $objects objects= for c in $libc_SOURCES; do - echo "CC $c" - $CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS ${srcdest}$c o=$(basename $c .c).o + if test ${srcdest}$c -nt $o; then + echo " CC $c" + $CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS ${srcdest}$c + fi objects="$objects $o" done -echo "AR $mes_cpu-mes/libc.a" +echo " AR $mes_cpu-mes/libc.a" $AR crD $mes_cpu-mes/libc.a $objects objects= for c in $libc_tcc_SOURCES; do - echo "CC $c" - $CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS ${srcdest}$c o=$(basename $c .c).o + if test ${srcdest}$c -nt $o; then + echo " CC $c" + $CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS ${srcdest}$c + fi objects="$objects $o" done -echo "AR $mes_cpu-mes/libc+tcc.a" +echo " AR $mes_cpu-mes/libc+tcc.a" $AR crD $mes_cpu-mes/libc+tcc.a $objects cd .. @@ -83,12 +89,14 @@ CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ${srcdest}include/$mes_kern objects= for c in $mes_SOURCES; do - echo "CC $c" - $CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS ${srcdest}$c o=$(basename $c .c).o + if test ${srcdest}$c -nt $o; then + echo " CC $c" + $CC -c $AM_CPPFLAGS $CPPFLAGS $AM_CFLAGS $CFLAGS ${srcdest}$c + fi objects="$objects $o" done -echo "CCLD src/mes" +echo " CCLD src/mes" $CC -nostdlib -o src/mes -L mescc-lib mescc-lib/crt1.o $objects -lc ( diff --git a/build-aux/configure-lib.sh b/build-aux/configure-lib.sh index 7568de8d..c9d0e98c 100644 --- a/build-aux/configure-lib.sh +++ b/build-aux/configure-lib.sh @@ -47,7 +47,7 @@ libc_mini_SOURCES="$libc_mini_shared_SOURCES" if test $mes_libc = mes; then libc_mini_SOURCES="$libc_mini_SOURCES -lib/mes/write.c +lib/mes/mini-write.c " fi @@ -101,7 +101,7 @@ lib/posix/getcwd.c lib/posix/getenv.c lib/posix/isatty.c lib/posix/open.c -lib/posix/read.c +lib/posix/buffered-read.c lib/posix/setenv.c lib/posix/wait.c lib/stdio/fgetc.c diff --git a/lib/mes/write.c b/lib/mes/mini-write.c similarity index 100% rename from lib/mes/write.c rename to lib/mes/mini-write.c diff --git a/lib/posix/read.c b/lib/posix/buffered-read.c similarity index 100% rename from lib/posix/read.c rename to lib/posix/buffered-read.c