1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-20 20:18:05 +11:00
collapseos/tools/zasm.sh

23 lines
666 B
Bash
Raw Normal View History

#!/usr/bin/env bash
# readlink -f doesn't work with macOS's implementation
# so, if we can't get readlink -f to work, try python with a realpath implementation
2019-10-16 13:41:44 +11:00
ABS_PATH=$(readlink -f "$0" || python -c "import os; print(os.path.realpath('$0'))")
# wrapper around ./emul/zasm/zasm that prepares includes CFS prior to call
DIR=$(dirname "${ABS_PATH}")
ZASMBIN="${DIR}/emul/zasm/zasm"
CFSPACK="${DIR}/cfspack/cfspack"
INCCFS=$(mktemp)
for p in "$@"; do
2019-07-12 11:21:54 +10:00
"${CFSPACK}" "${p}" "*.h" >> "${INCCFS}"
"${CFSPACK}" "${p}" "*.asm" >> "${INCCFS}"
"${CFSPACK}" "${p}" "*.bin" >> "${INCCFS}"
done
"${ZASMBIN}" "${INCCFS}"
RES=$?
rm "${INCCFS}"
exit $RES