Here documents: do they work in FreeBSD make?

Tim Kientzle tim at kientzle.com
Sun Nov 22 00:09:19 UTC 2015


> On Nov 21, 2015, at 3:15 PM, Yuri <yuri at rawbw.com> wrote:
> 
> This syntax doesn't work for me:
>        @cat <<EOF >${MY_DIR}/my-file \
>          #!/bin/sh \
>          \
>          echo 'Hello World!'  \
>          EOF \
> 
> ${MY_DIR}/my-file is created empty.

If you really need to build files programmatically as
part of your makefile, create separate shell scripts
and invoke those from make instead:

In makefile:
    ${TOPDIR}/build-file ${MY_DIR}/my-file




More information about the freebsd-hackers mailing list