| git.druid.rocks | index | druid520 | nscc | mk/ | b.sh |
mk/b.sh
. ./mk.conf
set -e
rm -rf $out
mkdir $out
# perl syntax gate, same as mp's: every stage and jcplib module must
# compile cleanly (perl -c) before any of it is installed -- a syntax
# error that only surfaces the first time a stage actually runs would
# otherwise ship silently. both streams silenced: perl prints "syntax
# OK" to stdout on old perls and to stderr on new ones, and neither is
# worth a line of build noise. -I$src lets stages resolve jcplib::*
# imports regardless of where their own FindBin resolves to.
for f in $src/*.pl $src/jcplib/*.pm; do
perl -I"$src" -c "$f" > /dev/null 2>&1 || { echo "err: perl syntax check failed: $f." >&2; exit 1; }
done
# the driver installs as bare "nscc" (the one thing the user invokes,
# same role mp's own bare "mp" plays there); every stage installs as
# its bare name too (jlex0, jparse1, ... -- mp's own mp.<command>
# convention). the .pl/.sh suffixes are strictly a src/ thing.
$ln $lnflgs "../$src/nscc.sh" "$out/nscc"
for f in $src/*.pl; do
$ln $lnflgs "../$f" "$out/$(basename "$f" .pl)"
done
# jcplib installs as a whole directory next to the stages (the driver
# puts its own dir on PERL5LIB, so the modules resolve wherever the
# driver resolves).
rm -rf "$out/jcplib"
mkdir "$out/jcplib"
for f in $src/jcplib/*.pm; do
$ln $lnflgs "../../$f" "$out/jcplib/$(basename "$f")"
done