On 4/5/2010 2:39 PM, Mike Mestnik wrote:
Hello.
I've been fighting with getting here documents to work as part of a make
file, for example:

#!/usr/bin/make -f

LF:=%
PRELFSH:=/bin/sh -c "$$(printf '
POSTLFSH=' | tr '$(LF)' '\n')"

Here!! I got it working just great.

[nag...@testvm1 test]$ cat Makefile
#!/usr/bin/make -f

PRELFSH:=/bin/sh -c "$$(printf '
POSTLFSH=' | sed -e 's/\\$$//')"

.PHONY: all

all: helloworld
        @./helloworld

helloworld:
        @$(PRELFSH)gcc -E -o - - <<'\''EOF'\'' | gcc -x c -o helloworld - \
#include <stdio.h>\
int main( int argc, const char* argv[] ) {\
    printf("Hello World!!!\\n");\
    return(0);\
};\
EOF$(POSTLFSH)

[nag...@testvm1 test]$ make -B
Hello World!!!
[nag...@testvm1 test]$

--
Mike Mestnik
Technical Team
___
Nagios Enterprises, LLC
Email:  [email protected]
Web:    www.nagios.com


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to