From 35891f39a780ec8d1d580876c87786b7d884a116 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 27 Apr 2023 00:35:24 +0800 Subject: improve echo cmd --- xmake/plugins/project/make/makefile.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'xmake/plugins/project/make/makefile.lua') 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) -- cgit v1.3.1