1
0
mirror of https://github.com/golang/go synced 2024-10-02 12:18:33 -06:00
go/src/Make.cmd
Anthony Martin fbb4be3278 make: add nuke target for C commands and libs
Also, clean *.out files for commands written in Go.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4535051
2011-05-11 22:53:42 -04:00

51 lines
964 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) $(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) $(GCIMPORTS) -o $@ $(GOFILES) $(GOTESTFILES)
importpath:
echo main