OLD | NEW |
1 // Copyright 2011 The Go Authors. All rights reserved. | 1 // Copyright 2011 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // Package build provides tools for building Go packages. | 5 // Package build provides tools for building Go packages. |
6 package build | 6 package build |
7 | 7 |
8 import ( | 8 import ( |
9 "bytes" | 9 "bytes" |
10 "errors" | 10 "errors" |
11 "exec" | |
12 "fmt" | 11 "fmt" |
13 "os" | 12 "os" |
| 13 "os/exec" |
14 "path/filepath" | 14 "path/filepath" |
15 "regexp" | 15 "regexp" |
16 "runtime" | 16 "runtime" |
17 "strings" | 17 "strings" |
18 ) | 18 ) |
19 | 19 |
20 // Build produces a build Script for the given package. | 20 // Build produces a build Script for the given package. |
21 func Build(tree *Tree, pkg string, info *DirInfo) (*Script, error) { | 21 func Build(tree *Tree, pkg string, info *DirInfo) (*Script, error) { |
22 s := &Script{} | 22 s := &Script{} |
23 b := &build{ | 23 b := &build{ |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 }) | 436 }) |
437 b.script.addIntermediate(importC) | 437 b.script.addIntermediate(importC) |
438 | 438 |
439 // cc _cgo_import.ARCH | 439 // cc _cgo_import.ARCH |
440 importObj := b.obj + "_cgo_import." + b.arch | 440 importObj := b.obj + "_cgo_import." + b.arch |
441 b.cc(importObj, importC) | 441 b.cc(importObj, importC) |
442 outObj = append(outObj, importObj) | 442 outObj = append(outObj, importObj) |
443 | 443 |
444 return | 444 return |
445 } | 445 } |
OLD | NEW |