mktypes.bash 336 B

12345678910111213141516171819
  1. #!/usr/bin/env bash
  2. GOOSARCH="${GOOS}_${GOARCH}"
  3. case "$GOOSARCH" in
  4. _* | *_ | _)
  5. echo 'undefined $GOOS_$GOARCH:' "$GOOSARCH" 1>&2
  6. exit 1
  7. ;;
  8. esac
  9. GODEFS="go tool cgo -godefs"
  10. $GODEFS types.go |gofmt > ztypes_$GOARCH.go
  11. case $GOOS in
  12. freebsd|dragonfly|netbsd|openbsd)
  13. $GODEFS types_$GOOS.go |gofmt > ztypes_$GOOSARCH.go
  14. ;;
  15. esac