diff options
Diffstat (limited to 'xmake/scripts/base')
| -rw-r--r-- | xmake/scripts/base/makefile.lua | 22 | ||||
| -rw-r--r-- | xmake/scripts/base/rule.lua | 11 |
2 files changed, 15 insertions, 18 deletions
diff --git a/xmake/scripts/base/makefile.lua b/xmake/scripts/base/makefile.lua index 9dbf1ae35..b35ac8412 100644 --- a/xmake/scripts/base/makefile.lua +++ b/xmake/scripts/base/makefile.lua @@ -98,7 +98,8 @@ function makefile._make_object_for_static(file, target, srcfile, objfile) else mode = "" end -- make command - local cmd = string.format("xmake l -P %s -f %s dispatcher ex extract %s %s > %s 2>&1", xmake._PROJECT_DIR, xmake._PROJECT_FILE, srcfile:encode(), objfile:encode(), makefile._LOGFILE) +-- local cmd = string.format("xmake l -P %s -f %s dispatcher ex extract %s %s > %s 2>&1", xmake._PROJECT_DIR, xmake._PROJECT_FILE, srcfile:encode(), objfile:encode(), makefile._LOGFILE) + local cmd = string.format("xmake l -P %s -f %s dispatcher ex extract %s %s", xmake._PROJECT_DIR, xmake._PROJECT_FILE, srcfile:encode(), objfile:encode()) -- make head file:write(string.format("%s:", objfile)) @@ -343,17 +344,6 @@ function makefile._make_targets(file) return true end --- get the makefile path -function makefile.path() - - -- get the build directory - local buildir = config.get("buildir") - assert(buildir) - - -- get it - return path.translate(buildir .. "/makefile") -end - -- make makefile in the build directory function makefile.make() @@ -372,7 +362,7 @@ function makefile.make() assert(logfile) -- open the makefile - local path = makefile.path() + local path = rule.makefile() local file = io.openmk(path) if not file then -- error @@ -409,10 +399,6 @@ function makefile.build(target) -- check assert(target and type(target) == "string") - -- get the build directory - local buildir = config.get("buildir") - assert(buildir) - -- load make local make = tools.get("make") if not make then @@ -421,7 +407,7 @@ function makefile.build(target) end -- done make - return make:main(buildir .. "/makefile", target) + return make:main(rule.makefile(), target) end -- return module: makefile diff --git a/xmake/scripts/base/rule.lua b/xmake/scripts/base/rule.lua index e165c6533..e6e724cff 100644 --- a/xmake/scripts/base/rule.lua +++ b/xmake/scripts/base/rule.lua @@ -55,6 +55,17 @@ function rule.filename(name, kind) return format[1] .. name .. format[2] end +-- get the makefile path +function rule.makefile() + + -- get the build directory + local buildir = config.get("buildir") + assert(buildir) + + -- get it + return path.translate(buildir .. "/makefile") +end + -- get configure file for the given target function rule.config_h(target) |
