Changeset 1220
- Timestamp:
- 07/05/09 14:08:48 (3 years ago)
- Files:
-
- trunk/tools/rdmd.d (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tools/rdmd.d
r1219 r1220 5 5 std.algorithm, std.iterator, std.md5, std.path, std.regexp, std.getopt, 6 6 std.c.stdlib, std.process; 7 8 version (Posix) 9 { 10 enum objExt = ".o"; 11 enum binExt = ""; 12 } 13 else version (Windows) 14 { 15 enum objExt = ".obj"; 16 enum binExt = ".exe"; 17 } 18 else 19 { 20 static assert(0); 21 } 7 22 8 23 private bool chatty, buildOnly, dryRun, force; … … 113 128 const compilerFlags = args[1 .. programPos]; 114 129 115 // Change to the main module's directory; all searches will be116 // relative to that directory117 // auto initialDir = getcwd;118 // chdir(exeDirname);119 // scope(exit) chdir(initialDir);120 121 130 // Compute the object directory and ensure it exists 122 131 invariant objDir = getObjPath(root, compilerFlags); … … 154 163 assert(0); 155 164 } 165 // Add an ".exe" for Windows 166 exe ~= binExt; 156 167 157 168 // Have at it … … 193 204 tmpRoot = std.process.getenv("TMP"); 194 205 } 195 if (!tmpRoot) tmpRoot = "./.rdmd";196 else tmpRoot ~= "/.rdmd";206 if (!tmpRoot) tmpRoot = join(".", ".rdmd"); 207 else tmpRoot ~= pathsep ~ ".rdmd"; 197 208 } 198 209 exists(tmpRoot) && isdir(tmpRoot) || mkdirRecurse(tmpRoot); … … 254 265 return result; 255 266 } 256 // clean up the object file, not needed anymore257 //remove(std.path.join(objDir, basename(root, ".d")~".o"));258 267 // clean up the dir containing the object file 259 268 rmdirRecurse(objDir); … … 279 288 { 280 289 string d2obj(string dfile) { 281 return std.path.join(objDir, chomp(basename(dfile), ".d")~ ".o");290 return std.path.join(objDir, chomp(basename(dfile), ".d")~objExt); 282 291 } 283 292
