""" * Copyright (c) 2004, Brian Hawkins * Permission is granted to use this code without restriction as long * as this copyright notice appears in all source files. """ objExt = ".obj" exeExt = ".exe" libExt = ".dll" libPre = "" platform = "Windows" def getCompileCommand(target, src, includes): ccincs = make.fixPath(includes) from java.io import File tFile = File(target) outDir = make.fixPath(tFile.getParent()) ccincs = make.substitute("(.+)", "/I $0", ccincs) ccflags = "/nologo /c /Zi /W4 /GX /WX /EHsc /GR /Fo"+outDir+"\\ /Fd"+ \ target[:-3]+"pdb " if build == "debug": ccflags += "/LDd /MDd /Od /GZ " ccdefs = "/D_DEBUG " else: ccflags += "/LD /MD /O2 /Gy " ccdefs = "/DNDEBUG " return ("cl.exe " + ccflags + ccdefs + make.arrayToString(ccincs) +" "+ src) def getLinkCommand(target, linkFiles): targetpdb = target[:-3] + "pdb" targetlib = target[:-3] + "lib" targetmap = target[:-3] + "map" kernel_libs = "kernel32.lib " ldflags = "/nologo /subsystem:console /nodefaultlib /incremental:no "+ \ "/mapinfo:exports /mapinfo:fixups /mapinfo:lines /debug /out:"+target+" "+ \ "/pdb:"+targetpdb+" /map:"+targetmap+" /machine:i386 " if build == "debug": kernel_libs += "msvcrtd.lib msvcprtd.lib " else: kernel_libs += "msvcrt.lib msvcprt.lib " ldflags += "/opt:ref " return ("link.exe " + ldflags + make.fixPath(make.arrayToString(linkFiles)) + kernel_libs)