在make脚本中回显换行符

时间:2011-11-04 10:13:33

标签: makefile dos

我有一个make规则来编译我的项目中的.c文件,看起来像这样

# Default rules for building r90 (avr8) / r82 (avr32) object files, from .c files.
%.$(OBJ_EXTENSION) : %.c
    @echo Compiling $(@:.$(OBJ_EXTENSION)=.c) to $@ due to change in $?
    ...

现在结束时我想要一个新行来很好地将输出与每个文件的编译分开。

我看过How can you echo a newline in batch files?和类似的帖子,他们似乎都建议echo.

但在我的机器上echo.会产生

process_begin: CreateProcess(NULL, echo., ...) failed.

我没有得到什么?

1 个答案:

答案 0 :(得分:1)

似乎echo不使用cmd.exe(windows命令解释程序)。请尝试从您的make脚本运行此代码:

%systemroot%\system32\cmd.exe /C "echo."

这将运行echo.命令,然后终止嵌套的解释器进程。