oxytoxin

unix-like kernel
git clone git://git.evenfri.xyz/oxytoxin.git
Log | Files | Refs | README | LICENSE

as (477B)


      1 #!/bin/sh
      2 
      3 s_file=""
      4 o_file=""
      5 
      6 while [ $# -gt 0 ]; do
      7   case "$1" in
      8     -o)
      9       o_file="$2"
     10       shift 2
     11       ;;
     12     -o*)
     13       o_file="${1#-o}"
     14       shift 1
     15       ;;
     16     *.s|*.S|*.asm)
     17       s_file="$1"
     18       shift 1
     19       ;;
     20     *)
     21       shift 1
     22       ;;
     23   esac
     24 done
     25 
     26 if [ -z "$s_file" ]; then
     27   echo "as-wrapper error: no input assembly file provided" >&2
     28   exit 1
     29 fi
     30 
     31 if [ -z "$o_file" ]; then
     32   o_file="${s_file%.*}.o"
     33 fi
     34 
     35 exec nasm -f elf32 "$s_file" -o "$o_file"