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 . ${srcdest}build-aux/configure-lib.sh
23 . ${srcdest}build-aux/trace.sh
24 . ${srcdest}build-aux/cc.sh
26 trap 'test -f .log && cat .log' EXIT
29 compile lib/$mes_kernel/$mes_cpu-mes-$compiler/crt1.c
30 cp crt1.o $mes_cpu-mes
31 if test -e crt1.s; then
32 cp crt1.s $mes_cpu-mes
35 archive libc-mini.a $libc_mini_SOURCES
36 cp libc-mini.a $mes_cpu-mes
37 if test -e libc-mini.s; then
38 cp libc-mini.s $mes_cpu-mes
41 archive libmes.a $libmes_SOURCES
42 cp libmes.a $mes_cpu-mes
43 if test -e libmes.s; then
44 cp libmes.s $mes_cpu-mes
47 if test $mes_libc = mes; then
48 archive libc.a $libc_SOURCES
49 cp libc.a $mes_cpu-mes
50 if test -e libc.s; then
51 cp libc.s $mes_cpu-mes
55 archive libc+tcc.a $libc_tcc_SOURCES
56 cp libc+tcc.a $mes_cpu-mes
57 if test -e libc+tcc.s; then
58 cp libc+tcc.s $mes_cpu-mes
65 archive libc+gnu.a $libc_gnu_SOURCES
66 cp libc+gnu.a $mes_cpu-mes
67 if test -e libc+gnu.s; then
68 cp libc+gnu.s $mes_cpu-mes
71 archive libtcc1.a $libtcc1_SOURCES
72 cp libtcc1.a $mes_cpu-mes
73 if test -e libtcc1.s; then
74 cp libtcc1.s $mes_cpu-mes
77 archive libgetopt.a lib/posix/getopt.c
78 cp libgetopt.a $mes_cpu-mes
79 if test -e libgetopt.s; then
80 cp libgetopt.s $mes_cpu-mes
83 cp ${srcdest}lib/$mes_kernel/$mes_cpu-mes-$compiler/crt*.c $mes_cpu-mes
86 cat > libc+gnu.c <<EOF
87 // Generated from Mes -- do not edit
88 // compiler: $compiler
92 // kernel: $mes_kernel
93 // system: $mes_system
96 for c in $libc_gnu_SOURCES; do
97 echo "// $c" >> libc+gnu.c
98 cat ${srcdest}$c >> libc+gnu.c
101 cp libc+gnu.c $mes_cpu-mes
103 cp ${srcdest}lib/libtcc1.c $mes_cpu-mes
104 cp ${srcdest}lib/posix/getopt.c $mes_cpu-mes/libgetopt.c