1
0
mirror of https://github.com/golang/go synced 2024-10-05 04:21:22 -06:00
go/src/Make.cmd
Russ Cox 389d55fadf 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
2011-10-18 14:55:10 -04:00

51 lines
986 B
Batchfile

# Copyright 2009 The Go Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
ifeq ($(GOOS),windows)
TARG:=$(TARG).exe
endif
ifeq ($(TARGDIR),)
TARGDIR:=$(QUOTED_GOBIN)
endif
all: $(TARG)
include $(QUOTED_GOROOT)/src/Make.common
PREREQ+=$(patsubst %,%.make,$(DEPS))
$(TARG): _go_.$O
$(LD) $(LDIMPORTS) -o $@ _go_.$O
_go_.$O: $(GOFILES) $(PREREQ)
$(GC) $(GCFLAGS) $(GCIMPORTS) -o $@ $(GOFILES)
install: $(TARGDIR)/$(TARG)
$(TARGDIR)/$(TARG): $(TARG)
mkdir -p $(TARGDIR) && cp -f $(TARG) $(TARGDIR)
CLEANFILES+=$(TARG) _test _testmain.go test.out build.out
nuke: clean
rm -f $(TARGDIR)/$(TARG)
# for gotest
testpackage: _test/main.a
testpackage-clean:
rm -f _test/main.a _gotest_.$O
_test/main.a: _gotest_.$O
@mkdir -p _test
rm -f $@
gopack grc $@ _gotest_.$O
_gotest_.$O: $(GOFILES) $(GOTESTFILES)
$(GC) $(GCFLAGS) $(GCIMPORTS) -o $@ $(GOFILES) $(GOTESTFILES)
importpath:
echo main