scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

mktbl (369B)


      1 #!/bin/sh
      2 
      3 for i
      4 do
      5 	case "$1" in
      6 	-t)
      7 		target=$2
      8 		shift 2
      9 		;;
     10 	-o)
     11 		out=$2
     12 		shift 2
     13 		;;
     14 	-*)
     15 		echo mktbl [-t target][-o file] >&2
     16 		exit 1
     17 		;;
     18 	*)
     19 		break
     20 		;;
     21 	esac
     22 done
     23 
     24 cat < formats.lst > $out <<EOF
     25 #include <stdio.h>
     26 #include <scc/mach.h>
     27 #include "libmach.h"
     28 
     29 ${target}fun_t ${target}v[] = {
     30 `while read i
     31  do
     32 	printf "\t%s," ${i}${target}
     33  done`
     34 };
     35 EOF