github.com/tcnksm/go@v0.0.0-20141208075154-439b32936367/src/syscall/mksysnum_plan9.sh (about)

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