Use a common mount/ directory

This commit is contained in:
Joshua Bell 2018-11-25 21:16:39 -08:00
parent da715ed9ce
commit 4689d3ea84
7 changed files with 86 additions and 84 deletions

View File

@ -3,22 +3,7 @@
# Run this from the desk.acc directory # Run this from the desk.acc directory
set -e set -e
source "../res/util.sh"
function cecho {
case $1 in
red) tput setaf 1 ;;
green) tput setaf 2 ;;
yellow) tput setaf 3 ;;
esac
echo -e "$2"
tput sgr0
}
function do_make {
make $MAKE_FLAGS "$1" \
&& (cecho green "make $1 good") \
|| (tput blink ; cecho red "MAKE $1 BAD" ; return 1)
}
function verify { function verify {
diff "orig/$1.bin" "out/$1.built" \ diff "orig/$1.bin" "out/$1.built" \
@ -48,8 +33,3 @@ stats "show.text.file.s"
stats "date.s" stats "date.s"
stats "puzzle.s" stats "puzzle.s"
stats "sort.directory.s" stats "sort.directory.s"
# Mountable directory for Virtual ][
if [ -d mount ]; then
res/mount.sh
fi

View File

@ -1,31 +0,0 @@
#!/bin/bash
# Run this from the desk.acc directory
set -e
function cecho {
case $1 in
red) tput setaf 1 ;;
green) tput setaf 2 ;;
yellow) tput setaf 3 ;;
esac
echo -e "$2"
tput sgr0
}
function mount {
uppercase=$(echo "$1" | tr /a-z/ /A-Z/)
src="out/$1.built"
dst="mount/$uppercase.\$F1"
cp "$src" "$dst" \
&& xattr -wx prodos.AuxType '40 06' "$dst" \
&& (cecho green "mounted $dst" ) \
|| (cecho red "failed to mount $dst" ; return 1)
}
mkdir -p mount
echo "Copying files to mount/"
for file in $(cat TARGETS); do
mount "$file"
done

View File

@ -1,22 +1,9 @@
#!/bin/bash #!/bin/bash
# Run this from the desktop.system directory
set -e set -e
source "../res/util.sh"
function cecho {
case $1 in
red) tput setaf 1 ;;
green) tput setaf 2 ;;
yellow) tput setaf 3 ;;
esac
echo -e "$2"
tput sgr0
}
function do_make {
make $MAKE_FLAGS "$1" \
&& (cecho green "make $1 good") \
|| (tput blink ; cecho red "MAKE $1 BAD" ; return 1)
}
function verify { function verify {
diff "orig/$1" "out/$2" \ diff "orig/$1" "out/$2" \

View File

@ -1,22 +1,9 @@
#!/bin/bash #!/bin/bash
# Run this from the desktop directory
set -e set -e
source "../res/util.sh"
function cecho {
case $1 in
red) tput setaf 1 ;;
green) tput setaf 2 ;;
yellow) tput setaf 3 ;;
esac
echo -e "$2"
tput sgr0
}
function do_make {
make $MAKE_FLAGS "$1" \
&& (cecho green "make $1 good") \
|| (tput blink ; cecho red "MAKE $1 BAD" ; return 1)
}
function verify { function verify {
diff "orig/$1" "out/$2" \ diff "orig/$1" "out/$2" \

22
res/go.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/bash
# Run this from the top level directory
set -e
cd desktop.system
res/go.sh
cd ..
cd desktop
res/go.sh
cd ..
cd desk.acc
res/go.sh
cd ..
# Mountable directory for Virtual ][
if [ -d mount ]; then
res/mount.sh
fi

42
res/mount.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/bash
# Run this from the top level directory
source "res/util.sh"
set -e
mkdir -p mount/desk.acc
function mount_f1 {
srcdir="$2"
dstdir="$3"
uppercase=$(echo "$1" | tr /a-z/ /A-Z/)
src="$srcdir/out/$1.built"
dst="$dstdir/$uppercase.\$F1"
cp "$src" "$dst" \
&& xattr -wx prodos.AuxType '40 06' "$dst" \
&& (cecho green "mounted $dst" ) \
|| (cecho red "failed to mount $dst" ; return 1)
}
function mount_sys {
srcdir="$2"
dstdir="$3"
uppercase=$(echo "$1" | tr /a-z/ /A-Z/)
src="$srcdir/out/$1.SYS"
dst="$dstdir/$uppercase.SYS"
cp "$src" "$dst" \
&& (cecho green "mounted $dst" ) \
|| (cecho red "failed to mount $dst" ; return 1)
}
targets=$(cat desk.acc/TARGETS)
mkdir -p mount
echo "Copying files to mount/"
for file in $targets; do
mount_f1 "$file" "desk.acc" "mount/desk.acc"
done
mount_f1 "desktop2" "desktop" "mount"
mount_sys "desktop.system" "desktop.system" "mount"

15
res/util.sh Normal file
View File

@ -0,0 +1,15 @@
function cecho {
case $1 in
red) tput setaf 1 ;;
green) tput setaf 2 ;;
yellow) tput setaf 3 ;;
esac
echo -e "$2"
tput sgr0
}
function do_make {
make $MAKE_FLAGS "$1" \
&& (cecho green "make $1 good") \
|| (tput blink ; cecho red "MAKE $1 BAD" ; return 1)
}