Skip to content

Instantly share code, notes, and snippets.

@quagly
Last active January 11, 2024 11:34
Show Gist options
  • Save quagly/66fffae172ebbd9820f55b2da128d413 to your computer and use it in GitHub Desktop.
Save quagly/66fffae172ebbd9820f55b2da128d413 to your computer and use it in GitHub Desktop.
compile a few simh simulators
#!/usr/bin/env bash
#
# The nice cmake parallel compile system that simh offers fails
# on console only linux systems that do not have X11 / SDL / MESA graphical libraries
# as some sims require them. Perhaps there is some configuration for this.
# For now I am just compiling the couple of sims that I use single threaded.
# If this gets slow and/or annoying then look at cmake again.
set -euf -o pipefail
declare -rx GIT_DIR="${HOME}/repos/simh/.git"
declare -r -a SIMS=(
"pdp11"
"microvax2"
"vax780"
)
# update project
git fetch
if [ "$(git rev-parse HEAD)" == "$(git rev-parse @"{u}")" ]; then
echo "project not updated, nothing to do"
exit 0
fi
for sim in "${SIMS[@]}"
do
echo "compiling ${sim}"
make clean
make "${sim}"
cp "./BIN/${sim}" "${HOME}/bin/"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment