From 6078fa50832ddba28a21931248fe5165577099fc Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sat, 6 Oct 2018 07:08:20 +0200 Subject: [PATCH] build: Split-off x86_mes-gcc build. * build-aux/build-cc64.sh: New file. * build-aux/build.sh.in[CC64]: Invoke it. * build-aux/build-cc.sh: Remove x86_64-mes-gcc build. * build-aux/GNUmakefile.in (x86_64-mes-gcc): New target. * build-aux/build-x86_64-mes.sh: Build all scafffold files. --- build-aux/GNUmakefile.in | 3 ++ build-aux/build-cc.sh | 36 --------------------- build-aux/build-cc64.sh | 60 +++++++++++++++++++++++++++++++++++ build-aux/build-x86_64-mes.sh | 20 ++++++------ build-aux/build.sh.in | 4 +++ 5 files changed, 77 insertions(+), 46 deletions(-) create mode 100755 build-aux/build-cc64.sh diff --git a/build-aux/GNUmakefile.in b/build-aux/GNUmakefile.in index 24d8e1f1..9b7748fe 100644 --- a/build-aux/GNUmakefile.in +++ b/build-aux/GNUmakefile.in @@ -90,6 +90,9 @@ gcc: mes-gcc: ${srcdest}build-aux/build-cc32.sh +x86_64-mes-gcc: + ${srcdest}build-aux/build-cc64.sh + mes-tcc: ifdef TCC CC32=$(TCC) ${srcdest}build-aux/build-cc32.sh diff --git a/build-aux/build-cc.sh b/build-aux/build-cc.sh index 650728b4..45e85811 100755 --- a/build-aux/build-cc.sh +++ b/build-aux/build-cc.sh @@ -23,9 +23,6 @@ set -e . ${srcdest}build-aux/config.sh . ${srcdest}build-aux/trace.sh -# cc64 -LIBC=${LIBC-c} - # native trace "SNARF gc.c" ${srcdest}build-aux/mes-snarf.scm src/gc.c trace "SNARF lib.c" ${srcdest}build-aux/mes-snarf.scm src/lib.c @@ -35,39 +32,6 @@ trace "SNARF posix.c" ${srcdest}build-aux/mes-snarf.scm src/posix.c trace "SNARF reader.c" ${srcdest}build-aux/mes-snarf.scm src/reader.c trace "SNARF vector.c" ${srcdest}build-aux/mes-snarf.scm src/vector.c -# cc64-mes -trace "SNARF.mes gc.c" ${srcdest}build-aux/mes-snarf.scm --mes src/gc.c -trace "SNARF.mes lib.c" ${srcdest}build-aux/mes-snarf.scm --mes src/lib.c -trace "SNARF.mes math.c" ${srcdest}build-aux/mes-snarf.scm --mes src/math.c -trace "SNARF.mes mes.c" ${srcdest}build-aux/mes-snarf.scm --mes src/mes.c -trace "SNARF.mes posix.c" ${srcdest}build-aux/mes-snarf.scm --mes src/posix.c -trace "SNARF.mes reader.c" ${srcdest}build-aux/mes-snarf.scm --mes src/reader.c -trace "SNARF.mes vector.c" ${srcdest}build-aux/mes-snarf.scm --mes src/vector.c - ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc.sh lib/libmes sh ${srcdest}build-aux/cc.sh src/mes - -ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/linux/x86_64-mes-gcc/crt0 -ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/linux/x86_64-mes-gcc/crt1 -ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/linux/x86_64-mes-gcc/crti -ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/linux/x86_64-mes-gcc/crtn -ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/libc-mini -ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/libc -ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/libc+tcc -ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/libtcc1 -ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/libc+gnu -ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/libg -ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/libgetopt - -LIBC= sh ${srcdest}build-aux/cc64-mes.sh scaffold/main -LIBC=c-mini sh ${srcdest}build-aux/cc64-mes.sh scaffold/hello -LIBC=c-mini sh ${srcdest}build-aux/cc64-mes.sh scaffold/argv -sh ${srcdest}build-aux/cc64-mes.sh scaffold/read -sh ${srcdest}build-aux/cc64-mes.sh scaffold/malloc -sh ${srcdest}build-aux/cc64-mes.sh scaffold/micro-mes -sh ${srcdest}build-aux/cc64-mes.sh scaffold/tiny-mes -# sh ${srcdest}build-aux/cc64-mes.sh scaffold/cons-mes -sh ${srcdest}build-aux/cc64-mes.sh scaffold/mini-mes - -sh ${srcdest}build-aux/cc64-mes.sh src/mes cp src/mes.gcc-out src/mes diff --git a/build-aux/build-cc64.sh b/build-aux/build-cc64.sh new file mode 100755 index 00000000..41304665 --- /dev/null +++ b/build-aux/build-cc64.sh @@ -0,0 +1,60 @@ +#! /bin/sh + +# GNU Mes --- Maxwell Equations of Software +# Copyright © 2018 Jan (janneke) Nieuwenhuizen +# +# This file is part of GNU Mes. +# +# GNU Mes is free software; you can redistribute it and/or modify it +# 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. +# +# GNU Mes is distributed in the hope that it will be useful, but +# 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 +# along with GNU Mes. If not, see . + +set -e + +. ${srcdest}build-aux/config.sh +. ${srcdest}build-aux/trace.sh + +LIBC=${LIBC-c} + +# cc64-mes +trace "SNARF.mes gc.c" ${srcdest}build-aux/mes-snarf.scm --mes src/gc.c +trace "SNARF.mes lib.c" ${srcdest}build-aux/mes-snarf.scm --mes src/lib.c +trace "SNARF.mes math.c" ${srcdest}build-aux/mes-snarf.scm --mes src/math.c +trace "SNARF.mes mes.c" ${srcdest}build-aux/mes-snarf.scm --mes src/mes.c +trace "SNARF.mes posix.c" ${srcdest}build-aux/mes-snarf.scm --mes src/posix.c +trace "SNARF.mes reader.c" ${srcdest}build-aux/mes-snarf.scm --mes src/reader.c +trace "SNARF.mes vector.c" ${srcdest}build-aux/mes-snarf.scm --mes src/vector.c + +ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/linux/x86_64-mes-gcc/crt0 +ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/linux/x86_64-mes-gcc/crt1 +ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/linux/x86_64-mes-gcc/crti +ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/linux/x86_64-mes-gcc/crtn +ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/libc-mini +ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/libc +ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/libc+tcc +ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/libtcc1 +ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/libc+gnu +ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/libg +ARCHDIR=1 NOLINK=1 sh ${srcdest}build-aux/cc64-mes.sh lib/libgetopt + +LIBC= sh ${srcdest}build-aux/cc64-mes.sh scaffold/main +LIBC=c-mini sh ${srcdest}build-aux/cc64-mes.sh scaffold/hello +LIBC=c-mini sh ${srcdest}build-aux/cc64-mes.sh scaffold/argv +sh ${srcdest}build-aux/cc64-mes.sh scaffold/read +sh ${srcdest}build-aux/cc64-mes.sh scaffold/malloc +sh ${srcdest}build-aux/cc64-mes.sh scaffold/micro-mes +sh ${srcdest}build-aux/cc64-mes.sh scaffold/tiny-mes +# sh ${srcdest}build-aux/cc64-mes.sh scaffold/cons-mes +sh ${srcdest}build-aux/cc64-mes.sh scaffold/mini-mes + +sh ${srcdest}build-aux/cc64-mes.sh src/mes +cp src/mes.x86_64-mes-gcc-out src/mes diff --git a/build-aux/build-x86_64-mes.sh b/build-aux/build-x86_64-mes.sh index d3468e3d..2d2d266c 100755 --- a/build-aux/build-x86_64-mes.sh +++ b/build-aux/build-x86_64-mes.sh @@ -133,13 +133,13 @@ ARCHDIR=1 NOLINK=1 bash ${srcdest}build-aux/cc-x86_64-mes.sh lib/libgetopt [ -n "$SEED" ] && exit 0 MES_ARENA=${MES_ARENA-100000000} -trace "MSNARF gc.c" ./pre-inst-env bash ${srcdest}build-aux/mes-snarf.scm --mes src/gc.c -trace "MSNARF lib.c" ./pre-inst-env bash ${srcdest}build-aux/mes-snarf.scm --mes src/lib.c -trace "MSNARF math.c" ./pre-inst-env bash ${srcdest}build-aux/mes-snarf.scm --mes src/math.c -trace "MSNARF mes.c" ./pre-inst-env bash ${srcdest}build-aux/mes-snarf.scm --mes src/mes.c -trace "MSNARF posix.c" ./pre-inst-env bash ${srcdest}build-aux/mes-snarf.scm --mes src/posix.c -trace "MSNARF reader.c" ./pre-inst-env bash ${srcdest}build-aux/mes-snarf.scm --mes src/reader.c -trace "MSNARF vector.c" ./pre-inst-env bash ${srcdest}build-aux/mes-snarf.scm --mes src/vector.c +trace "SNARF.mes gc.c" ./pre-inst-env bash ${srcdest}build-aux/mes-snarf.scm --mes src/gc.c +trace "SNARF.mes lib.c" ./pre-inst-env bash ${srcdest}build-aux/mes-snarf.scm --mes src/lib.c +trace "SNARF.mes math.c" ./pre-inst-env bash ${srcdest}build-aux/mes-snarf.scm --mes src/math.c +trace "SNARF.mes mes.c" ./pre-inst-env bash ${srcdest}build-aux/mes-snarf.scm --mes src/mes.c +trace "SNARF.mes posix.c" ./pre-inst-env bash ${srcdest}build-aux/mes-snarf.scm --mes src/posix.c +trace "SNARF.mes reader.c" ./pre-inst-env bash ${srcdest}build-aux/mes-snarf.scm --mes src/reader.c +trace "SNARF.mes vector.c" ./pre-inst-env bash ${srcdest}build-aux/mes-snarf.scm --mes src/vector.c echo MES_ARENA=$MES_ARENA bash ${srcdest}build-aux/cc-x86_64-mes.sh scaffold/main @@ -153,9 +153,9 @@ trace "TEST scaffold/main.x86_64-mes-out" echo scaffold/main.x86_64-mes-ou MES_LIBS='-l c-mini' bash ${srcdest}build-aux/cc-x86_64-mes.sh scaffold/hello MES_LIBS='-l c-mini' bash ${srcdest}build-aux/cc-x86_64-mes.sh scaffold/argv bash ${srcdest}build-aux/cc-x86_64-mes.sh scaffold/malloc -##sh ${srcdest}build-aux/cc-x86_64-mes.sh scaffold/micro-mes -##sh ${srcdest}build-aux/cc-x86_64-mes.sh scaffold/tiny-mes -# bash ${srcdest}build-aux/cc-x86_64-mes.sh scaffold/mini-mes +sh ${srcdest}build-aux/cc-x86_64-mes.sh scaffold/micro-mes +sh ${srcdest}build-aux/cc-x86_64-mes.sh scaffold/tiny-mes +bash ${srcdest}build-aux/cc-x86_64-mes.sh scaffold/mini-mes bash ${srcdest}build-aux/cc-x86_64-mes.sh src/mes # not yet, broken # cp src/mes.x86_64-mes-out src/mes diff --git a/build-aux/build.sh.in b/build-aux/build.sh.in index 7c289388..02e69545 100755 --- a/build-aux/build.sh.in +++ b/build-aux/build.sh.in @@ -44,6 +44,10 @@ if [ -n "$CC32" ]; then sh ${srcdest}build-aux/build-cc32.sh fi +if [ -n "$CC64" ]; then + sh ${srcdest}build-aux/build-cc64.sh +fi + if [ -n "$TCC" ]; then CC32=$TCC sh ${srcdest}build-aux/build-cc32.sh fi