Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
2fc96269
Commit
2fc96269
authored
Jul 26, 2011
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
goinstall: generate makefiles using exp/template
R=golang-dev, adg CC=golang-dev
https://golang.org/cl/4809052
parent
7e1101d4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
29 deletions
+24
-29
src/cmd/goinstall/make.go
src/cmd/goinstall/make.go
+24
-29
No files found.
src/cmd/goinstall/make.go
View file @
2fc96269
...
@@ -8,11 +8,11 @@ package main
...
@@ -8,11 +8,11 @@ package main
import
(
import
(
"bytes"
"bytes"
"exp/template"
"go/build"
"go/build"
"os"
"os"
"path/filepath"
"path/filepath"
"strings"
"strings"
"template"
)
)
// domake builds the package in dir.
// domake builds the package in dir.
...
@@ -138,43 +138,38 @@ type makedata struct {
...
@@ -138,43 +138,38 @@ type makedata struct {
Imports
[]
string
// gc/ld import paths
Imports
[]
string
// gc/ld import paths
}
}
var
makefileTemplate
=
template
.
MustParse
(
`
var
makefileTemplate
=
template
.
New
(
"Makefile"
)
.
MustParse
(
`
include $(GOROOT)/src/Make.inc
include $(GOROOT)/src/Make.inc
TARG={
Targ
}
TARG={
{.Targ}
}
TARGDIR={
TargDir
}
TARGDIR={
{.TargDir}
}
{
.section GoFiles
}
{
{with .GoFiles}
}
GOFILES=\
GOFILES=\
{.repeated section @}
{{range .}} {{.}}\
{@}\
{{end}}
{.end}
{
.end
}
{
{end}
}
{
.section OFiles
}
{
{with .OFiles}
}
OFILES=\
OFILES=\
{.repeated section @}
{{range .}} {{.}}\
{@}\
{{end}}
{.end}
{
.end
}
{
{end}
}
{
.section CgoFiles
}
{
{with .CgoFiles}
}
CGOFILES=\
CGOFILES=\
{.repeated section @}
{{range .}} {{.}}\
{@}\
{{end}}
{.end}
{
.end
}
{
{end}
}
{
.section CgoOFiles
}
{
{with .CgoOFiles}
}
CGO_OFILES=\
CGO_OFILES=\
{.repeated section @}
{{range .}} {{.}}\
{@}\
{{end}}
{.end}
{
.end
}
{
{end}
}
GCIMPORTS={
.repeated section Imports}-I "{@}" {.end
}
GCIMPORTS={
{range .Imports}}-I "{{.}}" {{end}
}
LDIMPORTS={
.repeated section Imports}-L "{@}" {.end
}
LDIMPORTS={
{range .Imports}}-L "{{.}}" {{end}
}
include $(GOROOT)/src/Make.{Type}
include $(GOROOT)/src/Make.{{.Type}}
`
,
`
)
nil
)
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