Home | History | Annotate | Download | only in syscall
      1 #!/bin/sh
      2 # Copyright 2009 The Go Authors. All rights reserved.
      3 # Use of this source code is governed by a BSD-style
      4 # license that can be found in the LICENSE file.
      5 
      6 COMMAND="mksysnum_plan9.sh $@"
      7 
      8 cat <<EOF
      9 // $COMMAND
     10 // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
     11 
     12 package syscall
     13 
     14 const(
     15 EOF
     16 
     17 SP='[ 	]' # space or tab
     18 sed "s/^#define${SP}\\([A-Z0-9_][A-Z0-9_]*\\)${SP}${SP}*\\([0-9][0-9]*\\)/SYS_\\1=\\2/g" \
     19 	< $1 | grep -v SYS__
     20 
     21 cat <<EOF
     22 )
     23 EOF
     24