Subject: Re: How to avoid GNU make case sensitivity?
From: [email-masked] ("Michael A. Chase")

16 Aug 1997 12:13:45 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
Original-To: "Richard Stanton" <[email-masked]>, <[email-masked]>
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 4.71.1008.3
X-MimeOle: Produced By Microsoft MimeOLE Engine V4.71.1008.3
Original-Sender: [email-masked]

The following script works under sh, ksh, and bash.  One caution, it
doesn't deal with spaces in filenames.

:
# llcase, lucase, lxcase, ulcase, uucase, uxcase, xlcase, xucase, xxcase
# Convert file name case
# The first  character of the script name indicates the base name change
# The second character indicates the extension name change
#    u = force to upper case
#    l = force to lower case
#    [^ul] = leave alone

upper_name=0
lower_name=0
upper_type=0
lower_type=0
base=`basename $0`
case $base in
   u?*) upper_name=1 ;;
   l?*) lower_name=1 ;;
esac
case $base in
   ?u*) upper_type=1 ;;
   ?l*) lower_type=1 ;;
esac

for file in $*
do
   [ ! -f $file ] && continue      # skip non-files
   filepath=`dirname  $file`
   filename=`basename $file`
   basename=$filename
   filetype=`echo $filename | sed -ne 's/^.*\(\.[^\.]*\)$/\1/p'`
   filename=`echo $filename | sed -e  's/^\(.*\)\.[^.]*$/\1/'`
   [ $upper_name = 1 ] && filename=`echo $filename | tr '[a-z]' '[A-Z]'`
   [ $lower_name = 1 ] && filename=`echo $filename | tr '[A-Z]' '[a-z]'`
   [ $upper_type = 1 ] && filetype=`echo $filetype | tr '[a-z]' '[A-Z]'`
   [ $lower_type = 1 ] && filetype=`echo $filetype | tr '[A-Z]' '[a-z]'`
   [ "X$basename" != "X${filename}${filetype}" ] && \
      mv $file ${filepath}/${filename}${filetype}  # skip if name won't
change
done
-----Original Message-----
From: Richard Stanton <[email-masked]>
To: [email-masked] <[email-masked]>
Date: Friday, August 15, 1997 01:08
Subject: How to avoid GNU make case sensitivity?

>I have lots of C files on a FAT (DOS style) formatted disk. Now I'm
>running NT, and when I try to use GNU make to compile stuff, it
>doesn't recognize the files' existence, since NT thinks all the
>filenames are upper case. For example, if I type
>
>make test.o
>
>I get an error message about not having a rule to make test.o, when a
>directory listing shows the file TEST.C existing on the
>drive. Renaming it manually to test.c allows me to compile it OK, but
>I'd rather avoid manually renaming every .C file on my system one at a
>time.

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".