]> Cypherpunks repositories - gostls13.git/commitdiff
add and use Make.cmd
authorRuss Cox <rsc@golang.org>
Thu, 27 Aug 2009 18:17:14 +0000 (11:17 -0700)
committerRuss Cox <rsc@golang.org>
Thu, 27 Aug 2009 18:17:14 +0000 (11:17 -0700)
R=r
DELTA=63  (23 added, 31 deleted, 9 changed)
OCL=33932
CL=33959

src/Make.cmd [new file with mode: 0644]
src/cmd/ebnflint/Makefile
src/cmd/godoc/Makefile
src/cmd/gofmt/Makefile

diff --git a/src/Make.cmd b/src/Make.cmd
new file mode 100644 (file)
index 0000000..656ea55
--- /dev/null
@@ -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)
index e473b5c29ee60927ba26451331f24373f5903fde..6e42ba8d2fed57d4b58a3118b8c6640bd5c56608 100644 (file)
@@ -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) $<
index 53f694e7b99f4d4c36f99eb377ae771614eadcc6..a534e09596a7db675c126bf3949de125383848da 100644 (file)
@@ -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
index 01d772ff72d07a7875c3dfe173f95957d589deed..a93b8c37266f1e9820409e111d8ba86e3b89e235 100644 (file)
@@ -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) $<