Add a mkfiledir variable that evuates to the full path of the current mkfile.
This commit is contained in:
parent
4554b8c6cb
commit
49fdbebf48
2 changed files with 22 additions and 7 deletions
8
mk.go
8
mk.go
|
|
@ -6,6 +6,7 @@ import (
|
|||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
)
|
||||
|
|
@ -312,7 +313,12 @@ func main() {
|
|||
input, _ := ioutil.ReadAll(mkfile)
|
||||
mkfile.Close()
|
||||
|
||||
rs := parse(string(input), mkfilepath)
|
||||
abspath, err := filepath.Abs(mkfilepath)
|
||||
if err != nil {
|
||||
mkError("unable to find mkfile's absolute path")
|
||||
}
|
||||
|
||||
rs := parse(string(input), mkfilepath, abspath)
|
||||
targets := flag.Args()
|
||||
|
||||
// build the first non-meta rule in the makefile, if none are given explicitly
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue