Changeset 220
- Timestamp:
- 01/29/07 16:03:07 (1 year ago)
- Files:
-
- trunk/buildme.d (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/buildme.d
r218 r220 58 58 private static const char[] objExt = ".obj"; 59 59 private static const char[] libExt = ".lib"; 60 private static const char[] libCmd = "@lib -n -p32"; 61 private static const char[] libCreateCmd = "@lib -c -n "; 60 private static const char[] libCmd = "@lib -c -n "; 62 61 private static const char[] libPre = ""; 63 62 } … … 66 65 private static const char[] objExt = ".o"; 67 66 private static const char[] libExt = ".a"; 68 private static const char[] libCmd = "ar -q "; 69 private static const char[] libCreateCmd = "ar -cr "; 67 private static const char[] libCmd = "ar -cr "; 70 68 private static const char[] libPre = "lib"; 71 69 } … … 128 126 if(lower.find("derelict") == 0) 129 127 { 130 packageList ~= c;128 packageList ~= (" " ~ c); 131 129 } 132 130 } … … 268 266 } 269 267 268 // replace each .d extension with the proper object file extension for the linker 269 fileList = fileList.replace(".d", objExt); 270 writefln(fileList); 271 270 272 // create the library 271 273 auto libName = libPre ~ packageName ~ libExt; 272 writefln("Creating library %s...", libName); 273 foreach(i, c; files) 274 { 275 auto obj = c.replace(".d", objExt); 276 auto cmd = i == 0 ? libCreateCmd : libCmd; 277 278 writefln("Adding object file %s", obj); 279 if(system(toStringz(cmd ~ "lib" ~ sep ~ libName ~ " " ~ obj)) != 0) 280 { 281 throw new Exception("Failed to create library " ~ libName); 282 } 283 writefln("Deleting object file %s", obj); 284 system(toStringz(delCmd ~ obj)); 285 } 286 274 writefln("Creating library %s...", libName); 275 if(system(toStringz(libCmd ~ "lib" ~ sep ~ libName ~ " " ~ fileList)) != 0) 276 { 277 throw new Exception("Failed to create library " ~ libName); 278 } 279 280 // delete the object files 281 writefln("Deleting object files..."); 282 system(toStringz(delCmd ~ " " ~ fileList)); 283 284 // strip the library on unices 287 285 version(NixExt) 288 286 {
