summaryrefslogtreecommitdiff
path: root/xmake/plugins/project/makefile/makefile.lua
diff options
context:
space:
mode:
authorTitanSnow <[email protected]>2017-05-13 08:55:01 +0800
committerTitanSnow <[email protected]>2017-05-13 08:55:01 +0800
commitc85d3d058f04018db42a3753dd25adededecd071 (patch)
tree3eae4d454d2a88df658261c4dba718285a16314b /xmake/plugins/project/makefile/makefile.lua
parentd0a7a684b495d202ead0c6c5d1d46564c24ae53e (diff)
ccache -> $(CCACHE)
Diffstat (limited to 'xmake/plugins/project/makefile/makefile.lua')
-rw-r--r--xmake/plugins/project/makefile/makefile.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/xmake/plugins/project/makefile/makefile.lua b/xmake/plugins/project/makefile/makefile.lua
index e31de2f83..202dfa63a 100644
--- a/xmake/plugins/project/makefile/makefile.lua
+++ b/xmake/plugins/project/makefile/makefile.lua
@@ -120,6 +120,12 @@ function _make_object(makefile, target, sourcefile, objectfile)
command = format("%s$(%s)%s", command:sub(1, p - 1), sourcekind:upper(), command:sub(e + 1))
end
+ -- replace ccache to $(CCACHE)
+ p, e = command:find("ccache", 1, true)
+ if p then
+ command = format("%s$(%s)%s", command:sub(1, p - 1), "CCACHE", command:sub(e + 1))
+ end
+
-- make head
makefile:printf("%s:", objectfile)
@@ -173,6 +179,12 @@ function _make_single_object(makefile, target, sourcekind, sourcebatch)
command = format("%s$(%s)%s", command:sub(1, p - 1), sourcekind:upper(), command:sub(e + 1))
end
+ -- replace ccache to $(CCACHE)
+ p, e = command:find("ccache", 1, true)
+ if p then
+ command = format("%s$(%s)%s", command:sub(1, p - 1), "CCACHE", command:sub(e + 1))
+ end
+
-- make head
makefile:printf("%s:", objectfiles)
@@ -301,6 +313,8 @@ end
-- make all
function _make_all(makefile)
+ -- make variables for ccache
+ makefile:print("CCACHE=ccache")
-- make variables for source kinds
for sourcekind, _ in pairs(language.sourcekinds()) do
local shellname = tool.shellname(sourcekind)