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
05240bb2
Commit
05240bb2
authored
Jun 18, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use multiline string literal in gobuild
R=r DELTA=76 (1 added, 0 deleted, 75 changed) OCL=30497 CL=30510
parent
eba82f43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
75 deletions
+76
-75
src/cmd/gobuild/makefile.go
src/cmd/gobuild/makefile.go
+76
-75
No files found.
src/cmd/gobuild/makefile.go
View file @
05240bb2
...
...
@@ -12,81 +12,82 @@ import (
"template"
;
)
var
makefileTemplate
=
"# DO NOT EDIT. Automatically generated by gobuild.
\n
"
"{Args|args} >Makefile
\n
"
"
\n
"
"D={.section Dir}/{@}{.end}
\n
"
"
\n
"
"include $(GOROOT)/src/Make.$(GOARCH)
\n
"
"AR=gopack
\n
"
"
\n
"
"default: packages
\n
"
"
\n
"
"clean:
\n
"
" rm -rf *.[$(OS)] *.a [$(OS)].out {ObjDir}
\n
"
"
\n
"
"test: packages
\n
"
" gotest
\n
"
"
\n
"
"coverage: packages
\n
"
" gotest
\n
"
" 6cov -g `pwd` | grep -v '_test
\\
.go:'
\n
"
"
\n
"
"%.$O: %.go
\n
"
" $(GC) -I{ObjDir} $*.go
\n
"
"
\n
"
"%.$O: %.c
\n
"
" $(CC) $*.c
\n
"
"
\n
"
"%.$O: %.s
\n
"
" $(AS) $*.s
\n
"
"
\n
"
"{.repeated section Phases}
\n
"
"O{Phase}=
\\\n
"
"{.repeated section ArCmds}
\n
"
"{.repeated section Files}
\n
"
" {Name|basename}.$O
\\\n
"
"{.end}
\n
"
"{.end}
\n
"
"
\n
"
"{.end}
\n
"
"
\n
"
"phases:{.repeated section Phases} a{Phase}{.end}
\n
"
"{.repeated section Packages}
\n
"
"{ObjDir}$D/{Name}.a: phases
\n
"
"{.end}
\n
"
"
\n
"
"{.repeated section Phases}
\n
"
"a{Phase}: $(O{Phase})
\n
"
"{.repeated section ArCmds}
\n
"
" $(AR) grc {ObjDir}$D/{.section Pkg}{Name}.a{.end}{.repeated section Files} {Name|basename}.$O{.end}
\n
"
"{.end}
\n
"
" rm -f $(O{Phase})
\n
"
"
\n
"
"{.end}
\n
"
"
\n
"
"newpkg: clean
\n
"
" mkdir -p {ObjDir}$D
\n
"
"{.repeated section Packages}
\n
"
" $(AR) grc {ObjDir}$D/{Name}.a
\n
"
"{.end}
\n
"
"
\n
"
"$(O1): newpkg
\n
"
"{.repeated section Phases}
\n
"
"$(O{Phase|+1}): a{Phase}
\n
"
"{.end}
\n
"
"
\n
"
"nuke: clean
\n
"
" rm -f{.repeated section Packages} $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D/{Name}.a{.end}
\n
"
"
\n
"
"packages:{.repeated section Packages} {ObjDir}$D/{Name}.a{.end}
\n
"
"
\n
"
"install: packages
\n
"
" test -d $(GOROOT)/pkg && mkdir -p $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D
\n
"
"{.repeated section Packages}
\n
"
" cp {ObjDir}$D/{Name}.a $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D/{Name}.a
\n
"
"{.end}
\n
"
var
makefileTemplate
=
`
# DO NOT EDIT. Automatically generated by gobuild.
{Args|args} >Makefile
D={.section Dir}/{@}{.end}
include $(GOROOT)/src/Make.$(GOARCH)
AR=gopack
default: packages
clean:
rm -rf *.[$(OS)] *.a [$(OS)].out {ObjDir}
test: packages
gotest
coverage: packages
gotest
6cov -g $$(pwd) | grep -v '_test\.go:'
%.$O: %.go
$(GC) -I{ObjDir} $*.go
%.$O: %.c
$(CC) $*.c
%.$O: %.s
$(AS) $*.s
{.repeated section Phases}
O{Phase}=\
{.repeated section ArCmds}
{.repeated section Files}
{Name|basename}.$O\
{.end}
{.end}
{.end}
phases:{.repeated section Phases} a{Phase}{.end}
{.repeated section Packages}
{ObjDir}$D/{Name}.a: phases
{.end}
{.repeated section Phases}
a{Phase}: $(O{Phase})
{.repeated section ArCmds}
$(AR) grc {ObjDir}$D/{.section Pkg}{Name}.a{.end}{.repeated section Files} {Name|basename}.$O{.end}
{.end}
rm -f $(O{Phase})
{.end}
newpkg: clean
mkdir -p {ObjDir}$D
{.repeated section Packages}
$(AR) grc {ObjDir}$D/{Name}.a
{.end}
$(O1): newpkg
{.repeated section Phases}
$(O{Phase|+1}): a{Phase}
{.end}
nuke: clean
rm -f{.repeated section Packages} $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D/{Name}.a{.end}
packages:{.repeated section Packages} {ObjDir}$D/{Name}.a{.end}
install: packages
test -d $(GOROOT)/pkg && mkdir -p $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D
{.repeated section Packages}
cp {ObjDir}$D/{Name}.a $(GOROOT)/pkg/$(GOOS)_$(GOARCH)$D/{Name}.a
{.end}
`
func
argsFmt
(
w
io
.
Writer
,
x
interface
{},
format
string
)
{
args
:=
x
.
([]
string
);
...
...
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