2019-10-10 15:21:37 -04:00
|
|
|
#!/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
|
|
|
|
ABS_PATH=$(readlink -f "$0" || python -c "import sys, os; print(os.path.realpath('$0'))")
|
2019-06-02 15:50:59 -04:00
|
|
|
|
|
|
|
# wrapper around ./emul/zasm/zasm that prepares includes CFS prior to call
|
2019-10-10 15:21:37 -04:00
|
|
|
DIR=$(dirname "${ABS_PATH}")
|
2019-06-02 15:50:59 -04:00
|
|
|
ZASMBIN="${DIR}/emul/zasm/zasm"
|
2019-06-02 19:54:37 -04:00
|
|
|
CFSPACK="${DIR}/cfspack/cfspack"
|
|
|
|
INCCFS=$(mktemp)
|
|
|
|
|
|
|
|
for p in "$@"; do
|
2019-07-11 21:21:54 -04:00
|
|
|
"${CFSPACK}" "${p}" "*.h" >> "${INCCFS}"
|
|
|
|
"${CFSPACK}" "${p}" "*.asm" >> "${INCCFS}"
|
2019-06-02 19:54:37 -04:00
|
|
|
done
|
|
|
|
|
2019-06-02 15:50:59 -04:00
|
|
|
"${ZASMBIN}" "${INCCFS}"
|
2019-06-02 19:54:37 -04:00
|
|
|
RES=$?
|
|
|
|
rm "${INCCFS}"
|
|
|
|
exit $RES
|