Subject: | Error parsing line continuations |
Date: | Wed, 6 Jul 2011 13:04:32 -0600 |
To: | bug-Makefile-Parser [...] rt.cpan.org |
From: | Marcelo <marcelo.magallon [...] gmail.com> |
Hi,
$ cat test.mk
FOO = 1 \
2\
3
all:
@echo $(FOO)
$ make -f test.mk
1 2 3
$ cat parse-makefile
#!/usr/bin/perl
use strict;
use warnings;
use Makefile::Parser;
my $parser = Makefile::Parser->new;
$parser->parse(shift) or die Makefile::Parser->error;
foreach my $var ($parser->vars)
{
print $var, " = ", $parser->var($var), "\n";
}
return 0;
$ ./parse-makefile test.mk
FOO = 1 2\
# edit test.mk to add space before \ in the second line.
$ cat test.mk
FOO = 1 \
2 \
3
all:
@echo $(FOO)
$ ./parse-makefile test.mk
FOO = 1 2 3
$ make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for x86_64-redhat-linux-gnu
Makefile::Parser is 0.211.
Thanks!
Marcelo