#!/bin/sh
cat << 'EEE' > /dev/null
/* Copyright (C) 2021 Momi-g
 *
 * This program 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.
 *
 * This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
 */
EEE

set -eu
(
# extend.sh dst ... dstにソースを展開する。
pdir=`pwd`	#parent, callsrc dir
cd `dirname $0`	#base $0 dir
bdir=`pwd`
cd ..
topdir=`pwd`	#configure root

cd ./seed
# copy, extend, delete
# buf=`ls *.lua||:`
# [ ${#buf} = 0 ] || (for ii in $buf; do cp $ii ../src;done)
buf=`ls *.sh.c||:`
[ ${#buf} = 0 ] || (for ii in $buf; do cp $ii ../src;done)

cd ../src
for ii in *.sh.c; do
	sh "$ii" -W
done
# rf系が失敗するので再実行
for ii in *.sh.c; do
	sh "$ii" -W
done
rm *.tmp.c *.ts.c *.sh.c 2>/dev/null|| :
)
