Skip to contentSkip to conversation

Makefile: Accept target names in all lower case to ease matching

PATCH New Henrik Nordström 2 participants 5 messages Nov 25, 2012 – Nov 26, 2012 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Makefile: Accept target names in all lower case to ease matching

---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Makefile +1 -0
index 1a17be9..5a98745 100644
@@ -752,6 +752,7 @@ unconfig:
 sinclude $(obj).boards.depend
 $(obj).boards.depend:	boards.cfg
 	@awk '(NF && $$1 !~ /^#/) { print $$1 ": " $$1 "_config; $$(MAKE)" }' $< > $@
+	@awk '(NF && $$1 !~ /^#/ && tolower($$1) != $$1) { print tolower($$1) ": " $$1 "_config; $$(MAKE)" }' $< > $@
 
 #
 # Functions to generate common board directory names
Signature · 1 line
1.7.7.6
#1 lore raw

PATCH 2/2 Makefile: Accept target names in all lower case to ease matching

Dear Henrik Nordstr?m,

Makefile unconfig: · line 755

Quoted 13 lines · In message <[email protected]> you wrote:
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Makefile +1 -0
index 1a17be9..5a98745 100644
@@ -752,6 +752,7 @@ unconfig:
 sinclude $(obj).boards.depend
 $(obj).boards.depend:	boards.cfg
 	@awk '(NF && $$1 !~ /^#/) { print $$1 ": " $$1 "_config; $$(MAKE)" }' $< > $@
+	@awk '(NF && $$1 !~ /^#/ && tolower($$1) != $$1) { print tolower($$1) ": " $$1 "_config; $$(MAKE)" }' $< > $@

NAK. This is not DOS. Names are case sensitive.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Build a system that even a fool can use and only a fool will want  to
use it.
#2 lore raw

PATCH 2/2 Makefile: Accept target names in all lower case to ease matching

s?n 2012-11-25 klockan 18:45 +0100 skrev Wolfgang Denk:

Quoted 7 lines

Dear Henrik Nordstr?m,

Quoted 4 lines · In message <[email protected]> you wrote:
---
 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Quoted 11 lines

Makefile unconfig: · line 755

Quoted 9 lines
Makefile +1 -0
index 1a17be9..5a98745 100644
@@ -752,6 +752,7 @@ unconfig:
 sinclude $(obj).boards.depend
 $(obj).boards.depend:	boards.cfg
 	@awk '(NF && $$1 !~ /^#/) { print $$1 ": " $$1 "_config; $$(MAKE)" }' $< > $@
+	@awk '(NF && $$1 !~ /^#/ && tolower($$1) != $$1) { print tolower($$1) ": " $$1 "_config; $$(MAKE)" }' $< > $@

NAK. This is not DOS. Names are case sensitive.

Ok, then I'll swing the patch in the other direction and make target names actually case sensitive. Because today they are a bit confused partially case-insensitive.

Note that it's not about board config file names or directory names, only about the first column in boards.cfg.

Regards
Henrik

---
From: Henrik Nordstrom <[email protected]>
Date: Sun, 25 Nov 2012 19:00:12 +0100
Subject: [PATCH] mkconfig: Make board name matching case-sensitive

As per mail discussion board names are supposed to be case-sensitive

---
 mkconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
mkconfig +1 -1
index 7c9aa74..324703f 100755
@@ -21,7 +21,7 @@ options=""
 
 if [ \( $# -eq 2 \) -a \( "$1" = "-A" \) ] ; then
 	# Automatic mode
-	line=`egrep -i "^[[:space:]]*${2}[[:space:]]" boards.cfg` || {
+	line=`egrep "^[[:space:]]*${2}[[:space:]]" boards.cfg` || {
 		echo "make: *** No rule to make target \`$2_config'.  Stop." >&2
 		exit 1
 	}
Signature · 1 line
1.7.7.6
#3 lore raw

PATCH 2/2 Makefile: Accept target names in all lower case to ease matching

Dear Henrik Nordstr?m,

Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 5 lines

Review

Quoted 3 lines
(quoted diff) +1 -0
 	@awk '(NF && $$1 !~ /^#/) { print $$1 ": " $$1 "_config; $$(MAKE)" }' $< > $@
+	@awk '(NF && $$1 !~ /^#/ && tolower($$1) != $$1) { print tolower($$1) ": " $$1 "_config; $$(MAKE)" }' $< > $@

NAK. This is not DOS. Names are case sensitive.

Ok, then I'll swing the patch in the other direction and make target names actually case sensitive. Because today they are a bit confused partially case-insensitive.

Where exactly?

Quoted 2 lines

Note that it's not about board config file names or directory names, only about the first column in boards.cfg.

Well, these are make targets, so they are definitely case sensitive.

mkconfig options="" · line 24

Quoted 4 lines

if [ \( $# -eq 2 \) -a \( "$1" = "-A" \) ] ; then

mkconfig +1 -1
 	# Automatic mode
-	line=`egrep -i "^[[:space:]]*${2}[[:space:]]" boards.cfg` || {
+	line=`egrep "^[[:space:]]*${2}[[:space:]]" boards.cfg` || {

Did you test what gets broken by this patch?

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I'd like to meet the man who invented sex and see what  he's  working
on now.
#4 lore raw

PATCH 2/2 Makefile: Accept target names in all lower case to ease matching

s?n 2012-11-25 klockan 21:04 +0100 skrev Wolfgang Denk:

Quoted 8 lines

Well, these are make targets, so they are definitely case sensitive.

mkconfig options="" · line 24

Quoted 4 lines

if [ \( $# -eq 2 \) -a \( "$1" = "-A" \) ] ; then

mkconfig +1 -1
 	# Automatic mode
-	line=`egrep -i "^[[:space:]]*${2}[[:space:]]" boards.cfg` || {
+	line=`egrep "^[[:space:]]*${2}[[:space:]]" boards.cfg` || {

Did you test what gets broken by this patch?

All normal "make targetname" is unaffected by the change as they are case sensitive.

What gets broken by the change os someone calling

make wronglycasedtargetname_config

Or direct invocation of

./mkconfig -A wronglycasedtargetname

Regards
Henrik