2018-07-21 22:43:39 +00:00
|
|
|
# GNU Mes --- Maxwell Equations of Software
|
|
|
|
# Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
|
|
|
#
|
|
|
|
# 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
2019-06-08 13:36:22 +00:00
|
|
|
LOG=
|
2019-05-29 14:55:57 +00:00
|
|
|
if [ -z "$V" -o "$V" = 0 ]; then
|
2018-10-05 19:24:14 +00:00
|
|
|
trace () {
|
2018-07-21 22:43:39 +00:00
|
|
|
echo " $1"
|
|
|
|
shift
|
2019-06-08 13:36:22 +00:00
|
|
|
echo "$@" >> build.log
|
|
|
|
eval "$@ $LOG"
|
|
|
|
cat .log 1>&2
|
|
|
|
cat .log >> build.log
|
2018-07-21 22:43:39 +00:00
|
|
|
}
|
2019-06-08 13:36:22 +00:00
|
|
|
LOG=" >.log 2>&1"
|
2018-07-21 22:43:39 +00:00
|
|
|
fi
|
|
|
|
if [ "$V" = 1 ]; then
|
2018-10-05 19:24:14 +00:00
|
|
|
trace () {
|
2018-07-21 22:43:39 +00:00
|
|
|
shift
|
|
|
|
echo "$@"
|
2019-06-08 13:36:22 +00:00
|
|
|
echo "$@" >> build.log
|
2018-07-21 22:43:39 +00:00
|
|
|
eval "$@ $LOG"
|
2019-06-08 13:36:22 +00:00
|
|
|
cat .log 1>&2
|
|
|
|
cat .log >> build.log
|
2018-07-21 22:43:39 +00:00
|
|
|
}
|
2019-06-08 13:36:22 +00:00
|
|
|
LOG=" >.log 2>&1"
|
2018-07-21 22:43:39 +00:00
|
|
|
fi
|
|
|
|
if [ "$V" = 2 ]; then
|
|
|
|
set -x
|
2018-10-05 19:24:14 +00:00
|
|
|
trace () {
|
2018-07-21 22:43:39 +00:00
|
|
|
shift
|
2019-06-08 13:36:22 +00:00
|
|
|
echo "$@" >> build.log
|
2018-07-21 22:43:39 +00:00
|
|
|
eval "$@"
|
|
|
|
}
|
|
|
|
fi
|