bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Follow-up


From: Rob Holbert
Subject: Follow-up
Date: Mon, 11 Jul 2011 15:24:18 -0400

Wanted to followup to my earlier email. Attached is the smallest makefile I could create to demonsterate the issue.
 
or
 
#does not sort lexically like expected
LIST = $(sort widget.c main.c ad.c Buzzer.c)
#target
all: list
list:
    @echo $(LIST)
.PHONY: all list
 
Previous email:
Hello,
 
I ran across perhaps a bug or need for another feature at least. If a list of items has words beginning with both upper and lower case letters, the resulting $(sort $(LIST)) will result in all capital letter words coming before the lower case words. In this case, Zebra.c would appear before apple.c. This is dictated by the ASCII chart of course. However, it is not lexical order as the manual explains the function is. Lexical would be apple.c Zebra.c.
 
This is solved easily by making the sort comparison convert all alphas to lower case before comparing, leaving the original string case unchanged. 
 
I like to use sort to put my sources in order. This way it is easier to see if an object file is missing for instance.
 
Best Regards,
Rob

Attachment: Makefile
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]