Date: Sun, 4 Apr 1999 09:16:39 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Gisle Vanem cc: djgpp AT delorie DOT com Subject: Re: Empty commands in make 3.77 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Fri, 2 Apr 1999, Gisle Vanem wrote: > I've discovered what I regard as a rather serious bug in make 3.77. It's not a bug in Make, it's a DOS ``feature''. > $(CP) expands to `' causing `libvgagl.a e:/djgpp/lib' to be executed. > `CP = cp.exe' was in `makefile.cfg'. > > This "shell command" resulted in crash inside DOS (seg 273h) and some > lost clusters. No serious harm done (chkdsk fixed it). > > What is make trying to do here? It tried to invoke libvgagl.a as if it were a .COM-style executable. The empty string is just a whitespace at the beginning of the command: Make simply skips it, since valid command lines can have leading whitespace. > And how on earth can an archive be executed like this? That's what DOS does, Make cannot do anything to prevent it. DOS first looks for the "MZ" signature in the file, and if it isn't present, assumes the file is a .COM image and ``runs'' it, with obvious consequences. Make cannot avoid this, because otherwise it would need to know about all possible formats of executable files, including PE/NE executables, .bat, .btm, Perl and whatever batch files/shell scripts, etc. It currently only knows about a handful of these, and leaves the rest to DOS and the user (you) to figure out.