Make And Shell


Table of Contents

How to use heredoc in makefile 
shell output in make 
Symptom 
Solution 

How to use heredoc in makefile 

Newsgroups: comp.unix.questions,comp.unix.programmer
> I remember seeing this somewhere but can't get it going now: How can
> I use heredoc in makefile?

AFAIK, the lines in a makefile are passed to the shell one by one, so the shell never gets a multi-line input (with the "here document").

You need to tell "make" that these lines belong together, you do so by a backslash '' as the very last character on all lines (but the last one).

I would not trust that this always works correctly on all platforms, so it might be better to use separate files for the "here document".

Joerg Bruehe