3 # GNU Mes --- Maxwell Equations of Software
4 # Copyright © 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
6 # This file is part of GNU Mes.
8 # GNU Mes is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or (at
11 # your option) any later version.
13 # GNU Mes is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
22 MES_ARENA=${MES_ARENA-100000000}
23 MES_MAX_ARENA=${MES_MAX_ARENA-100000000}
24 MES_STACK=${MES_STACK-500000}
26 . build-aux/configure-lib.sh
28 CPPFLAGS="-D HAVE_CONFIG_H=1 -I include"
31 cp config.sh mescc-lib/config.sh
34 CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ${srcdest}include/$mes_kernel/$mes_cpu"
37 $CC -c $CPPFLAGS $CFLAGS ${srcdest}lib/$mes_kernel/$mes_cpu-mes-$compiler/crt1.c
38 cp crt1.o $mes_cpu-mes
39 cp crt1.s $mes_cpu-mes
42 for c in $libc_mini_SOURCES; do
44 $CC -c $CPPFLAGS $CFLAGS ${srcdest}$c
48 echo "AR $mes_cpu-mes/libc-mini.a"
49 $AR crD $mes_cpu-mes/libc-mini.a $objects
52 for c in $libc_SOURCES; do
54 $CC -c $CPPFLAGS $CFLAGS ${srcdest}$c
58 echo "AR $mes_cpu-mes/libc.a"
59 $AR crD $mes_cpu-mes/libc.a $objects
62 for c in $libc_tcc_SOURCES; do
64 $CC -c $CPPFLAGS $CFLAGS ${srcdest}$c
68 echo "AR $mes_cpu-mes/libc+tcc.a"
69 $AR crD $mes_cpu-mes/libc+tcc.a $objects
73 CPPFLAGS="-D HAVE_CONFIG_H=1 -I ${srcdest}include -I ${srcdest}include/$mes_kernel/$mes_cpu"
76 for c in $mes_SOURCES; do
78 $CC -c $CPPFLAGS $CFLAGS ${srcdest}$c
83 $CC -nostdlib -o src/mes -L mescc-lib mescc-lib/crt1.o $objects -lc
90 if test -z "$srcdest"; then
94 @SHELL@ ${srcdest}build-aux/build-source-lib.sh