Search code examples
makefiledos

Echo newline in make script


I have a make rule for compiling .c files in my project which looks like this

# 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 $?
    ...

Now at the end of this I want a newline to nicely separate the output from the compilation of each file.

I have seen How can you echo a newline in batch files? and similar threads and they all seem to suggest echo.

But on my machine echo. results in

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

What am I not getting?


Solution

  • It seems that echo is not use the cmd.exe (windows command interpreter). Try running this from your make script instead:

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

    This runs the echo. command, then terminates the nested interpreter process.