Pismere Build Documentation

The Build Script

The tree uses the Pismere build script, build.pl. This script is known to work with ActivePerl build 517 (www.activestate.com). Older builds of ActivePerl had subtle incompatibility problems. Newer builds probably work...try them at your own risk.

The build works under Windows NT. It should work under Windows 95, but we do not test it regularly under that OS. You should use the default command-line shell for those OSes, or something fairly compatible.

Running the Build

Go to the directory you want to build and invoke the build script. The invocation will vary depending on how your system is set up. Here are the most common ways to build:

You may need to put perl at the start of each of the above commands, depending on whether your shell knows how to execute a .pl file.

Using the Build Script to Build Your Code

The build script works by entering a directory, and looking for a Makefile.src and a Makefile.dir file.

If the Makefile.src is present, the script will try to create the target defined by this file. Therefore, only one target can be created per directory. The target cannot consist of source files from other directories. If this is necessary, you should first build the other directory, creating a library, and then include that library as part of the target you're trying to build. If you need to create multiple targets from a set of source files, you can simply create additional directories that link in the object or library files created by the sources.

If the Makefile.dir is present, the script will try to build the directories indicated in this file. The directories can be build before and/or after the current directory.

Adding a component to the build

First, go to the directory where the component is located. Then, create a Makefile file, with the contents:

!include <Makefile.inc>

Then, create a Makefile.src as described below.

You will then be able to run build.pl in a variety of ways to get the most common types of builds. See Running the Build above for information on how to run build.pl.

Adding a subdirectory to the build

If you need to build subdirectories, create a Makefile.dir in the directory with the line:

DIRS=dir_1 dir_2
Where dir_n is the name of the subdirectory you want to build. The build will first build the current directory then the subdirectories.

Build Options Reference

Below are the options that control the build. These are in addition to any flags shown when you do a build.pl -?.

Common Global Build environment options

These are some of the common options you may want to use in building. You can set any option at the build.pl command-line. The default build is a debug build with browse information. It is important to realize that building browse information slows down the build quite a bit, so you may want to disable that at the command-line.

NODEBUG
set to 1 to build an optimized version of your app with no debug info (i.e., a release build).
VENDORMOD
set to the organization making a modification to the sources. This helps figure out who made this modified build.
NO_BSC
define to skip SBR/BSC creation for a debug build (this is the default for a release build unless FORCE_BSC is defined)
FORCE_BSC
define to force SBR/BSC creation for a release build (this is the default for a debug build unless NO_BSC is defined)

Uncommon Global Build environment options

You should not have to play with the settings in this section. They are here for completeness.

APPVER
[ 4.0 | 5.0 ] - for build time checking for OS version dependencies and to mark the executable with OS version information. (Default is 4.0.) [not much reason to use this]
TARGETOS
[ WIN95 | WINNT | BOTH ] - for some build time checking for platform dependencies. (Default is WINNT.) [not much reason to use this]
TARGETLANG
[ LANG_JAPANESE | LANG_CHINESE | LANG_KOREAN ] - for compile & link flags for building applications to run on Far-East Windows. (This is an optional parameter. The system locale is the default.) [not much reason to use this]
_WIN32_IE
[ 0x0300 | 0x0400 ] - for compile and link flags for building applications and components to run on Internet Explorer. (This is an optional parameter. IE 4.0 is the default.) [not much reason to use this]
NO_DEBUG_CRT
set to 1 to not use the debug version of the CRT when building a debug application.
NODEBUG
set to 1 to build an optimized version of your app with no debug info (i.e., a release build).
TUNE
set to 1 to get working set tuner info.
PROFILE
set to 1 to get call attributed profiling info.

Note: NODEBUG, TUNE, and PROFILE are mutually exclusive.

Makefile.src options

At this point, $(O) is the output directory. NODEBUG will indicate whether you're doing a release or debug build. STD_LIBS consists of standard Win32 libraries.

Required

NAME
base name of target (no extension)
TARGETTYPE
[ EXE | DLL | LIB ] - type of target
TARGETSS
[ console | windows ] - target subsystem
OBJS
list of object files (i.e., $(O)\foo.obj )

Optional

DEF_FILE
.def file, if any
RES
resource file, if any (i.e., $(O)\foo.res )

NO_PLACE
if defined, will not try to place output files
NO_OUT
if defined, will not create an output directory (avoid this)
NO_EXTERNAL_DEPS
if defined, will not use $(NAME).dep as a dependency file
USE_EXTERNAL_DEPS
if defined, will give warning if $(NAME).dep is not present

INCLUDES
list of include dirs, ;-delimtited (e.g., INCLUDES=..\include;..\foo\inc;"..\annoying path with space\inc" )
LIB_PATHS
list of lib dirs, ;-delimited (e.g., LIB_PATHS=..\lib;..\foo\lib )
LIBS
libraries to use (e.g., LIBS=foo.lib bar.lib ..\baz\$(O)\baz.lib or LIBS=$(STD_LIBS) )
USE_DEFAULTLIB
if defined, will use default libraries (the default is to only use the libraries specified in LIBS)

USE_MFC
use MFC (DLL by default)
USE_MFC_STATIC
use static MFC

USE_LIBC_STD
use static libc (not thread-safe)
USE_LIBC_MT
use thread-safe satic libc
USE_LIBC_DLL
use thread-safe libc DLL (default)
NO_LIBC
do not use any libc

USE_CPP_EH
define to get C++ exception handling (-GX)
PCH_FILE
set to header file to use for pre-compiled header
NO_BSC
define to skip SBR/BSC creation for a debug build (this is the default for a release build unless FORCE_BSC is defined)
FORCE_BSC
define to force SBR/BSC creation for a release build (this is the default for a debug build unless NO_BSC is defined)
KEEP_SBRS
define to not truncate SBR files when building a BSC file

GEN_MAP
generates a .map file in the build

C_FLAGS
define any additional flags to pass to the C/C++ compiler
RC_FLAGS
define any additional flags to pass to the resource compiler