2009-08-27 12:17:14 -06:00
|
|
|
# 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.
|
|
|
|
|
2010-07-25 17:55:25 -06:00
|
|
|
ifeq ($(GOOS),windows)
|
|
|
|
TARG:=$(TARG).exe
|
|
|
|
endif
|
|
|
|
|
2010-03-19 17:33:27 -06:00
|
|
|
all: $(TARG)
|
2009-08-27 12:17:14 -06:00
|
|
|
|
2010-03-19 16:14:46 -06:00
|
|
|
include $(QUOTED_GOROOT)/src/Make.common
|
|
|
|
|
|
|
|
PREREQ+=$(patsubst %,%.make,$(DEPS))
|
2009-11-23 18:32:51 -07:00
|
|
|
|
2010-10-11 20:39:37 -06:00
|
|
|
$(TARG): _go_.$O
|
|
|
|
$(LD) -o $@ _go_.$O
|
2009-08-27 12:17:14 -06:00
|
|
|
|
2010-03-19 16:14:46 -06:00
|
|
|
_go_.$O: $(GOFILES) $(PREREQ)
|
2010-08-24 18:00:33 -06:00
|
|
|
$(GC) -o $@ $(GOFILES)
|
2009-08-27 12:17:14 -06:00
|
|
|
|
2009-11-23 18:32:51 -07:00
|
|
|
install: $(QUOTED_GOBIN)/$(TARG)
|
2009-08-27 12:17:14 -06:00
|
|
|
|
2009-11-23 18:32:51 -07:00
|
|
|
$(QUOTED_GOBIN)/$(TARG): $(TARG)
|
|
|
|
cp -f $(TARG) $(QUOTED_GOBIN)
|
2009-08-27 12:17:14 -06:00
|
|
|
|
2010-03-19 16:14:46 -06:00
|
|
|
CLEANFILES+=$(TARG)
|
2009-08-27 12:17:14 -06:00
|
|
|
|
2010-03-19 16:14:46 -06:00
|
|
|
nuke: clean
|
|
|
|
rm -f $(QUOTED_GOBIN)/$(TARG)
|
2011-02-03 12:54:01 -07:00
|
|
|
|
|
|
|
# for gotest
|
|
|
|
testpackage: _test/main.a
|
|
|
|
|
|
|
|
testpackage-clean:
|
|
|
|
rm -f _test/main.a _gotest_.$O
|
|
|
|
|
|
|
|
testpackage: _test/main.a
|
|
|
|
|
|
|
|
_test/main.a: _gotest_.$O
|
|
|
|
@mkdir -p _test
|
|
|
|
rm -f $@
|
|
|
|
gopack grc $@ _gotest_.$O
|
|
|
|
|
|
|
|
_gotest_.$O: $(GOFILES) $(GOTESTFILES)
|
|
|
|
$(GC) -o $@ $(GOFILES) $(GOTESTFILES)
|
|
|
|
|
|
|
|
importpath:
|
|
|
|
echo main
|