cURL / Mailing Lists / curl-library / Single Mail

curl-library

Potentially wiped disk with Makefile.b32

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Tue, 22 Mar 2011 10:55:40 +0100

I have a big problem with the use of "rmdir /s" in the Makefile.b32 files.
The 'make clean' could really create mayhem for a inexperienced user or
from a small error/typo in these makefiles. Here is a warning in this regard
(from the 4nt shell docs):
  /S (Subdirectories) (4NT, TC) This option is included only for compatibility
  with Windows NT 4.0's CMD.EXE, and should be used with EXTREME CAUTION!
  It deletes all files (including hidden and system files) in the named directory
  and all of its subdirectories, then removes all subdirectories. It can potentially
  erase all files on a drive with a single command.

This can happen if $(OBJDIR) becomes '\' for some reason.

To fix it, we should 'make clean' in 3 steps (delete the .obj, .int and the dir itself).
Are you reading this Yang? I could do this myself, but you seems to know Borland's
make much better.

Also there is a problem if you have e.g. 'rmdir.exe' on path (like i have with
CygWin's /usr/bin/rmdir.exe). AFAICS Borland's make doesn't have 'del', 'rmdir'
etc. internally (like wmake have). So if you have 'rmdir.exe on path, 'make clean'
doesn't work as intended. I think it would be better to let the shell perform the 'del',
'rmdir' etc.

--gv

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-03-22