开发者

Building with Build.exe and dirs/sources and Visual Studio 2010/11

  1. Is there any way to tell Visual Studio 2010 (or Visual Studio 11 Developer Preview) to use a sources file?

  2. Is there any tools for converting from nmake/dirs/sources to MSBuild?

I really want to use the Visual Studio 11 Developer Preview Code Analysis tools on a very old C++ solution, which currently doesn't even come close to being able to compile in Visual Studio.

Here's an example of one of the many sources files:

!INCLUDE $(INETROOT)\build\paths.all
!INCLUDE $(INETROOT)\build\sources.all

TARGETNAME=CSDWCtlg
TARGETTYPE=DYNLINK

DLLENTRY=DllMainCRTStartupCustom
DLLDEF=
USE_NATI开发者_如何学PythonVE_EH=1
NO_NTDLL=1

NTTARGETFILE0=$(EXPORTED_FILES)

INCLUDES=   \
    $(INCLUDES); \
    $(SDK_INC_PATH); \
    $(ATL_INC_PATH); \
    $(CSSTORAGE)\inc; \
    $(CSSTORAGE)\util\inc; \
    $(CSSTORAGE)\dbg; \
    $(CSSTORAGE)\msg; \
    $(CSSTORAGE)\intf\idl; \
    $(CSSTORAGE)\ctlg; \
    $(CSSTORAGE)\provider; \
    $(CSSTORAGE)\dsproviders\inc\; \
    $(CSCOMMON)\rockall4\Build\Rockall\Include; \
    $(CSCOMMON)\rockall4\Code\Rockall\Interface; \
    $(CSCOMMON)\kbase; \
    $(CSCOMMON)\inc; \

# goes to both RC compiler and C compiler

# RUN_WPP=$(SOURCES)  -func:{LEVEL=Error}ErrorTrace(ERR,MSG,...) -func:{LEVEL=Debug}DebugTrace(DBG,MSG,...)  
C_DEFINES=$(C_DEFINES) /D_UNICODE /DUNICODE /DPROJ_METABASE /DCSTRACE_CSDWCTLG /D_CTLG_DIAGNOSTIC#1 

USER_C_FLAGS=$(USER_C_FLAGS) -D_CTLG_DIAGNOSTIC=1 -GR -D_WIN32_WINNT=0x0500 -DOLEDBVER=0x0250 

# check for 64-bit compatiblitly
!if "$(PROCESSOR_ARCHITECTURE)"=="x86"
USER_C_FLAGS = $(USER_C_FLAGS) /Wp64
!endif

# The line below includes the common build flags.
# It modifies the USER_C_FLAGS variable by appending the 'project' level flags.
# Be sure to use the syntax USER_C_FLAGS=$(USER_C_FLAGS) 'flags' if you use USER_C_FLAGS after this include.

!INCLUDE $(CSSTORAGE)\inc\userFlags$(DCRT).inc
USE_MSVCRT=1


PRECOMPILED_CXX=1
PRECOMPILED_INCLUDE=pch.hpp
PRECOMPILED_PCH=pch_hpp.pch
PRECOMPILED_OBJ=pch_hpp.obj

SOURCES=\
     csdwctlg.rc \
     pch.cpp \
         dll.cpp \
     crow.cpp \
     ctlgdump.cpp \
     ctlghandler.cpp \
     ctlgobj.cpp \
     ctlgobjaccess.cpp \
     ctlgobjclsdef.cpp \
     ctlgobjdefs.cpp \
     ctlgobjget.cpp \
     ctlgobjkeydef.cpp \
     ctlgobjmemdef.cpp \
     ctlgobjrel.cpp \
     ctlgobjrow.cpp \
     ctlgobjset.cpp \
     ctlgobjtbl.cpp \
     ctlgobjtbls.cpp \
     ctlgobjtypedef.cpp \
     ctlgobjview.cpp \
     ctlgpersist.cpp \
     ctlgresolve.cpp \
     ctlgresolve2.cpp \
     ctlgpartresolve.cpp \
     ctlgaggrresolve.cpp \
     ctlgfilterresolve.cpp \
     ctlgvalidate.cpp \
     expschema.cpp \
     mbcatalog.cpp \
     mbictlgchg.cpp \
     schemamgr.cpp \
     sqlpathtrans.cpp \

TARGETLIBS= \
    $(DEFAULTLIBS) \
    $(SDK_LIB_PATH)\ole32.lib \
    $(SDK_LIB_PATH)\oleaut32.lib \
    $(SDK_LIB_PATH)\uuid.lib \
    $(SDK_LIB_PATH)\urlmon.lib \
    $(TARGETPATH)\*\CSDWIntf.lib \
    $(TARGETPATH)\*\CSDWUtil.lib \
    $(SDK_LIB_PATH)\msi.lib     \
    $(TARGETPATH)\*\csrockall.lib   \
    $(TARGETPATH)\*\CSDWSrvrDLL.lib \
    $(SDK_LIB_PATH)\Kernel32.lib \
    $(SDK_LIB_PATH)\user32.lib \
    $(SDK_LIB_PATH)\Advapi32.lib \
    $(CRT_LIB_PATH)\oldnames.lib \
    $(SDK_LIB_PATH)\atls$(DCRT).lib \

# For Binplacing
MISCFILES= \
    .\SCHEMA\* \

Any advice?

UPDATE: I've found nmake2msbuild.exe which is part of the WDK. It is intended for driver development and converts dirs and sources to MSBuild projects. I am not sure if it's going to work for what I have to do (not drivers), but I'm going to give it a try.


I've found nmake2msbuild.exe which is part of the WDK. It is intended for driver development and converts dirs and sources to MSBuild projects.

Some manual tweaking of the sources files was required to get the tool to complete conversion. It doesn't do everything, but helps get things on track.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜