mswindres 636 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. if [ "$1" = "--version" ]; then
  3. rc.exe -?
  4. exit $?
  5. fi
  6. if [ $# -lt 2 ]; then
  7. echo "Usage: mswindres [-I/include/path ...] [-DSOME_DEFINE ...] [-o output.o] input.rc [output.o]" >&2
  8. exit 0
  9. fi
  10. EXTRA_OPTS="-nologo"
  11. while [ $# -gt 2 ]; do
  12. case $1 in
  13. -D*) EXTRA_OPTS="$EXTRA_OPTS -d$(echo $1 | sed -e "s/^..//" -e "s/ /\\\\ /g")" ;;
  14. -I*) EXTRA_OPTS="$EXTRA_OPTS -i$(echo $1 | sed -e "s/^..//" -e "s/ /\\\\ /g")" ;;
  15. -o) OPT_OUT="$2"; shift ;;
  16. esac
  17. shift
  18. done
  19. IN="$1"
  20. if [ -z "$OPT_OUT" ]; then
  21. OUT="$2"
  22. else
  23. OUT="$OPT_OUT"
  24. fi
  25. eval set -- $EXTRA_OPTS
  26. rc.exe "$@" -fo "$OUT" "$IN"