3 # Mes --- Maxwell Equations of Software
4 # Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
6 # This file is part of Mes.
8 # 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 # 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 Mes. If not, see <http://www.gnu.org/licenses/>.
21 if [ -n "$BUILD_DEBUG" ]; then
25 export BLOOD_ELF GUILE HEX2 M1 MES MESCC
26 export M1FLAGS HEX2FLAGS PREPROCESS
30 BLOOD_ELF=${BLOOD_ELF-blood-elf}
31 MESCC=${MESCC-$(command -v mescc)}
32 [ -z "$MESCC" ] && MESCC=scripts/mescc
33 MES=${MES-$(command -v mes)}
34 [ -z "$MES" ] && MES=src/mes
37 -D VERSION=\"$VERSION\"
38 -D MODULEDIR=\"$MODULEDIR\"
44 MESCCFLAGS=${MESCCFLAGS-"
47 if [ -n "$BUILD_DEBUG" ]; then
48 MESCCFLAGS="$MESCCFLAGS -v"
55 if [ -z "$ARCHDIR" ]; then
65 if [ -n "$PREPROCESS" ]; then
66 sh $MESCC $MESCCFLAGS $CPPFLAGS -E -o "$o.E" "$c".c
67 sh $MESCC $MESCCFLAGS -S "$o".E
68 sh $MESCC $MESCCFLAGS -c -o "$o".${p}o "$o".S
69 if [ -z "$NOLINK" ]; then
70 sh $MESCC $MESCCFLAGS -o "$o".${p}out "$o".${p}o $MESCCLIBS
72 elif [ -n "$COMPILE" ]; then
73 sh $MESCC $MESCCFLAGS $CPPFLAGS -S -o "$o.S" "$c".c
74 sh $MESCC $MESCCFLAGS -c -o "$o".${p}o "$o".S
75 if [ -z "$NOLINK" ]; then
76 sh $MESCC $MESCCFLAGS -o "$o".${p}out "$o".${p}o $MESCCLIBS
78 elif [ -z "$NOLINK" ]; then
79 sh $MESCC $MESCCFLAGS $CPPFLAGS -o "$o".${p}out "$c".c $MESCCLIBS
81 sh $MESCC $MESCCFLAGS $CPPFLAGS -c -o "$o".${p}out "$c".c