::Sample batch file for building user compiler models. ::Requirements: :: - A C++ compiler. Known to work with Visual Studio 2010 :: - Boost, including the Boost Regex Library. Available at http://boost.org :: Obtain those libraries, then set the variables below. :: This sample makefile will build the sample C++ compiler model, :: samplecm.cpp, and create the DLL. The name of this model is :: "samplecm", so CodeSonar will attempt to load :: csurf\lib\libsamplecm.dll. :::::: Set these variables :::::: ::Root CodeSonar or CodeSurfer installation directory. set CSURF_INST=..\..\..\..\.. ::Source files for compiler models. See samplecm.cpp for an example. set TUTORIAL_SRC=samplecm.cpp ::Name of compiler model. set TUTORIAL_NAME=samplecm :: Location of boost. You have some options on how you want to build :: and link with boost. The easiest way is to download the source from :: boost.org, then set BOOST_INST. The build system will then build and :: link the regex source .cpp files with the library and link them :: together. You may need to change the name specified in :: BOOST_REGEX_LIB_FLAGS. You could instead build it yourself manually, :: and link it by setting BOOST_REGEX_LIB_FLAGS. set BOOST_INST=%CSURF_INST%\third-party\boost :: Unset this if you build Boost separately set BOOST_REGEX_SRC_FILES=%BOOST_INST%\libs\regex\src\*.cpp :: Boost regex library paths. Set LIBPATH if you build boost separately. :: set BOOST_REGEX_LIB_FLAGS="/LIBPATH:%BOOST_INST%\libs\regex\build libboost_regex.lib" set BOOST_REGEX_LIB_FLAGS=libboost_regex-vc100-mt-1_52.lib :: Build boost regex library cl /c %BOOST_REGEX_SRC_FILES% /DWIN32 /MD /nologo /Z7 /EHsc /EHsc /I %CSURF_INST%\csurf\include /I %BOOST_INST% lib *.obj /verbose /out:%BOOST_REGEX_LIB_FLAGS% :: Build library model source file. cl /c /Fo%TUTORIAL_NAME%.obj %TUTORIAL_SRC% /DWIN32 /MD /nologo /Z7 /EHsc /EHsc /I %CSURF_INST%\csurf\include /I %BOOST_INST% link /nologo /MANIFEST /MANIFESTUAC:NO /INCREMENTAL:NO /dll /out:lib%TUTORIAL_NAME%.dll /implib:lib%TUTORIAL_NAME%.lib /LIBPATH:%CSURF_INST%\csurf\lib %BOOST_REGEX_LIB_FLAGS% compmodel_util.lib /PDB:lib%TUTORIAL_NAME%.pdb /DEBUG %TUTORIAL_NAME%.obj copy lib%TUTORIAL_NAME%.dll %CSURF_INST%\csurf\lib