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:def getCompileCommand(target, src, includes): 14: ccincs = make.fixPath(includes) 15: from java.io import File 16: tFile = 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[:-3]+"pdb " 23: 24: if build == "debug": 25: ccflags += "/LDd /MDd /Od /GZ " 26: ccdefs = "/D_DEBUG " 27: else: 28: ccflags += "/LD /MD /O2 /Gy " 29: ccdefs = "/DNDEBUG " 30: 31: return ("cl.exe " + ccflags + ccdefs + make.arrayToString(ccincs) +" "+ src) 32: 33: 34:def getLinkCommand(target, linkFiles): 35: targetpdb = target[:-3] + "pdb" 36: targetlib = target[:-3] + "lib" 37: targetmap = target[:-3] + "map" 38: 39: kernel_libs = "kernel32.lib " 40: ldflags = "/nologo /subsystem:console /nodefaultlib /incremental:no "+ \ 41: "/mapinfo:exports /mapinfo:fixups /mapinfo:lines /debug /out:"+target+" "+ \ 42: "/pdb:"+targetpdb+" /map:"+targetmap+" /machine:i386 " 43: 44: if build == "debug": 45: kernel_libs += "msvcrtd.lib msvcprtd.lib " 46: else: 47: kernel_libs += "msvcrt.lib msvcprt.lib " 48: ldflags += "/opt:ref " 49: 50: return ("link.exe " + ldflags + make.fixPath(make.arrayToString(linkFiles)) + kernel_libs)