Re: Using perl in a Makefile
Shao Zhang wrote:
> I know you can use shell script in a Makefile. My question is "Can I
> use perl then??"
> If I can, how do I do it?? Just putting in the line
> #!/usr/bin/perl??
> In that case, how does make knows its relevant code, and perl knows
> the part that belongs to it??
You can easily use perl in makefiles:
foo:
perl -e '\
# perl code here, each line followed by \
# a slash \
'
Just make sure you escape all $ character in your perl code by doubling
them. This makes it look a bit ugly of course. I'm guilty of writing as much
as 1 page chunks of perl code into makefiles.
--
see shy jo
Reply to: