mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 16:11:45 +00:00
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>
This commit is contained in:
parent
805a6af8db
commit
d060d963e8
1 changed files with 12 additions and 13 deletions
|
@ -253,17 +253,22 @@ if ($kconfig) {
|
||||||
# Read all Makefiles to map the configs to the objects
|
# Read all Makefiles to map the configs to the objects
|
||||||
foreach my $makefile (@makefiles) {
|
foreach my $makefile (@makefiles) {
|
||||||
|
|
||||||
my $cont = 0;
|
my $line = "";
|
||||||
|
|
||||||
open(MIN,$makefile) || die "Can't open $makefile";
|
open(MIN,$makefile) || die "Can't open $makefile";
|
||||||
while (<MIN>) {
|
while (<MIN>) {
|
||||||
my $objs;
|
# if this line ends with a backslash, continue
|
||||||
|
chomp;
|
||||||
# is this a line after a line with a backslash?
|
if (/^(.*)\\$/) {
|
||||||
if ($cont && /(\S.*)$/) {
|
$line .= $1;
|
||||||
$objs = $1;
|
next;
|
||||||
}
|
}
|
||||||
$cont = 0;
|
|
||||||
|
$line .= $_;
|
||||||
|
$_ = $line;
|
||||||
|
$line = "";
|
||||||
|
|
||||||
|
my $objs;
|
||||||
|
|
||||||
# collect objects after obj-$(CONFIG_FOO_BAR)
|
# collect objects after obj-$(CONFIG_FOO_BAR)
|
||||||
if (/obj-\$\((CONFIG_[^\)]*)\)\s*[+:]?=\s*(.*)/) {
|
if (/obj-\$\((CONFIG_[^\)]*)\)\s*[+:]?=\s*(.*)/) {
|
||||||
|
@ -271,12 +276,6 @@ foreach my $makefile (@makefiles) {
|
||||||
$objs = $2;
|
$objs = $2;
|
||||||
}
|
}
|
||||||
if (defined($objs)) {
|
if (defined($objs)) {
|
||||||
# test if the line ends with a backslash
|
|
||||||
if ($objs =~ m,(.*)\\$,) {
|
|
||||||
$objs = $1;
|
|
||||||
$cont = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach my $obj (split /\s+/,$objs) {
|
foreach my $obj (split /\s+/,$objs) {
|
||||||
$obj =~ s/-/_/g;
|
$obj =~ s/-/_/g;
|
||||||
if ($obj =~ /(.*)\.o$/) {
|
if ($obj =~ /(.*)\.o$/) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue