From b7a0ed4cd24fbd421715dad7376ae691871ca126 Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 6 Dec 2015 00:38:11 +0800 Subject: auto configure if makefile not exists --- xmake/scripts/base/makefile.lua | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'xmake/scripts/base/makefile.lua') 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 -- cgit v1.3.1