2018-04-29 16:38:57 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
2018-07-22 12:24:36 +00:00
|
|
|
# GNU Mes --- Maxwell Equations of Software
|
2018-11-06 19:29:35 +00:00
|
|
|
# Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
2018-04-29 16:38:57 +00:00
|
|
|
#
|
2018-07-22 12:24:36 +00:00
|
|
|
# This file is part of GNU Mes.
|
2018-04-29 16:38:57 +00:00
|
|
|
#
|
2018-07-22 12:24:36 +00:00
|
|
|
# GNU Mes is free software; you can redistribute it and/or modify it
|
2018-04-29 16:38:57 +00:00
|
|
|
# under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 3 of the License, or (at
|
|
|
|
# your option) any later version.
|
|
|
|
#
|
2018-07-22 12:24:36 +00:00
|
|
|
# GNU Mes is distributed in the hope that it will be useful, but
|
2018-04-29 16:38:57 +00:00
|
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2018-07-22 12:24:36 +00:00
|
|
|
# along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
|
2018-04-29 16:38:57 +00:00
|
|
|
|
2018-11-06 19:29:35 +00:00
|
|
|
set -e
|
|
|
|
|
|
|
|
if [ ! "$config_status" ]; then
|
|
|
|
. ./config.status
|
|
|
|
fi
|
|
|
|
|
2018-07-25 06:14:13 +00:00
|
|
|
. ${srcdest}build-aux/config.sh
|
|
|
|
. ${srcdest}build-aux/trace.sh
|
2018-11-06 19:29:35 +00:00
|
|
|
. ${srcdest}build-aux/cc.sh
|
2018-05-03 18:32:06 +00:00
|
|
|
|
2018-11-06 19:29:35 +00:00
|
|
|
[ "$mes_p" ] && (program_prefix= compile lib/linux/$mes_arch/crt1)
|
|
|
|
[ "$mes_p" -a ! "$gcc_p" ] && cp -f lib/linux/$mes_arch/crt1.S lib/$mes_arch/crt1.S
|
|
|
|
[ "$mes_p" -a ! "$gcc_p" ] && cp -f lib/linux/$mes_arch/crt1.o lib/$mes_arch/crt1.o
|
2018-05-25 06:05:02 +00:00
|
|
|
|
2018-11-06 19:29:35 +00:00
|
|
|
[ ! "$mesc_p" -a ! "$posix_p" ] && (program_prefix= compile lib/linux/$mes_arch/crt0)
|
|
|
|
[ "$mes_p" -a "$gcc_p" ] && (program_prefix= compile lib/linux/$mes_arch/crti)
|
|
|
|
[ "$mes_p" -a "$gcc_p" ] && (program_prefix= compile lib/linux/$mes_arch/crtn)
|
2018-04-29 16:38:57 +00:00
|
|
|
|
2018-11-06 19:29:35 +00:00
|
|
|
[ ! "$mes_p" -a ! "$mesc_p" ] && compile lib/libmes
|
|
|
|
[ ! "$mes_p" -a ! "$mesc_p" ] && archive lib/libmes
|
2018-05-03 18:32:06 +00:00
|
|
|
|
2018-11-06 19:29:35 +00:00
|
|
|
[ "$mes_p" ] && compile lib/libc-mini
|
|
|
|
[ "$mes_p" ] && archive lib/libc-mini
|
2018-04-29 16:38:57 +00:00
|
|
|
|
2018-11-06 19:29:35 +00:00
|
|
|
[ "$mes_p" ] && compile lib/libc
|
|
|
|
[ "$mes_p" ] && archive lib/libc
|
2018-07-07 15:31:06 +00:00
|
|
|
|
2018-11-06 19:29:35 +00:00
|
|
|
[ "$mes_p" ] && compile lib/libc+tcc
|
|
|
|
[ "$mes_p" ] && archive lib/libc+tcc
|
2018-08-10 09:15:43 +00:00
|
|
|
|
2018-11-06 19:29:35 +00:00
|
|
|
[ "$mes_p" ] && compile lib/libc+gnu
|
|
|
|
[ "$mes_p" ] && archive lib/libc+gnu
|
2018-08-10 09:15:43 +00:00
|
|
|
|
2018-11-06 19:29:35 +00:00
|
|
|
[ "$mes_p" -a ! "$mesc_p" ] && compile lib/libtcc1
|
|
|
|
[ "$mes_p" -a ! "$mesc_p" ] && archive lib/libtcc1
|
2018-05-25 06:05:02 +00:00
|
|
|
|
2018-11-06 19:29:35 +00:00
|
|
|
[ "$mes_p" -a ! "$mesc_p" ] && compile lib/libg
|
|
|
|
[ "$mes_p" -a ! "$mesc_p" ] && archive lib/libg
|
2018-04-29 16:38:57 +00:00
|
|
|
|
2018-11-06 19:29:35 +00:00
|
|
|
[ "$mes_p" -a ! "$mesc_p" ] && compile lib/libgetopt
|
|
|
|
[ "$mes_p" -a ! "$mesc_p" ] && archive lib/libgetopt
|
|
|
|
|
|
|
|
compile scaffold/main
|
|
|
|
(libc= link scaffold/main)
|
|
|
|
|
|
|
|
compile scaffold/hello
|
|
|
|
(libc="-l c-mini" link scaffold/hello)
|
2018-07-07 15:31:06 +00:00
|
|
|
|
2018-11-06 19:29:35 +00:00
|
|
|
compile scaffold/argv
|
|
|
|
(libc="-l c-mini" link scaffold/argv)
|
2018-08-15 15:47:03 +00:00
|
|
|
|
2018-11-06 19:29:35 +00:00
|
|
|
[ "$mes_p" ] && compile scaffold/malloc
|
|
|
|
[ "$mes_p" ] && link scaffold/malloc
|
|
|
|
[ "$mes_p" ] && compile scaffold/micro-mes
|
|
|
|
[ "$mes_p" ] && link scaffold/micro-mes
|
|
|
|
[ "$mes_p" ] && compile scaffold/tiny-mes
|
|
|
|
[ "$mes_p" ] && link scaffold/tiny-mes
|
2018-11-11 15:25:36 +00:00
|
|
|
#[ "$mes_p" ] && compile scaffold/mini-mes
|
|
|
|
#[ "$mes_p" ] && link scaffold/mini-mes
|
2018-08-15 15:47:03 +00:00
|
|
|
|
2018-11-06 19:29:35 +00:00
|
|
|
compile src/mes
|
|
|
|
link src/mes
|