summaryrefslogtreecommitdiff
path: root/src/Make.cmd
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-09-13 13:13:40 +0200
committerOndřej Surý <ondrej@sury.org>2011-09-13 13:13:40 +0200
commit5ff4c17907d5b19510a62e08fd8d3b11e62b431d (patch)
treec0650497e988f47be9c6f2324fa692a52dea82e1 /src/Make.cmd
parent80f18fc933cf3f3e829c5455a1023d69f7b86e52 (diff)
downloadgolang-upstream/60.tar.gz
Imported Upstream version 60upstream/60
Diffstat (limited to 'src/Make.cmd')
-rw-r--r--src/Make.cmd50
1 files changed, 50 insertions, 0 deletions
diff --git a/src/Make.cmd b/src/Make.cmd
new file mode 100644
index 000000000..27c6a2e13
--- /dev/null
+++ b/src/Make.cmd
@@ -0,0 +1,50 @@
+# 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