diff options
| author | ruki <[email protected]> | 2015-06-02 15:39:44 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2015-06-02 15:39:44 +0800 |
| commit | f639faef588a95b28ec02c781dee2a581f7a7992 (patch) | |
| tree | fb50924f053cf26b9ad53c46c440aceeb82f8e45 /xmake/scripts/action/_build.lua | |
| parent | 6ed13d09ec37896b0176e90ddaa99c90ecaccd1d (diff) | |
impl rebuild and update
Diffstat (limited to 'xmake/scripts/action/_build.lua')
| -rw-r--r-- | xmake/scripts/action/_build.lua | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/xmake/scripts/action/_build.lua b/xmake/scripts/action/_build.lua index cd80616f1..1a821e406 100644 --- a/xmake/scripts/action/_build.lua +++ b/xmake/scripts/action/_build.lua @@ -25,19 +25,28 @@ local _build = _build or {} -- load modules local utils = require("base/utils") +local clean = require("base/clean") local config = require("base/config") local makefile = require("base/makefile") - + -- done the given config function _build.done() - -- TODO - -- rebuild, update + -- the target name + local target_name = config.get("target") + + -- rebuild it? + if config.get("rebuild") then + clean.remove(target_name) + -- update it? + elseif config.get("update") then + clean.remove(target_name, true) + end -- build target for makefile - if not makefile.build(config.get("target")) then + if not makefile.build(target_name) then -- error - utils.error("build target: %s failed!", config.get("target")) + utils.error("build target: %s failed!", target_name) return false end |
