aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2012-01-13 17:50:39 -0500
committerSteven Rostedt <rostedt@goodmis.org>2012-01-13 18:01:39 -0500
commitd060d963e88f3e990cec2fe5214de49de9a49eca (patch)
tree294328e2ef8724f61965c49d63245f0f16052c1f /scripts
parent805a6af8dba5dfdd35ec35dc52ec0122400b2610 (diff)
kconfig/streamline-config.pl: Simplify backslash line concatination
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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/streamline_config.pl25
1 files changed, 12 insertions, 13 deletions
diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl
index ec7afce4c88d..42ef5ea5ebdc 100644
--- a/scripts/kconfig/streamline_config.pl
+++ b/scripts/kconfig/streamline_config.pl
@@ -253,17 +253,22 @@ if ($kconfig) {
253# Read all Makefiles to map the configs to the objects 253# Read all Makefiles to map the configs to the objects
254foreach my $makefile (@makefiles) { 254foreach my $makefile (@makefiles) {
255 255
256 my $cont = 0; 256 my $line = "";
257 257
258 open(MIN,$makefile) || die "Can't open $makefile"; 258 open(MIN,$makefile) || die "Can't open $makefile";
259 while (<MIN>) { 259 while (<MIN>) {
260 my $objs; 260 # if this line ends with a backslash, continue
261 261 chomp;
262 # is this a line after a line with a backslash? 262 if (/^(.*)\\$/) {
263 if ($cont && /(\S.*)$/) { 263 $line .= $1;
264 $objs = $1; 264 next;
265 } 265 }
266 $cont = 0; 266
267 $line .= $_;
268 $_ = $line;
269 $line = "";
270
271 my $objs;
267 272
268 # collect objects after obj-$(CONFIG_FOO_BAR) 273 # collect objects after obj-$(CONFIG_FOO_BAR)
269 if (/obj-\$\((CONFIG_[^\)]*)\)\s*[+:]?=\s*(.*)/) { 274 if (/obj-\$\((CONFIG_[^\)]*)\)\s*[+:]?=\s*(.*)/) {
@@ -271,12 +276,6 @@ foreach my $makefile (@makefiles) {
271 $objs = $2; 276 $objs = $2;
272 } 277 }
273 if (defined($objs)) { 278 if (defined($objs)) {
274 # test if the line ends with a backslash
275 if ($objs =~ m,(.*)\\$,) {
276 $objs = $1;
277 $cont = 1;
278 }
279
280 foreach my $obj (split /\s+/,$objs) { 279 foreach my $obj (split /\s+/,$objs) {
281 $obj =~ s/-/_/g; 280 $obj =~ s/-/_/g;
282 if ($obj =~ /(.*)\.o$/) { 281 if ($obj =~ /(.*)\.o$/) {