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')"
helloworld:
@$(PRELFSH)gcc -E -o - - <<EOF | gcc -x c -o helloworld - $(LF)\
#include <stdio.h>$(LF)\
int main (int argc, char* argv) {$(LF)\
printf(\"Hello World!!\n\");$(LF)\
}$(LF)\
EOF$(LF)$(POSTLFSH)
all: helloworld
@helloworld
####
Hmm, well this is not working. I have several other examples that are
working. This works.
gcc -E -o - - <<'EOF' | gcc -x c -o helloworld -
> #include <stdio.h>
> int main (int argc, char* argv) {
> printf("Hello World!!n");
> }
> EOF
As does this:
#!/usr/bin/make -f
LF:=!
PRELFSH:=/bin/sh -c "$$(printf '
POSTLFSH=' | tr '$(LF)' '\n')"
/etc/hosts: pkgrcs
@echo "For NagiosXI" | ci -l /etc/hosts
@$(PRELFSH)cat > /etc/hosts <<EOF$(LF)\
# $$I\
d$$$(LF)\
127.0.0.1 localhost $(hostname) nagiosxi$(serial)$(LF)\
::1 ip6-localhost ip6-loopback ip6-$(hostname) ip6-nagiosxi$(serial)$(LF)\
fe00::0 ip6-localnet$(LF)\
ff00::0 ip6-mcastprefix$(LF)\
ff02::1 ip6-allnodes$(LF)\
ff02::2 ip6-allrouters$(LF)\
ff02::3 ip6-allhosts$(LF)\
$(LF)\
EOF$(LF)$(POSTLFSH)
@ci -l -m"From $(MEID) $(serial)" /etc/hosts
@hostname $(hostname)
--
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