This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

make win32 chokes on lone tab


We were having some real frustrating problems with make, 
but eventually (by chance) tracked the problem down to this:
If the final (or any) command in a rule is an "empty 
command" (as it's referred to in the documentation)(that is, 
the line begins with a tab, but is otherwise empty -- which, 
in most editors, looks like a blank line), make will 
terminate with a STATUS_ACCESS_VIOLATION error.

The problem occurs with the Cygwin port of gnu make, 
versions 3.77 and 3.79 (maybe others), but only in win32 mode 
(i.e., make --win32 ... OR set MAKE_MODE=win32 ...).

The obvious reply to this problem is "Well, silly -- get 
rid of the empty command lines!" That's exactly what we've 
done. But, since it doesn't cause a problem in --unix mode, 
it seems this might be a bug with --win32 mode. And, since 
the documentation (Writing the Commands in Rules) says that 
"Blank lines and lines of just comments may appear among the 
command lines", AND since this can be a really difficult 
problem to diagnose (since the error gives no clue what the 
problem is, and a lone tab is hard to see), it might be 
worth fixing.

I've written a simple makefile (see below) which 
demonstrates the problem. Also below is a transcript of a 
session which shows the problem, and provides info on 
versions, etc.

Regards-
    Scott Carter
--------------------- Transcript ----------------------

 [ For this demonstration, I removed sh.exe from my path 
   (renamed it). ]

D:\testmake>type makefile
# --- Filename: makefile
.PHONY : all

all:
	@echo The next rule command line is only a tab.
	
# --- The line above this one contains a single tab character.
	@echo The preceding rule command line is only a tab.

# EOF

D:\testmake>uname -a
CYGWIN_NT-4.0 SCARTER 1.1.2(0.21/3/2) 2000-06-06 22:20 i686 unknown
  [ OS: Windows NT 4.0 SP 5. ]
  [ I also tested on Window 98 -- had same problem. ]

D:\testmake>echo %MAKE_MODE%
%MAKE_MODE%
  [ i.e., MAKE_MODE is not in the environment. ]

D:\testmake>make_379c
The next rule command line is only a tab.
The preceding rule command line is only a tab.

D:\testmake>make_379c --win32
The next rule command line is only a tab.
      0 [main] make_379c 1000 handle_exceptions: Exception:
STATUS_ACCESS_VIOLATION
  18428 [main] make_379c 1000 stackdump: Dumping stack trace to
make_379c.exe.stackdump

D:\testmake>make_377c
The next rule command line is only a tab.
The preceding rule command line is only a tab.

D:\testmake>make_377c --win32
The next rule command line is only a tab.
      0 [main] make_377c 1000 handle_exceptions: Exception:
STATUS_ACCESS_VIOLATION
  18937 [main] make_377c 1000 stackdump: Dumping stack trace to
make_377c.exe.stackdump

D:\testmake>make_377g
The next rule command line is only a tab.
The preceding rule command line is only a tab.

D:\testmake>make_377g --win32 
make_377g: unrecognized option `--win32'
   [ This make appears NOT to be a Cygwin port -- it 
     doesn't recognize --win32. ]



D:\testmake>make_379c --version
GNU Make version 3.79, by Richard Stallman and Roland McGrath.
Built for i686-pc-cygwin
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
        Free Software Foundation, Inc.
   [...]

D:\testmake>make_377c --version
GNU Make version 3.77, by Richard Stallman and Roland McGrath.
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98
        Free Software Foundation, Inc.
   [...]


D:\testmake>make_377g --version
GNU Make version 3.77, by Richard Stallman and Roland McGrath.
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98
        Free Software Foundation, Inc.
   [...]
   [ This one appears NOT to be a Cygwin port. I don't know 
     its origin. ]



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]