various: use $GCFLAGS and $GCIMPORTS like Make does

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5489065
diff --git a/doc/codelab/wiki/Makefile b/doc/codelab/wiki/Makefile
index 5521011..233917f 100644
--- a/doc/codelab/wiki/Makefile
+++ b/doc/codelab/wiki/Makefile
@@ -21,5 +21,5 @@
 	$(LD) -o $@ $<
 
 %.$O: %.go
-	$(GC) $*.go
+	$(GC) $(GCFLAGS) $(GCIMPORTS) $*.go
 
diff --git a/misc/cgo/gmp/Makefile b/misc/cgo/gmp/Makefile
index fc6209f..d9390c1 100644
--- a/misc/cgo/gmp/Makefile
+++ b/misc/cgo/gmp/Makefile
@@ -28,11 +28,11 @@
 
 # Computes 1000 digits of pi; single-threaded.
 pi: install pi.go
-	$(GC) pi.go
+	$(GC) $(GCFLAGS) $(GCIMPORTS) pi.go
 	$(LD) -o $@ pi.$O
 
 # Computes 200 Fibonacci numbers; multi-threaded.
 fib: install fib.go
-	$(GC) fib.go
+	$(GC) $(GCFLAGS) $(GCIMPORTS) fib.go
 	$(LD) -o $@ fib.$O
 
diff --git a/misc/cgo/life/Makefile b/misc/cgo/life/Makefile
index 39ec13b..1568a67 100644
--- a/misc/cgo/life/Makefile
+++ b/misc/cgo/life/Makefile
@@ -11,7 +11,7 @@
 
 CGO_OFILES=\
 	c-life.o\
-	
+
 ifeq ($(GOOS),windows)
 ifeq ($(GOARCH),amd64)
 CGO_OFILES+=\
@@ -31,5 +31,5 @@
 include ../../../src/Make.pkg
 
 life: install main.go
-	$(GC) main.go
+	$(GC) $(GCFLAGS) $(GCIMPORTS) main.go
 	$(LD) -o $@ main.$O
diff --git a/misc/cgo/stdio/Makefile b/misc/cgo/stdio/Makefile
index 3f7a4c0..586132b 100644
--- a/misc/cgo/stdio/Makefile
+++ b/misc/cgo/stdio/Makefile
@@ -13,5 +13,5 @@
 include ../../../src/Make.pkg
 
 %: install %.go
-	$(GC) $*.go
+	$(GC) $(GCFLAGS) $(GCIMPORTS) $*.go
 	$(LD) -o $@ $*.$O
diff --git a/misc/cgo/testso/Makefile b/misc/cgo/testso/Makefile
index bee80af..e472cf2 100644
--- a/misc/cgo/testso/Makefile
+++ b/misc/cgo/testso/Makefile
@@ -18,5 +18,5 @@
 	gcc cgoso_c.c -fPIC -o $@ $(_CGO_CFLAGS_$(GOARCH)) $(_CGO_LDFLAGS_$(GOOS))
 
 out: install main.go
-	$(GC) main.go
+	$(GC) $(GCFLAGS) $(GCIMPORTS) main.go
 	$(LD) -o $@ main.$O
diff --git a/misc/swig/callback/Makefile b/misc/swig/callback/Makefile
index fde0d10..0ca33ef 100644
--- a/misc/swig/callback/Makefile
+++ b/misc/swig/callback/Makefile
@@ -13,5 +13,5 @@
 include ../../../src/Make.pkg
 
 %: install %.go
-	$(GC) $*.go
+	$(GC) $(GCFLAGS) $(GCIMPORTS) $*.go
 	$(LD) $(SWIG_RPATH) -o $@ $*.$O
diff --git a/misc/swig/stdio/Makefile b/misc/swig/stdio/Makefile
index e7d3305..0f23345e 100644
--- a/misc/swig/stdio/Makefile
+++ b/misc/swig/stdio/Makefile
@@ -13,5 +13,5 @@
 include ../../../src/Make.pkg
 
 %: install %.go
-	$(GC) $*.go
+	$(GC) $(GCFLAGS) $(GCIMPORTS) $*.go
 	$(LD) $(SWIG_RPATH) -o $@ $*.$O
diff --git a/src/cmd/goyacc/Makefile b/src/cmd/goyacc/Makefile
index 87b3470..a616e85 100644
--- a/src/cmd/goyacc/Makefile
+++ b/src/cmd/goyacc/Makefile
@@ -12,7 +12,7 @@
 
 units: goyacc units.y
 	./goyacc -p units_ units.y
-	$(GC) y.go
+	$(GC) $(GCFLAGS) $(GCIMPORTS) y.go
 	$(LD) -o units y.$O
 
 CLEANFILES += units y.go y.output
diff --git a/src/pkg/encoding/gob/Makefile b/src/pkg/encoding/gob/Makefile
index 6c7693c..3847edb 100644
--- a/src/pkg/encoding/gob/Makefile
+++ b/src/pkg/encoding/gob/Makefile
@@ -22,4 +22,4 @@
 	$(LD) -o dump $<
 
 dump.$O:	dump.go
-	$(GC) $<
+	$(GC) $(GCFLAGS) $(GCIMPORTS) $<
diff --git a/src/pkg/exp/norm/Makefile b/src/pkg/exp/norm/Makefile
index b3eca10..b4faa24 100644
--- a/src/pkg/exp/norm/Makefile
+++ b/src/pkg/exp/norm/Makefile
@@ -19,15 +19,15 @@
 CLEANFILES+=maketables maketesttables
 
 maketables: maketables.go triegen.go
-	$(GC) maketables.go triegen.go
+	$(GC) $(GCFLAGS) $(GCIMPORTS) maketables.go triegen.go
 	$(LD) -o maketables maketables.$O
 
 maketesttables: maketesttables.go triegen.go
-	$(GC) maketesttables.go triegen.go
+	$(GC) $(GCFLAGS) $(GCIMPORTS) maketesttables.go triegen.go
 	$(LD) -o maketesttables maketesttables.$O
 
 normregtest: normregtest.go
-	$(GC) normregtest.go
+	$(GC) $(GCFLAGS) $(GCIMPORTS) normregtest.go
 	$(LD) -o normregtest normregtest.$O
 
 tables:	maketables
diff --git a/src/pkg/go/doc/Makefile b/src/pkg/go/doc/Makefile
index 0330757..2a421c3 100644
--- a/src/pkg/go/doc/Makefile
+++ b/src/pkg/go/doc/Makefile
@@ -15,5 +15,5 @@
 # Script to test heading detection heuristic
 CLEANFILES+=headscan
 headscan: headscan.go
-	$(GC) headscan.go
+	$(GC) $(GCFLAGS) $(GCIMPORTS) headscan.go
 	$(LD) -o headscan headscan.$(O)
diff --git a/src/pkg/unicode/Makefile b/src/pkg/unicode/Makefile
index 55ed5b2..4472a6c 100644
--- a/src/pkg/unicode/Makefile
+++ b/src/pkg/unicode/Makefile
@@ -17,7 +17,7 @@
 CLEANFILES+=maketables
 
 maketables: maketables.go
-	$(GC) maketables.go
+	$(GC) $(GCFLAGS) $(GCIMPORTS) maketables.go
 	$(LD) -o maketables maketables.$O
 
 tables:	maketables
diff --git a/test/bench/garbage/Makefile b/test/bench/garbage/Makefile
index 916add7..cf6568f 100644
--- a/test/bench/garbage/Makefile
+++ b/test/bench/garbage/Makefile
@@ -12,7 +12,7 @@
 all: $(addsuffix .out, $(ALL))
 
 %.$O: %.go stats.go
-	$(GC) $*.go stats.go
+	$(GC) $(GCFLAGS) $(GCIMPORTS) $*.go stats.go
 
 %.out: %.$O
 	$(LD) -o $@ $*.$O