diff options
| author | ruki <[email protected]> | 2015-06-16 21:01:44 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-06-16 21:01:44 +0800 |
| commit | 3d97768287a089f862d841cb697b48852941b002 (patch) | |
| tree | 2b71ddfd936e2d7117d057eee08c6c44a603f190 /xmake/scripts/base/makefile.lua | |
| parent | d549aaedf96e6d6eb77e9d588dc0a0269cd1ae71 (diff) | |
modify makefile rule and enable make -j4
Diffstat (limited to 'xmake/scripts/base/makefile.lua')
| -rw-r--r-- | xmake/scripts/base/makefile.lua | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/xmake/scripts/base/makefile.lua b/xmake/scripts/base/makefile.lua index 6a6511b54..7b1ca2e7d 100644 --- a/xmake/scripts/base/makefile.lua +++ b/xmake/scripts/base/makefile.lua @@ -126,18 +126,38 @@ function makefile._make_target(file, name, target) local targetfile = rule.targetfile(name, target) assert(targetfile) + -- get the targets + local targets = project.targets() + assert(targets) + -- get the linker from the given kind local l = linker.get(target.kind) if not l then return false end -- make head - file:write(string.format("%s:", name)) + file:write(string.format("%s: %s\n", name, targetfile)) + file:write(string.format("%s:", targetfile)) -- make dependence for the dependent targets if target.deps then + + -- get all dependent target local deps = utils.wrap(target.deps) for _, dep in ipairs(deps) do - file:write(" " .. dep) + + -- the dependent target + local deptarget = targets[dep] + if not deptarget then + utils.error("the dependent target: %s is invalid!", dep) + return false + end + + -- get the dependent target file + local depfile = rule.targetfile(dep, deptarget) + assert(depfile) + + -- add dependence + file:write(" " .. depfile) end end |
