bugmake - Bugs: bug #13665, Error work with backslash...

 
 

bug #13665: Error work with backslash (continuation) in rules

Submitted by:  None
Submitted on:  Thu 07 Jul 2005 05:42:50 AM UTC  
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  Paul D. Smith <psmith> Open/Closed:  Closed
Component Version:  4.0 Operating System:  MS Windows
Fixed Release:  3.81 Triage Status:  None

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

( Jump to the original submission)

Thu 25 Aug 2005 04:44:46 AM UTC, comment #8: 

I applied a change that I hope will fix this problem for you.  For DOS/W32/OS2 systems where you're not using a UNIXy shell, make will handle backslash/newline condensing like it used to.

However, the TAB removal is still there.

If you try the CVS version or the next beta (beta4 or beyond) and you still have issues please add a note to this report with more details (and maybe some simpler examples).

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Sat 06 Aug 2005 01:11:39 PM UTC, comment #7: 

The OS/2 issue is not an error in make... well, it's a known backward-incompatible change which was made to conform to the POSIX spec.  If you're not using a POSIX shell on Windows and the normal Windows command.com etc. handle backslashes incompatibly I'm willing to make some changes to accomodate that.  But, I think that this change (to remove TAB at the beginning of the line) should be kept in all versions of make.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Sat 06 Aug 2005 05:47:38 AM UTC, comment #6: 

This affects OS/2 as well.  Building Mozilla the following:
p3p200010.xsl: resources/content/p3p.xsl.in Makefile.in
@$(RM) -f $@
$(PP) -DNAMESPACE=http://www.w3.org/2000/10/18/P3Pv1 \
-DHAS_TMPL_RETENTION\
$< > $@

causes an error because the -DHAS_TMPL_RETENTION gets combined with e:\path as in -DHAS_TMPL_RETENTIONe:\path.  Shell in use is
ASH. 

Anonymous
Mon 11 Jul 2005 05:24:14 AM UTC, comment #5: 

Steps :

1. CVS up make

2. prepare_w32.bat

3. nmake /f nmakefile

Test use WinRel/make.exe (with SHELL=cmd.exe)

_____________________________________________

I sample compiled job.c with patch :

<pre>
construct_command_argv_internal()
...
        else if (*p == '\\' && p[1] == '\n')
          {
#if 0
            /* POSIX says we keep the backslash-newline, but throw out the
               next char if it's a TAB.  */
            *(ap++) = '\\';
            (ap++) = (p++);
            (ap++) = p;
#else
#NOT POSIX method to skip backslash-newline for Windows
            ++p;
            ++p;
#endif
...
</pre>

Makefile rule with backslash-newline now work in my system.

---
With best regards.

Anonymous
Fri 08 Jul 2005 12:13:41 PM UTC, comment #4: 

In your build of make did you set fmode, add object files or use build switches that would cause your Makefile to be opened in binary mode?

Earnie

Earnie Boyd <earnie>
Fri 08 Jul 2005 03:57:44 AM UTC, comment #3: 

I try build make on MSVC v6 (SP5).

SED from http://unxutils.sf.net/
sed - example;, if use other utils in this rule - report error

If use make(3.80) from package "unxutils" - All ok.

Anonymous
Thu 07 Jul 2005 02:41:00 PM UTC, comment #2: 

Whose sed port are you using?

If you're mixing a native make with either Cygwin's or MSYS' sed then this may be the issue.

Earnie

Earnie Boyd <earnie>
Thu 07 Jul 2005 06:09:04 AM UTC, comment #1: 

This change in the way backslash-newline is handled was made to conform to the POSIX specification of make.  Please see the NEWS file and Savannah bug #1332.  The behavior you're seeing actually works fine on UNIX, with standard UNIX shells.  It's quite possible that something different will need to be done for Windows and other platforms, even though it's not strictly POSIX compliant.

However, before that can be done some investigation on Windows-style systems needs to be undertaken to fully understand the issues.

One important point which isn't addressed here is exactly which shell you're using with GNU make.  That could well make all the difference in the world.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Thu 07 Jul 2005 05:42:50 AM UTC, original submission:  

Platform WindowsXP (SP2)

Makefile rules with backslash not work

...
$(D_obj)/%.d: %$(SUF_SRC)
$(DD) $< $(DFLAGS) >$*.d1
sed -e 1i"$(*F).obj $(D_obj)/$(*F).d:"\\ \
-e "/^$$/d" \
-e "s/^.*$*.obj[:]*/\t/" \
-e "s/^.*/&\t\\/" $*.d1 >$(D_obj)\$(*F).d
@del $*.d1
...

After launch make, sed start with first string of parameters

sed -e 1i"mm.obj obj/mm.d:"\\ \

make output on concole:
...
sed -e 1i"mm.obj obj/mm.d:"\\ \
-e "/^$$/d" \
-e "s/^.*mm.obj[:]*/\t/" \
-e "s/^.*/&\t\\/" mm.d1 >obj\mm.d
sed.exe: can't read \\: no such file or directory
....

If write all parameters in one string - ALL OK
...
$(D_obj)/%.d: %$(SUF_SRC)
$(DD) $< $(DFLAGS) >$*.d1
sed -e 1i"$(*F).obj $(D_obj)/$(*F).d:"\\ -e "/^$$/d" -e "s/^.*$*.obj[:]*/\t/" -e "s/^.*/&\t\\/" $*.d1 >$(D_obj)\$(*F).d
@del $*.d1
...

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

 

Do you think this task is very important?
If so, you can add your encouragement to it.
This task has 0 encouragements so far.

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
2005-08-25 psmith StatusNone => Fixed
    Assigned toNone => psmith
    Open/ClosedOpen => Closed
    Fixed ReleaseNone => 4.0

Back to the top


Powered by Savane 3.5