Commit bf6dd2db authored by Maxim Pimenov's avatar Maxim Pimenov Committed by Russ Cox

various: use $GCFLAGS and $GCIMPORTS like Make does

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5489065
parent dd694fb1
...@@ -21,5 +21,5 @@ test: get.bin ...@@ -21,5 +21,5 @@ test: get.bin
$(LD) -o $@ $< $(LD) -o $@ $<
%.$O: %.go %.$O: %.go
$(GC) $*.go $(GC) $(GCFLAGS) $(GCIMPORTS) $*.go
...@@ -28,11 +28,11 @@ include ../../../src/Make.pkg ...@@ -28,11 +28,11 @@ include ../../../src/Make.pkg
# Computes 1000 digits of pi; single-threaded. # Computes 1000 digits of pi; single-threaded.
pi: install pi.go pi: install pi.go
$(GC) pi.go $(GC) $(GCFLAGS) $(GCIMPORTS) pi.go
$(LD) -o $@ pi.$O $(LD) -o $@ pi.$O
# Computes 200 Fibonacci numbers; multi-threaded. # Computes 200 Fibonacci numbers; multi-threaded.
fib: install fib.go fib: install fib.go
$(GC) fib.go $(GC) $(GCFLAGS) $(GCIMPORTS) fib.go
$(LD) -o $@ fib.$O $(LD) -o $@ fib.$O
...@@ -11,7 +11,7 @@ CGOFILES=\ ...@@ -11,7 +11,7 @@ CGOFILES=\
CGO_OFILES=\ CGO_OFILES=\
c-life.o\ c-life.o\
ifeq ($(GOOS),windows) ifeq ($(GOOS),windows)
ifeq ($(GOARCH),amd64) ifeq ($(GOARCH),amd64)
CGO_OFILES+=\ CGO_OFILES+=\
...@@ -31,5 +31,5 @@ CLEANFILES+=life ...@@ -31,5 +31,5 @@ CLEANFILES+=life
include ../../../src/Make.pkg include ../../../src/Make.pkg
life: install main.go life: install main.go
$(GC) main.go $(GC) $(GCFLAGS) $(GCIMPORTS) main.go
$(LD) -o $@ main.$O $(LD) -o $@ main.$O
...@@ -13,5 +13,5 @@ CLEANFILES+=hello fib chain run.out ...@@ -13,5 +13,5 @@ CLEANFILES+=hello fib chain run.out
include ../../../src/Make.pkg include ../../../src/Make.pkg
%: install %.go %: install %.go
$(GC) $*.go $(GC) $(GCFLAGS) $(GCIMPORTS) $*.go
$(LD) -o $@ $*.$O $(LD) -o $@ $*.$O
...@@ -18,5 +18,5 @@ libcgoso.so: cgoso_c.c ...@@ -18,5 +18,5 @@ libcgoso.so: cgoso_c.c
gcc cgoso_c.c -fPIC -o $@ $(_CGO_CFLAGS_$(GOARCH)) $(_CGO_LDFLAGS_$(GOOS)) gcc cgoso_c.c -fPIC -o $@ $(_CGO_CFLAGS_$(GOARCH)) $(_CGO_LDFLAGS_$(GOOS))
out: install main.go out: install main.go
$(GC) main.go $(GC) $(GCFLAGS) $(GCIMPORTS) main.go
$(LD) -o $@ main.$O $(LD) -o $@ main.$O
...@@ -13,5 +13,5 @@ CLEANFILES+=run ...@@ -13,5 +13,5 @@ CLEANFILES+=run
include ../../../src/Make.pkg include ../../../src/Make.pkg
%: install %.go %: install %.go
$(GC) $*.go $(GC) $(GCFLAGS) $(GCIMPORTS) $*.go
$(LD) $(SWIG_RPATH) -o $@ $*.$O $(LD) $(SWIG_RPATH) -o $@ $*.$O
...@@ -13,5 +13,5 @@ CLEANFILES+=hello ...@@ -13,5 +13,5 @@ CLEANFILES+=hello
include ../../../src/Make.pkg include ../../../src/Make.pkg
%: install %.go %: install %.go
$(GC) $*.go $(GC) $(GCFLAGS) $(GCIMPORTS) $*.go
$(LD) $(SWIG_RPATH) -o $@ $*.$O $(LD) $(SWIG_RPATH) -o $@ $*.$O
...@@ -12,7 +12,7 @@ include ../../Make.cmd ...@@ -12,7 +12,7 @@ include ../../Make.cmd
units: goyacc units.y units: goyacc units.y
./goyacc -p units_ units.y ./goyacc -p units_ units.y
$(GC) y.go $(GC) $(GCFLAGS) $(GCIMPORTS) y.go
$(LD) -o units y.$O $(LD) -o units y.$O
CLEANFILES += units y.go y.output CLEANFILES += units y.go y.output
...@@ -22,4 +22,4 @@ dump: dump.$O ...@@ -22,4 +22,4 @@ dump: dump.$O
$(LD) -o dump $< $(LD) -o dump $<
dump.$O: dump.go dump.$O: dump.go
$(GC) $< $(GC) $(GCFLAGS) $(GCIMPORTS) $<
...@@ -19,15 +19,15 @@ include ../../../Make.pkg ...@@ -19,15 +19,15 @@ include ../../../Make.pkg
CLEANFILES+=maketables maketesttables CLEANFILES+=maketables maketesttables
maketables: maketables.go triegen.go maketables: maketables.go triegen.go
$(GC) maketables.go triegen.go $(GC) $(GCFLAGS) $(GCIMPORTS) maketables.go triegen.go
$(LD) -o maketables maketables.$O $(LD) -o maketables maketables.$O
maketesttables: maketesttables.go triegen.go maketesttables: maketesttables.go triegen.go
$(GC) maketesttables.go triegen.go $(GC) $(GCFLAGS) $(GCIMPORTS) maketesttables.go triegen.go
$(LD) -o maketesttables maketesttables.$O $(LD) -o maketesttables maketesttables.$O
normregtest: normregtest.go normregtest: normregtest.go
$(GC) normregtest.go $(GC) $(GCFLAGS) $(GCIMPORTS) normregtest.go
$(LD) -o normregtest normregtest.$O $(LD) -o normregtest normregtest.$O
tables: maketables tables: maketables
......
...@@ -15,5 +15,5 @@ include ../../../Make.pkg ...@@ -15,5 +15,5 @@ include ../../../Make.pkg
# Script to test heading detection heuristic # Script to test heading detection heuristic
CLEANFILES+=headscan CLEANFILES+=headscan
headscan: headscan.go headscan: headscan.go
$(GC) headscan.go $(GC) $(GCFLAGS) $(GCIMPORTS) headscan.go
$(LD) -o headscan headscan.$(O) $(LD) -o headscan headscan.$(O)
...@@ -17,7 +17,7 @@ include ../../Make.pkg ...@@ -17,7 +17,7 @@ include ../../Make.pkg
CLEANFILES+=maketables CLEANFILES+=maketables
maketables: maketables.go maketables: maketables.go
$(GC) maketables.go $(GC) $(GCFLAGS) $(GCIMPORTS) maketables.go
$(LD) -o maketables maketables.$O $(LD) -o maketables maketables.$O
tables: maketables tables: maketables
......
...@@ -12,7 +12,7 @@ ALL=\ ...@@ -12,7 +12,7 @@ ALL=\
all: $(addsuffix .out, $(ALL)) all: $(addsuffix .out, $(ALL))
%.$O: %.go stats.go %.$O: %.go stats.go
$(GC) $*.go stats.go $(GC) $(GCFLAGS) $(GCIMPORTS) $*.go stats.go
%.out: %.$O %.out: %.$O
$(LD) -o $@ $*.$O $(LD) -o $@ $*.$O
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment