summaryrefslogtreecommitdiff
path: root/xmake/plugins/project/make/makefile.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2023-04-27 00:35:24 +0800
committerruki <[email protected]>2023-04-27 00:35:24 +0800
commit35891f39a780ec8d1d580876c87786b7d884a116 (patch)
treee38a52f0dee77b17512253d1115dd3728563e185 /xmake/plugins/project/make/makefile.lua
parente183cdf902e4779185967cf1796a0c485ec15840 (diff)
improve echo cmd
Diffstat (limited to 'xmake/plugins/project/make/makefile.lua')
-rw-r--r--xmake/plugins/project/make/makefile.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/xmake/plugins/project/make/makefile.lua b/xmake/plugins/project/make/makefile.lua
index eb7324bb1..5fce2e92f 100644
--- a/xmake/plugins/project/make/makefile.lua
+++ b/xmake/plugins/project/make/makefile.lua
@@ -205,6 +205,11 @@ function _get_cmd_rm(filedir)
end
end
+-- get command: echo
+function _get_cmd_echo(str)
+ return string.format("@echo %s", colors.ignore(str))
+end
+
-- get command string
function _get_command_string(cmd, outputdir)
local kind = cmd.kind
@@ -235,7 +240,7 @@ function _get_command_string(cmd, outputdir)
elseif kind == "mkdir" then
return _get_cmd_mkdir(_get_relative_unix_path(cmd.dir, outputdir))
elseif kind == "show" then
- return string.format("echo %s", colors.ignore(cmd.showtext))
+ return _get_cmd_echo(cmd.showtext)
end
end
@@ -398,7 +403,7 @@ function _add_build_object(makefile, target, sourcefile, objectfile, sourceflags
makefile:print(" %s", sourcefile)
-- make body
- makefile:print("\t@echo %scompiling.$(mode) %s", ccache and "ccache " or "", sourcefile)
+ makefile:print("\t%s", _get_cmd_echo(string.format("%scompiling.$(mode) %s", ccache and "ccache " or "", sourcefile)))
makefile:print("\t%s", _get_cmd_mkdir(path.directory(objectfile)))
makefile:writef("\t$(VV)%s\n", command)
@@ -564,7 +569,7 @@ function _add_build_target(makefile, target, targetflags, outputdir)
end
-- make body
- makefile:print("\t@echo linking.$(mode) %s", path.filename(targetfile))
+ makefile:print("\t%s", _get_cmd_echo(string.format("linking.$(mode) %s", path.filename(targetfile))))
makefile:print("\t%s", _get_cmd_mkdir(path.directory(targetfile)))
makefile:writef("\t$(VV)%s\n", command)