mksysnum_plan9.sh 614 B

12345678910111213141516171819202122232425
  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. COMMAND="mksysnum_plan9.sh $@"
  8. cat <<EOF
  9. // $COMMAND
  10. // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
  11. package plan9
  12. const(
  13. EOF
  14. SP='[ ]' # space or tab
  15. sed "s/^#define${SP}\\([A-Z0-9_][A-Z0-9_]*\\)${SP}${SP}*\\([0-9][0-9]*\\)/SYS_\\1=\\2/g" \
  16. < $1 | grep -v SYS__
  17. cat <<EOF
  18. )
  19. EOF