1:/*
   2: * Copyright (c) 2004, Brian Hawkins
   3: * Permission is granted to use this code without restriction as long
   4: * as this copyright notice appears in all source files.
   5: */
   6: 
   7:objExt = ".obj";
   8:exeExt = ".exe";
   9:libExt = ".dll";
  10:libPre = "";
  11:platform = "Windows";
  12:
  13:String getCompileCommand(String target, String src, String[] includes)
  14:    {
  15:    ccincs = make.fixPath(includes);
  16:    tFile = new File(target);
  17:    outDir = make.fixPath(tFile.getParent());
  18:    
  19:    ccincs = make.substitute("(.+)", "/I $0", ccincs);
  20:    
  21:    ccflags = "/nologo /c /Zi /W4 /GX /WX /EHsc /GR /Fo"+outDir+"\\ /Fd"+
  22:            target.replaceFirst("(.*\\.)(.*)", "$1pdb")+" ";
  23:    
  24:    if (build.equals("debug"))
  25:        {
  26:        ccflags += "/LDd /MDd /Od /GZ ";
  27:        ccdefs = "/D_DEBUG ";
  28:        }
  29:    else
  30:        {
  31:        ccflags += "/LD /MD /O2 /Gy ";
  32:        ccdefs = "/DNDEBUG ";
  33:        }
  34:    
  35:    return ("cl.exe " + ccflags + ccdefs + make.arrayToString(ccincs) +" "+ src);
  36:    }
  37:
  38:    
  39:String getLinkCommand(String target, String[] linkFiles)
  40:    {
  41:    targetpdb = target.replaceFirst("(.*\\.)(.*)", "$1pdb");
  42:    targetlib = target.replaceFirst("(.*\\.)(.*)", "$1lib");
  43:    targetmap = target.replaceFirst("(.*\\.)(.*)", "$1map");
  44:    
  45:    kernel_libs = "kernel32.lib ";
  46:    ldflags = "/nologo /subsystem:console /nodefaultlib /incremental:no "+
  47:        "/mapinfo:exports /mapinfo:fixups /mapinfo:lines /debug /out:"+target+" "+
  48:        "/pdb:"+targetpdb+" /map:"+targetmap+" /machine:i386 ";
  49:        
  50:    if (build.equals("debug"))
  51:        kernel_libs += "msvcrtd.lib msvcprtd.lib ";
  52:    else
  53:        {
  54:        kernel_libs += "msvcrt.lib msvcprt.lib ";
  55:        ldflags += "/opt:ref ";
  56:        }
  57:        
  58:    return ("link.exe " + ldflags + make.fixPath(make.arrayToString(linkFiles)) + kernel_libs);
  59:    }