Getting Started : Chapter 2 Building the Libraries : Building from the Command Line with nmake
Building from the Command Line with nmake
When you build from Microsoft Visual Studio, Visual Studio invokes nmake against the product's .mak file as an external makefile, with a command line argument that reflects the library you want to build. In the <stingray-installdir>\Src directory, there are makefiles for each product by supported compiler version. For example, the file toolkit10.mak is for building Toolkit with the MSVC 10.0 compiler. In the corresponding solution file, Toolkit10.sln for the above example, you can look in the project settings to find the command line invocation used.
Each product's .mak file invokes a back-end make file named bldback##.mak, which performs the actual build. The bldback##.mak files are located per product in the <stingray-installdir>\Src\<StingrayProduct>\BkEndMak subdirectory. Both the .mak files and bldback##.mak files are affected by the Build Wizard.
NOTE >> Some issues have been discovered in building with nmake on Vista and Windows 7. Please refer to the release notes for up-to-date information on these issues.
Using nmake Directly
Here is the syntax for using the nmake command:
To build a particular library denoted by <Target>, where <Target> = <ProductAbbrev><BuildConfig>, or the values ansi, unicode, or all. See below for values of <ProductAbbrev> and <BuildConfig>. Build is 32-bit unless the optional macro is included, in which case it is 64-bit.
 
nmake /f <ProductName>##.mak <Target> [BUILD64BIT=1]
To build all library variants described below. Builds are 32-bit unless the optional macro is included, in which case it is 64-bit.
 
nmake /f <ProductName>##.mak [BUILD64BIT=1]
To remove all intermediary files created by the build.
 
nmake /f <ProductAbbreviation>##.mak <Target> [CLEAN] [BUILD64BIT=1]
The <ProductName> variable corresponds to the product name as found in each product’s make file name, e.g., toolkit. Make files are located in <stingray-installdir>\Src.
The ## variable refers to one of the supported compiler versions as used in the make file names. For example, for VC++ 11.0 the numbers would be 11.
Table 3 – Product Abbreviations used in nmake targets
<ProductAbbreviation>
Product Name
oc
Chart
oe
Edit
og
Grid
ot
Toolkit
ov
Views
sfl
Stingray Foundation Library
Table 4 shows the different possible target specifications, and describes the resulting build.
Table 4 – Build target specifications
Target specification
Resulting build
<ProductAbbrev>
MFC Lib, Stingray Lib, Release
<ProductAbbrev>d
MFC Lib, Stingray Lib, Debug
<ProductAbbrev>a
MFC DLL, Stingray Lib, Release
<ProductAbbrev>ad
MFC DLL, Stingray Lib, Debug
<ProductAbbrev>as
MFC DLL, Stingray DLL, Release
<ProductAbbrev>asd
MFC DLL, Stingray DLL, Debug
<ProductAbbrev>u
MFC Lib, Stingray Lib, Unicode, Release
<ProductAbbrev>ud
MFC Lib, Stingray Lib, Unicode, Debug
<ProductAbbrev>au
MFC DLL, Stingray Lib, Unicode, Release
<ProductAbbrev>aud
MFC DLL, Stingray Lib, Unicode, Debug
<ProductAbbrev>asu
MFC DLL, Stingray DLL, Unicode, Release
<ProductAbbrev>asud
MFC DLL, Stingray DLL, Unicode, Debug
<ProductAbbrev>asm
MFC DLL, Stingray DLL, Release
<ProductAbbrev>asdm
MFC DLL, Stingray DLL, Debug
<ProductAbbrev>asum
MFC DLL, Stingray DLL, Unicode, Release
<ProductAbbrev>asudm
MFC DLL, Stingray DLL, Unicode, Debug
ansi
All ANSI (non-Unicode) build variants
unicode
All Unicode build variants
all
All ANSI and Unicode build variants
Compiling with 1-Byte Structure Alignment
The Stingray Studio product libraries are compiled using the default 8-byte structure alignment flag by default. If your application requires another alignment, such as 1-byte, you need to recompile the Stingray Studio product libraries to match it.
For a given library, you need to open the back-end make file, described above. So, for example, <stingray-installdir>\Src\Toolkit\BkEndMak\bldback10 if you want to build Toolkit with the MSVC 10.0 compiler. In this file, you will find an entry something like this:
 
...
These flags are common to all configurations:
COMMON_CPP=/nologo /D "WIN32" /D "_WINDOWS" $(OTPRO_FLAGS) /GX /W4
/c /Fp"$(INTDIR)/$(BUILDTARG).pch" /Fo"$(INTDIR)/" /GR /Zm200
/I "..\include" /I "..\src" /I "..\..\src"
To build with 1-byte structure alignment, add the flag /Zp1 to this set of flags:
 
...
These flags are common to all configurations:
COMMON_CPP=/nologo /D "WIN32" /D "_WINDOWS" $(OTPRO_FLAGS) /GX /W4
/c /Fp"$(INTDIR)/$(BUILDTARG).pch" /Fo"$(INTDIR)/" /GR /Zm200 /Zp1
/I "..\include" /I "..\src" /I "..\..\src"
Cleaning Generated Object Files
The intermediary object files that are produced from the Stingray Studio product libraries can appropriate significant disk space on your computer. After building the libraries, we recommend deleting these object files to reclaim the space on your hard drive. The pattern for the location of generated object files is:
 
<stingray-installdir>\Src\objs\<CompilerVersion>\<Architecture>
\<ProductAbbrev><ProductVersion><BuildConfig>
For example, the build objects for Toolkit built with the MSVC 10.0 compiler would be something like:
 
C:\RogueWave\Stingray Studio\10.0\Src\objs\vc10\x86\ot1104asd\*.obj