如何在makefile中打印换行符?
例如,如果我有目标:
printIt:
@echo "Compiling..."
我如何打印出
Compiling...
我读过某个地方,您可以定义一个。但是我已经尝试了所提到的here:
define \n
endef
printit:
@echo "${\n}Compiling..."
但是这不会打印换行符。我也尝试了c ++样式“ \ n”。我正在使用GNU Make 3.81
。
用途:
@echo ""; echo "Compiling..."
第一个echo
回显换行符;第二个回显该消息。
在echo
的某些实现中,例如Bash,您可以使用echo -e
解释转义字符。使用
printIt:
@echo -e "\nCompiling..."