Eventually, a gratefully accepted patch to the User's Manual (or FAQ) will be submitted that includes Igor Pechtchanski's detailed explanation, and we'll be able to simply point questioners to it with a URL.
> > 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:<mode>", where <mode> 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 > -- -- 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/