--- a/src/cmd/cov/Makefile
+++ b/src/cmd/cov/Makefile
@@ -20,11 +20,7 @@ HFILES=\
 NOINSTALL=1
 include ../../Make.ccmd
 
-ifeq ($(GOOS),windows)
-NAME=windows
-else
-NAME=$(shell uname | tr A-Z a-z)
-endif
+NAME=$(GOOS)
 
 install: install-$(NAME)
 install-linux: install-default
--- a/src/cmd/prof/Makefile
+++ b/src/cmd/prof/Makefile
@@ -16,11 +16,7 @@ OFILES=\
 NOINSTALL=1
 include ../../Make.ccmd
 
-ifeq ($(GOOS),windows)
-NAME=windows
-else
-NAME=$(shell uname | tr A-Z a-z)
-endif
+NAME=$(GOOS)
 
 install: install-$(NAME) install-pprof
 install-linux: install-default
--- a/src/pkg/syscall/mkerrors.sh
+++ b/src/pkg/syscall/mkerrors.sh
@@ -15,7 +15,7 @@ GCC=gcc
 
 uname=$(uname)
 
-includes_Darwin='
+includes_darwin='
 #define _DARWIN_C_SOURCE
 #define KERNEL
 #define _DARWIN_USE_64_BIT_INODE
@@ -37,7 +37,7 @@ includes_Darwin='
 #include <termios.h>
 '
 
-includes_FreeBSD='
+includes_freebsd='
 #include <sys/types.h>
 #include <sys/event.h>
 #include <sys/socket.h>
@@ -55,7 +55,7 @@ includes_FreeBSD='
 #include <netinet/ip_mroute.h>
 '
 
-includes_Linux='
+includes_linux='
 #define _LARGEFILE_SOURCE
 #define _LARGEFILE64_SOURCE
 #define _FILE_OFFSET_BITS 64
@@ -151,7 +151,7 @@ ccflags="$@"
 	echo package syscall
 	echo
 	echo '/*'
-	indirect="includes_$(uname)"
+	indirect="includes_$(GOOS)"
 	echo "${!indirect} $includes"
 	echo '*/'
 	echo 'import "C"'
--- a/src/pkg/net/Makefile
+++ b/src/pkg/net/Makefile
@@ -82,7 +82,7 @@ GOFILES_freebsd=\
 
 ifeq ($(CGO_ENABLED),1)
 CGOFILES_freebsd=\
-	cgo_bsd.go\
+	cgo_linux.go\
 	cgo_unix.go
 else
 GOFILES_freebsd+=cgo_stub.go
