Skip to content

Commit

Permalink
kconfig/streamline-config.pl: Simplify backslash line concatination
Browse files Browse the repository at this point in the history
Simplify the way lines ending with backslashes (continuation) in Makefiles
is parsed. This is needed to implement a necessary fix.

Tested-by: Thomas Lange <thomas-lange2@gmx.de>
Cc: stable@vger.kernel.org
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed Jan 13, 2012
1 parent 805a6af commit d060d96
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions scripts/kconfig/streamline_config.pl
Original file line number Diff line number Diff line change
Expand Up @@ -253,30 +253,29 @@ sub read_kconfig {
# Read all Makefiles to map the configs to the objects
foreach my $makefile (@makefiles) {

my $cont = 0;
my $line = "";

open(MIN,$makefile) || die "Can't open $makefile";
while (<MIN>) {
my $objs;

# is this a line after a line with a backslash?
if ($cont && /(\S.*)$/) {
$objs = $1;
# if this line ends with a backslash, continue
chomp;
if (/^(.*)\\$/) {
$line .= $1;
next;
}
$cont = 0;

$line .= $_;
$_ = $line;
$line = "";

my $objs;

# collect objects after obj-$(CONFIG_FOO_BAR)
if (/obj-\$\((CONFIG_[^\)]*)\)\s*[+:]?=\s*(.*)/) {
$var = $1;
$objs = $2;
}
if (defined($objs)) {
# test if the line ends with a backslash
if ($objs =~ m,(.*)\\$,) {
$objs = $1;
$cont = 1;
}

foreach my $obj (split /\s+/,$objs) {
$obj =~ s/-/_/g;
if ($obj =~ /(.*)\.o$/) {
Expand Down

0 comments on commit d060d96

Please sign in to comment.