summaryrefslogtreecommitdiff
path: root/doc/code.html
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-08-18 10:08:49 -0400
committerRuss Cox <rsc@golang.org>2010-08-18 10:08:49 -0400
commitd5a213c027d18c2c8de4b869af2b6839badb3871 (patch)
treefce12a0753dcdb206ec0d64d571afcfc1711145c /doc/code.html
parentae4b93f1aa082f2529247d0eddcc5a04ffa71564 (diff)
downloadgo-d5a213c027d18c2c8de4b869af2b6839badb3871.tar.gz
build: no required environment variables
R=adg, r, PeterGo CC=golang-dev http://codereview.appspot.com/1942044
Diffstat (limited to 'doc/code.html')
-rw-r--r--doc/code.html22
1 files changed, 15 insertions, 7 deletions
diff --git a/doc/code.html b/doc/code.html
index 14bb6f9fe..8e72d5ace 100644
--- a/doc/code.html
+++ b/doc/code.html
@@ -64,7 +64,7 @@ is illustrated by <a href="../src/pkg/container/vector/Makefile"><code>src/pkg/c
</p>
<pre>
-include ../../../Make.$(GOARCH)
+include ../../../Make.inc
TARG=container/vector
GOFILES=\
@@ -80,7 +80,7 @@ Outside the Go source tree (for personal packages), the standard form is
</p>
<pre>
-include $(GOROOT)/src/Make.$(GOARCH)
+include $(GOROOT)/src/Make.inc
TARG=mypackage
GOFILES=\
@@ -99,6 +99,14 @@ This makes it easy for programmers to try Go.
</p>
<p>
+If you have not set <code>$GOROOT</code> in your environment,
+you must run <code>gomake</code> to use this form of makefile.
+<code>Gomake</code> also takes care to invoke GNU Make
+even on systems where it is installed as <code>gmake</code>
+rather than <code>make</code>.
+</p>
+
+<p>
<code>TARG</code> is the target install path for the package,
the string that clients will use to import it.
Inside the Go tree, this string should be the same as the directory
@@ -131,8 +139,8 @@ cd $GOROOT/src/pkg
</pre>
<p>
to update the dependency file <code>Make.deps</code>.
-(This happens automatically each time you run <code>make all</code>
-or <code>make build</code>.)
+(This happens automatically each time you run <code>all.bash</code>
+or <code>make.bash</code>.)
</p>
<p>
@@ -259,7 +267,7 @@ Finally, the <code>Makefile</code>:
</p>
<pre>
-include $(GOROOT)/src/Make.$(GOARCH)
+include $(GOROOT)/src/Make.inc
TARG=numbers
GOFILES=\
@@ -269,13 +277,13 @@ include $(GOROOT)/src/Make.pkg
</pre>
<p>
-Running <code>make install</code> will build and install the package to
+Running <code>gomake install</code> will build and install the package to
the <code>$GOROOT/pkg/</code> directory (it can then be used by any
program on the system).
</p>
<p>
-Running <code>make test</code> (or just running the command
+Running <code>gomake test</code> (or just running the command
<code>gotest</code>) will rebuild the package, including the
<code>numbers_test.go</code> file, and then run the <code>TestDouble</code>
function. The output "<code>PASS</code>" indicates that all tests passed