Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
615B

  1. #!/usr/bin/env bash
  2. # readlink -f doesn't work with macOS's implementation
  3. # so, if we can't get readlink -f to work, try python with a realpath implementation
  4. ABS_PATH=$(readlink -f "$0" || python -c "import os; print(os.path.realpath('$0'))")
  5. # wrapper around ./emul/zasm/zasm that prepares includes CFS prior to call
  6. DIR=$(dirname "${ABS_PATH}")
  7. ZASMBIN="${DIR}/emul/zasm/zasm"
  8. CFSPACK="${DIR}/cfspack/cfspack"
  9. INCCFS=$(mktemp)
  10. for p in "$@"; do
  11. "${CFSPACK}" "${p}" "*.h" >> "${INCCFS}"
  12. "${CFSPACK}" "${p}" "*.asm" >> "${INCCFS}"
  13. done
  14. "${ZASMBIN}" "${INCCFS}"
  15. RES=$?
  16. rm "${INCCFS}"
  17. exit $RES