1
0
mirror of https://github.com/golang/go synced 2024-11-22 03:44:39 -07:00

build: pass $GCFLAGS to compiler

For example, if you are debugging an optimization
problem you can now run

        GCFLAGS=-N gotest

This is a convention for make, not for the general build,
so it may go away or be done differently in the eventual
'go' command.

The plan is that people will be able to test their code for
rune safety by doing GCFLAGS=-r.

R=golang-dev, bradfitz, lvd
CC=golang-dev
https://golang.org/cl/5294042
This commit is contained in:
Russ Cox 2011-10-18 14:55:10 -04:00
parent 565793996c
commit 389d55fadf
3 changed files with 5 additions and 5 deletions

View File

@ -20,7 +20,7 @@ $(TARG): _go_.$O
$(LD) $(LDIMPORTS) -o $@ _go_.$O $(LD) $(LDIMPORTS) -o $@ _go_.$O
_go_.$O: $(GOFILES) $(PREREQ) _go_.$O: $(GOFILES) $(PREREQ)
$(GC) $(GCIMPORTS) -o $@ $(GOFILES) $(GC) $(GCFLAGS) $(GCIMPORTS) -o $@ $(GOFILES)
install: $(TARGDIR)/$(TARG) install: $(TARGDIR)/$(TARG)
@ -44,7 +44,7 @@ _test/main.a: _gotest_.$O
gopack grc $@ _gotest_.$O gopack grc $@ _gotest_.$O
_gotest_.$O: $(GOFILES) $(GOTESTFILES) _gotest_.$O: $(GOFILES) $(GOTESTFILES)
$(GC) $(GCIMPORTS) -o $@ $(GOFILES) $(GOTESTFILES) $(GC) $(GCFLAGS) $(GCIMPORTS) -o $@ $(GOFILES) $(GOTESTFILES)
importpath: importpath:
echo main echo main

View File

@ -83,10 +83,10 @@ $(TARGDIR)/$(TARG).a: _obj/$(TARG).a
cp _obj/$(TARG).a "$@" cp _obj/$(TARG).a "$@"
_go_.$O: $(GOFILES) $(PREREQ) _go_.$O: $(GOFILES) $(PREREQ)
$(GC) $(GCIMPORTS) -p $(TARG) -o $@ $(GOFILES) $(GC) $(GCFLAGS) $(GCIMPORTS) -p $(TARG) -o $@ $(GOFILES)
_gotest_.$O: $(GOFILES) $(GOTESTFILES) $(PREREQ) _gotest_.$O: $(GOFILES) $(GOTESTFILES) $(PREREQ)
$(GC) $(GCIMPORTS) -p $(TARG) -o $@ $(GOFILES) $(GOTESTFILES) $(GC) $(GCFLAGS) $(GCIMPORTS) -p $(TARG) -o $@ $(GOFILES) $(GOTESTFILES)
_obj/$(TARG).a: _go_.$O $(OFILES) _obj/$(TARG).a: _go_.$O $(OFILES)
@mkdir -p _obj/$(dir) @mkdir -p _obj/$(dir)

View File

@ -23,7 +23,7 @@ Xarm)
exit 1 exit 1
esac esac
export G=${A}g export G="${A}g ${GCFLAGS}"
export L=${A}l export L=${A}l
export GOTRACEBACK=0 export GOTRACEBACK=0
export LANG=C export LANG=C