summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-08-27 11:17:14 -0700
committerRuss Cox <rsc@golang.org>2009-08-27 11:17:14 -0700
commit43f160a74b60cb31146233bca5bd967539799aea (patch)
treee643b783c474d05bb8180c6bb28d685aa54b2cba
parent5ecf1c5811984c302a7eaa909390c022c2c0371b (diff)
downloadgolang-43f160a74b60cb31146233bca5bd967539799aea.tar.gz
add and use Make.cmd
R=r DELTA=63 (23 added, 31 deleted, 9 changed) OCL=33932 CL=33959
-rw-r--r--src/Make.cmd27
-rw-r--r--src/cmd/ebnflint/Makefile16
-rw-r--r--src/cmd/godoc/Makefile17
-rw-r--r--src/cmd/gofmt/Makefile16
4 files changed, 36 insertions, 40 deletions
diff --git a/src/Make.cmd b/src/Make.cmd
new file mode 100644
index 000000000..656ea5531
--- /dev/null
+++ b/src/Make.cmd
@@ -0,0 +1,27 @@
+# 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.
+
+# GNU Make syntax:
+ifndef GOBIN
+GOBIN=$(HOME)/bin
+endif
+
+all: $(TARG)
+
+$(TARG): _go_.$O $(OFILES)
+ $(LD) -o $@ _go_.$O $(OFILES)
+
+_go_.$O: $(GOFILES)
+ $(GC) -o $@ $(GOFILES)
+
+install: $(GOBIN)/$(TARG)
+
+$(GOBIN)/$(TARG): $(TARG)
+ cp $(TARG) $@
+
+clean:
+ rm -f *.[$(OS)] $(TARG) $(CLEANFILES)
+
+nuke:
+ rm -f *.[$(OS)] $(TARG) $(CLEANFILES) $(GOBIN)/$(TARG)
diff --git a/src/cmd/ebnflint/Makefile b/src/cmd/ebnflint/Makefile
index e473b5c29..6e42ba8d2 100644
--- a/src/cmd/ebnflint/Makefile
+++ b/src/cmd/ebnflint/Makefile
@@ -2,24 +2,14 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include $(GOROOT)/src/Make.conf
include $(GOROOT)/src/Make.$(GOARCH)
TARG=ebnflint
-OFILES=\
- ebnflint.$O\
+GOFILES=\
+ ebnflint.go\
-$(TARG): $(OFILES)
- $(LD) -o $(TARG) $(OFILES)
+include $(GOROOT)/src/Make.cmd
test: $(TARG)
$(TARG) -start="SourceFile" $(GOROOT)/doc/go_spec.html
-clean:
- rm -f $(OFILES) $(TARG)
-
-install: $(TARG)
- cp $(TARG) $(GOBIN)/$(TARG)
-
-%.$O: %.go
- $(GC) $<
diff --git a/src/cmd/godoc/Makefile b/src/cmd/godoc/Makefile
index 53f694e7b..a534e0959 100644
--- a/src/cmd/godoc/Makefile
+++ b/src/cmd/godoc/Makefile
@@ -2,21 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include $(GOROOT)/src/Make.conf
include $(GOROOT)/src/Make.$(GOARCH)
TARG=godoc
-OFILES=\
- godoc.$O\
+GOFILES=\
+ godoc.go\
-$(TARG): $(OFILES)
- $(LD) -o $(TARG) $(OFILES)
-
-clean:
- rm -f $(OFILES) $(TARG)
-
-install: $(TARG)
- cp $(TARG) $(GOBIN)/$(TARG)
-
-%.$O: %.go
- $(GC) $<
+include $(GOROOT)/src/Make.cmd
diff --git a/src/cmd/gofmt/Makefile b/src/cmd/gofmt/Makefile
index 01d772ff7..a93b8c372 100644
--- a/src/cmd/gofmt/Makefile
+++ b/src/cmd/gofmt/Makefile
@@ -2,15 +2,13 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
-include $(GOROOT)/src/Make.conf
include $(GOROOT)/src/Make.$(GOARCH)
TARG=gofmt
-OFILES=\
- gofmt.$O\
+GOFILES=\
+ gofmt.go\
-$(TARG): $(OFILES)
- $(LD) -o $(TARG) $(OFILES)
+include $(GOROOT)/src/Make.cmd
test: $(TARG)
./test.sh
@@ -18,11 +16,3 @@ test: $(TARG)
smoketest: $(TARG)
./test.sh $(GOROOT)/src/pkg/go/parser/parser.go
-clean:
- rm -f $(OFILES) $(TARG)
-
-install: $(TARG)
- cp $(TARG) $(GOBIN)/$(TARG)
-
-%.$O: %.go
- $(GC) $<