Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Thu, 31 Oct 2002 11:24:58 -0500 (EST) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Graff_Zoltan cc: cygwin AT cygwin DOT com Subject: RE: RE: MAKE - problem with small/capital letters in filenames In-Reply-To: Message-ID: Importance: Normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 31 Oct 2002, Harig, Mark A. wrote: > try: > > %.D: %.C > > or > > %.d: %.C > > > -----Original Message----- > > From: Graff_Zoltan [mailto:zotyo AT z1 DOT fszek DOT hu] > > Sent: Thursday, October 31, 2002 5:24 AM > > To: Harig, Mark A. > > Subject: Re: RE: MAKE - problem with small/capital letters in > > filenames > > > > > $ ls makefile hello.c > > > hello.c makefile > > Yes, it works if hello.c exists. But not work when HELLO.C exist. > > My files are on the netware file server, and I see all files with > > upper case letters under WinXp. > > Under DOS and Linux the makefile works only with lower case letters. > > > > If I change the '%.d: %.c' > > line to 'hello.d: hello.c' (with lower case letters) > > it works well. > > > > %.c isn't good, but hello.c is? > > Are the upper and lower case letters equal in file names, or not? > > If yes, '%.d: %.c' should work. > > If not, 'hello.d: hello.c' should not work. > > > > Thanks > > Zoltan Graff Please keep replies on-list. Thanks. Zoltan, In the Windows filesystem, there is indeed no difference between lowercase and uppercase letters in filenames (unless the Posix option is turned on under NT, but it probably isn't in your case). Cygwin has an option (in the CYGWIN environment variable) that controls whether it recognizes wrong-case filenames. The option is "check_case:", where is one of "strict", "relaxed", and "adjust". You can read up more on this in the User's Guide. From the information you provided, it seems you have it set to either "relaxed" or "adjust" (or unset, which defaults to "relaxed", IIRC). The check_case option, however, will only have effect if you try *opening* the file. The "%.d" construct in Makefiles performs another action on filenames, called "globbing". The globbing (same as the shell's "*.d") is not performed by Cygwin, but rather by the shell (or, in your case, make itself). Since the Cygwin ports of shells and make use stock Unix code as their base, there is no provision for globbing files with the wrong case (unless one was specifically put in, which I doubt). There may be options to control this, however, of which I'm not aware, so do read the man and info pages. This explains why "hello.d" works, but "%.d" doesn't: when the target is "hello.d", make tries to open (or stat) the file using Cygwin's system calls, and thus ignores the case (provided check_case is set appropriately). When the target is "%.d", make tries to glob all filenames that end in ".d" (not ignoring case), and thus doesn't find your HELLO.D. You can test this using "ls" in a shell (bash, in this case): $ export CYGWIN="$CYGWIN check_case:relaxed" $ ls hello.c $ ls Hello.C Hello.C $ ls *.C /bin/ls: *.C: No such file or directory $ If the options to allow case-insensitive globbing are present, all you have to do is turn them on (using the MAKEFLAGS environment variable for make, and the appropriate .*rc file for the shell, IIRC). If these options are not available, there are still a few ways to fix this. One is modifying your makefile to include both "%.d" and "%.D" as targets *every time* you need globbing. Another is keeping files on a local drive and using either rsync or cvs to synchronize it with the network drive (you'd have to set up a repository on the network drive for cvs, of course). And the third way, if you're feeling adventurous, is fixing the Cygwin ports of your favorite shell and make to allow case-insensitive globbing, and contributing the patches through this list to benefit the whole comminity and immortalizing your name in the archives as the guy who made globbing case-insensitive. :-D Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "Water molecules expand as they grow warmer" (C) Popular Science, Oct'02, p.51 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/