Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
52c23f30
Commit
52c23f30
authored
Nov 22, 2010
by
Yves Junqueira
Committed by
Andrew Gerrand
Nov 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Documentation: how to write Makefiles for commands.
Fixes #1282. R=adg CC=golang-dev
https://golang.org/cl/3152041
parent
95c341fc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
code.html
doc/code.html
+26
-0
No files found.
doc/code.html
View file @
52c23f30
...
...
@@ -177,6 +177,32 @@ Writing clean, idiomatic Go code is beyond the scope of this document.
that topic.
</p>
<h2
id=
"Building_programs"
>
Building programs
</h2>
<p>
To build a Go program with gomake, create a Makefile alongside your program's
source files. It should be similar to the example above, but include
<code>
Make.cmd
</code>
instead of
<code>
Make.pkg
</code>
:
<pre>
include $(GOROOT)/src/Make.inc
TARG=helloworld
GOFILES=\
helloworld.go\
include $(GOROOT)/src/Make.cmd
</pre>
<p>
Running
<code>
gomake build
</code>
will compile
<code>
helloworld.go
</code>
and produce an executable named
<code>
helloworld
</code>
in the current
directory.
</p>
<p>
Running
<code>
gomake install
</code>
will build
<code>
helloworld
</code>
if
necessary and copy it to the
<code>
$GOBIN
</code>
directory
(
<code>
$GOROOT/bin/
</code>
is the default).
</p>
<h2
id=
"Testing"
>
Testing
</h2>
<p>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment