Also read up on 'Command Execution'. If you want to avoid that each command
is executed by a new shell, try this

%.foo : %.bar:
   baz $*.spam ; spam $*.eggs > $@

or

%.foo : %.bar:
   baz $*.spam && spam $*.eggs > $@

I sometime need the makefile to create intermediate scripts; here's a simple
way
to do that:

%.foo : %.bar:
   ( echo "baz $*.spam" ; echo "spam $*.eggs" > $@

kind regards
Peter Ring

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
Of Peter Ring
Sent: 29. november 2002 10:14
To: Jens Schweikhardt; [EMAIL PROTECTED]
Subject: RE: Here Documents in commands


Read up on 'Defining Variables Verbatim', the define directive. Using
define, you can assign a multi-line value to a variable. This multi-line
variable can of course contain references to variables that will get
expanded when you reference the multi-line variable. Bingo, you've got a
multi-line template.

Kind regards
Peter Ring



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf
Of Jens Schweikhardt
Sent: 28. november 2002 20:36
To: [EMAIL PROTECTED]
Subject: Here Documents in commands


hello, world\n

I've been thinking long and deep and even made a few attempts at using
shell "here documents" in the commands for a rule. My conclusion is that
it is impossible, at least with a POSIX shell. Make's command execution
with sh is inherently line oriented, while here documents are multi-line
by definition. Continuing lines in the Makefile with backslash newline
can't work because the shell only sees the resulting single line.

In the remote event that I have overlooked something, does anyone
know a way how to get something like

        cat << EOF
        foo
        bar
        EOF

in a rule?

PS: Yes, I can get the same effect with a fews echos. Consider it a
    proof-of-concept question.

Regards,

        Jens
--
Jens Schweikhardt http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)


_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make



_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make



_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make

Reply via email to