bugmake - Bugs: bug #11183, DOS path / Windows path in...

 
 

bug #11183: DOS path / Windows path in implicit rule

Submitter:  None
Submitted:  Wed 01 Dec 2004 01:38:53 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  psmith Open/Closed:  Closed
Component Version:  3.80 Operating System:  MS Windows
Fixed Release:  3.81 Triage Status:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 13 Feb 2006 11:39:40 PM UTC, comment #2: 

Based on Eli's recommendation I tried to fix this.  Hopefully I succeeded!

Paul D. Smith <psmith>
Group administrator
Sun 27 Feb 2005 06:29:08 PM UTC, comment #1: 

All users of GNU make, even those on DOS/Windows systems, are strongly urged to use "/" pathname separators and not "\", everywhere in their makefiles.  Make's quoting rules are somewhat haphazard and it's not always clear when "\" is treated as a normal character and when it's treated as an escape character.

Paul D. Smith <psmith>
Group administrator
Wed 01 Dec 2004 01:38:53 PM UTC, original submission:  

Having a DOS style path in an implicit rule doesn't work.  It's fixed with this modification in implicit.c, function pattern_search (the new code is in the "HAVE_DOS_PATHS" conditional which is used throughout the code:

=================
/* Set CHECK_LASTSLASH if FILENAME contains a directory
prefix and the target pattern does not contain a slash.*/

#ifdef VMS
   check_lastslash = lastslash != 0
   && ((strchr (target, ']') == 0)
   && (strchr (target, ':') == 0));
#else
   check_lastslash = lastslash != 0
   && ( strchr (target, '/') == 0
   #ifdef HAVE_DOS_PATHS
      && strrchr( target, '\\' ) == 0
   #endif
   );
#endif
=================

This fix then shows an anomaly in the parser, as a double backslash is required for the destination in the rule, eg:

..\obj\linklist\\%.o:..\linklist\src\%.c

If you don't have it exactly as shown above, ie "DIR\\%.o" and "DIR\%.c", make won't be able to match the rule.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-04-01 psmith Fixed Release4.0 3.81
2006-02-13 psmith StatusNone Fixed
    Assigned toNone psmith
    Open/ClosedOpen Closed
    Fixed ReleaseNone 4.0

Back to the top

Powered by Savane 3.13-4448.
Corresponding source code