bootstrap: Build files only once.

* build-aux/bootstrap.sh.in: Build files only once.
This commit is contained in:
Jan Nieuwenhuizen 2019-12-07 23:29:34 +01:00
parent 82c85c24da
commit 093a8b0903
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
4 changed files with 22 additions and 14 deletions

View file

@ -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
(

View file

@ -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