D.1 PM/CB (Intersolv Configuration Builder and PolyMake)

omake is highly compatible with PolyMake up to v4.0PM/CB Compatibility and with Intersolv PVCS Configuration Builder, to v5.1. omake supports all PM/CB macros and transformation macros, library object modules, local input scripts, and most directives.

System Macros

omake supports the PolyMake/Configuration Builder system macros listed in Table 25:

Table 25 PM/CB System Macros


System Macro

Value

omake Macro

_Arguments


The command-line arguments.


MAKEARGS


_Cwd


The current working directory.


MAKEDIR


_Directory


The current working directory.


MAKEDIR


_Exe


The pathname of the omake program.


MAKE


_FirstTarget


The first command-line target or, if none, the first makefile target.


FIRSTTARGET


_Flags


The command-line flags.


MAKEFLAGS


_FlagsMacros


The command-line flags and macros.



_InputFile


The current makefile.


INPUTFILE


_Macros


The command-line macros.


MAKEMACROS


_PctStatus


The status of last operation line.


status


_Script


The default or first-named makefile.


MAKEFILE


_Source


The source for current target.


.SOURCE


_SourceRev


Version control version of current target.


.VERSION


_Sources


The sources for current target.


.SOURCES


_SysVer


Operating system version: major.minor.



_TargRoot


The root part of the current target name.


.TARGETROOT


_Version


The PM/CB version number. omake reports v5.1.



M_ARGS


See _MakeArgs above.


MAKEARGS


MAKEARGS


See _MakeArgs above.


MAKEARGS


MAKEVER


See _Version above.



PCTSTATUS


See _PctStatus above.


status

Transformation Macros

omake supports PM/CB v5.x, both long and one-letter names. When an omake equivalent exists, it is listed in the right column of Table 26. Note that PM/CB macros work on text; omake modifiers work on a macro, which is expanded into text and modified. To use the omake equivalent, you need to define macro name with value text.

Table 26 PM/CB Transformation Macros


Trans. Macro

Long name

Result

omake Equiv.

$[@,text]


Include


Include contents of file text.


$(name,@)


$[c,str,begin,end]


Clip


Clip string str between begin and end.



$[d,text]


Directory


Directory part of text.


$(name,D)


$[e,text]


Extension


Extension part of text.


$(name,E,.=)


$[f,path,list,ext]


Filename


Build file name from path, list and ext.



$[l,text]


Lower


Convert text to lowercase.


$(name,LC)


$[m,spec,text]


Match


Elements in text that match file spec.


$(name,M"spec")


$[n,text]


Normalize


Normalize text as absolute file name.


$(name,A)


$[p,text]


Path


Pathname of text.


$(name,P)


$[r,text]


Base


Base name of text.


$(name,B)


$[s,separator,text]


Separators


Replace text separators with separator.


$(name,Wsep) 1


$[t,t1,t2,list]


Translate


Translate list mapping letters t1 to t2.



$[u,text]


Upper


Convert text to uppercase.


$(name,UC)


$[v,text]


Drive


Drive label of text.



$[w,text]


FileList


Wildcard expand file spec. text.


$(name,*F)


$[x,text]


DirList


Wildcard expand directory spec. text.


$(name,*D)


none


$[Root,text]


Root name of text.


$(name,R)


1. The separator can be enclosed in double quotes, which means that the separator must be parsed for special character sequences. The sep is never enclosed in double quotes and is always parsed for special characters.


Built-In Functions

In conditional expressions omake accepts:

%status

This is the exit status of last build script. It is the same as $(status) in omake.

Built-In Operations (Percent Directives)

%exit [ status ]

This directive terminates the make process with exit status (0 if status isn't given). Before terminating, the .DEINIT and .EPILOG special targets are run if they are defined. .DEINIT is run only if .INIT was run.

Directives

omake supports most PM/CB directives. For read-time interpretation, the directive starts in the first column of the makefile. For run-time interpretation, PM/CB emulation must be chosen and the directive must be indented.

Table 27 provides short descriptions of the supported directives.

Table 27 PM/CB Directives


Directive

Applicable Time

Description

.ExtraLine


read time


Causes an additional carriage return/linefeed to be output after each build script is executed. The negation is .NoExtraLine.


.Emulate [ Builder | NMAKE ]


read time


Sets the emulation mode to either Builder (PM/CB) or NMAKE.


.Ignore


read time


Causes nonzero build-script status to be ignored.


.Include [ = ] file ...


read time


Reads each file. If PM/CB emulation is chosen, omake looks for relative file names in the current directory. If PM/CB emulation is not chosen, omake treats .INCLUDE file the same as %include(file).


.KeepDir


read time

run time


Same as the omake .KEEPDIR directive.


.KeepIntermediate


read time

run time


Prevents intermediate files from being deleted.


.KeepWorking


read time

run time


Same as the omake .KEEPWORKING directive.


.Keep_Lis


read time

run time


Prevents local input scripts (inline response files) from being deleted. The negative of this directive is .NoKeep_Lis.


.KeepTemp


read time

run time


Same as the .Keep_Lis directive.


.Lis_Comments


read time


Causes # in local input scripts to be considered literally, rather than as a comment character. You can also use \# to mean a literal #.


.Lis_File [ = ] [ filename ]


read time

run time


Names the local input script file. Unlike PM/CB, omake allows a blank filename to reenable automatic generation of the local input script name.


.Logfile files


read time


Handled by omake as .PVCS_STORAGE : files


.Ms_Nmake


read time


Same as the omake .MS_NMAKE directive.


.NoEnvMacros


read time


Same as the omake .NOENVMACROS directive.


.Order


read time


Same as the PM/CB .Suffixes : directive.


.Path.xxx [ = ] dir-1[;dir-2]...


read time


Treated as an omake .PATH.xxx = dir-1[;dir-2]... macro definition.


.PermitComments


read time


Same as .Lis_Comments.


.Poly_Make


read time

run time


Same as the omake .POLY_MAKE directive.


.Precious


read time


Same as the PM/CB .KeepIntermediate directive.


.RejectInitFile


read time


Same as the omake .REJECT_RULES directive.


.Remake


read time


Targets are fully made each time they are encountered as sources.


.Shell [ shell_program ]


read time

run time


Similar to the omake .SHELL directive, but without automatic detection of when to use the shell program.


.Silent


read time


Build scripts are not displayed on the screen before execution.


.Source [ = ] dir_list file_list


read time


Gives search directories to files. The dir_list is a semicolon-separated list of directories. The file_list is a space-separated list of filenames or file extensions. When omake looks for a file, it sees whether the file name or its extension is on any file_list; if it is, omake searches for the file on the dir_list.


.Source [ .ext ] : [ dir-1 dir-2 ... ]


read time


This PM/CB .SOURCE dependency is identical to a .PATH macro and is treated as an .PATH.xxx = dir-1[;dir-2]... macro definition.


.Suffixes [ : ]


read time


Without a colon, this directive acts like omake's .REJECT_RULES directive. With a colon, it acts like the omake .SUFFIXES directive.


.VolatileTargs


read time


Same as the PM/CB .Remake directive.

Reserved Targets

omake supports the following PM/CB reserved targets:

.DEINIT [ : ]

If the .INIT special target was used, the build scripts of the .DEINIT target are executed immediately before the build scripts of .EPILOG are executed.
.EPILOG [ : ]

The same as the omake .AFTER special target. If emulating PM/CB, omake looks only for .EPILOG. Otherwise, it looks for .AFTER, and then .EPILOG.
.INIT [ : ]

This target's build scripts are executed immediately before any other build scripts.
.PROLOG [ : ]

The same as the omake .BEFORE special target. If emulating PM/CB, omake looks only for .PROLOG. Otherwise, it looks for .BEFORE, and then .PROLOG.

Local Input Scripts

omake accepts the PM/CB response file syntax:

target :
command [ prolog ] <X<[ text ]
build script
.
.
.
< [ epilog ]

where X is a single character, usually @. If text is given, it is copied to the response file. Each build script is then copied to the response file. The command syntax is

command prolog Xtempfile epilog

where tempfile is a temporary file with a name of the form makenum.rsp

Operation-Line Modifiers

omake supports all PM/CB operation-line modifiers, which are listed in Table 28.

Table 28 PM/CB Operation-Line Modifiers


PM/CB operation-line modifier

omake shell-line prefix

(Always)


&


(ExtraLine)


>


(Ignore)[ status ]


- [ status ]


(Iterate)


!


(NoShell)


: (* if emulating PM/CB)


(Shell)


+


(Silent)


@


(TrackErrors)


~

PM/CB Emulation

omake is highly compatible with PM/CB, but there are differences in how they read makefiles and in how they run. In PM/CB emulation mode,omake operates like PM/CB.

Emulation at Startup Time

If PM/CB emulation mode is selected at startup time, omake emulates the PM/CB command line and selection of the built-ins file. Selection of PM/CB emulation at startup time is done with the -EP flag, either on the command line or in the OMAKEOPTS environment variable.

To determine the startup emulation mode, omake examines the OMAKEOPTS environment variable for -Ex flags. It then examines the command-line for -Ex flags. If the last -Ex flag is -EP, omake starts up emulating PM/CB.

Emulation After Startup Time

The .POLY_MAKE directive turns on PM/CB emulation mode from the point it appears in the initialization file or any makefile.

The Command Line

First the OMAKEOPTS environment variable is parsed for options. Then, if omake is emulating PM/CB at startup, the MAKEOPTS and BUILD environment variables are parsed for options. Then the command line is parsed. Parsing entails the following:

Without emulation at startup, the command line is as documented in the section Command-Line Options.

The Emulation File (BUILTINS.CB)

If omake is emulating PM/CB at startup, omake reads its internal rules and macros. It then looks for builtins.cb first in the directory of make.ini, in the directory of omake.exe, and along directories of the INIT environment variable, in that order. If builtins.cb is found, it is read for macros and rules that give more complete PM/CB emulation.

The Initialization File (TOOLS.INI)

PM/CB distinguishes between an initialization file and a built-ins file. Both contain initialization information. The initialization file is almost always the file named tools.ini. If omake is emulating PM/CB at startup, omake searches for the initialization file and reads the first one it finds :

  1. Named by the -Init command-line option

  2. Named tools.ini in the current directory

  3. Named tools.ini in a directory named by the INIT environment variable

If omake finds the initialization file, it reads information in the file starting with the section heading [PVCS.

The BUILTINS File

If omake is emulating PM/CB at startup, omake searches for the built-in file, and reads the first one it finds:

  1. Named by the -b command-line flag

  2. Named builtins in the current directory

  3. Named builtins.mak in the current directory

  4. Named by the BUILTINS environment variable

If omake is not emulating PM/CB at startup, it uses the method documented in the section Locating the Initialization File to locate the initialization (built-ins) file.

The Makefile

If omake is emulating PM/CB at start up, omake looks for the default makefile in this order: script.bld, script, makefile, makefile.mak. The first file found is read. When trying to read a makefile file that doesn't have an extension, omake tries file, file.bld, and file.mak, in that order.

Makefile Contents

If omake is emulating PM/CB:

Operation Lines (Build Scripts)

If omake is emulating PM/CB:

Unsupported PM/CB Features

When running PM/CB makefiles with omake, be aware of the lack of support for some PM/CB features. The list here provides a workaround, when it is available.

Unimplemented Directives and Reserved Targets

.ArcFile

Tells PM/CB about ARC compression files.

.ExamineCmt (also known as .Examine_Cmt)

Checks comments for line continuation. Although this directive is unsupported, omake handles line continuation inside comments.

.Error[.xxx]

Reserved target; supplies auxiliary instructions for building targets when a build script returns a nonzero exit status. Use conditional directives instead.

.FootPrint

Directive; controls foot printing targets with an internal comment record.

.Ms_Make

Selects Microsoft MAKE emulation.

.NoEnvInherit

Prevents the environment from being passed to child processes.

.Rebuild

Directive; rebuilds previous versions of applications.

.ZipFile

Directive; tells PM/CB about ZIP compression files.

Iteration Groups

An iteration group does an implicit iteration over the $? macro. For example:

test.lib : test.obj chart.obj input.obj
{
lib contract.lib -add $? omake m2 noask
}

The %foreach directive can be used in its place:

test.lib : test.obj chart.obj input.obj
%foreach file in $?
lib contract.lib -add $(file) omake m2 noask
%endfor

Suffix Dependencies

Suffix dependencies allow the specification of a set of suffixes to be tried when building a particular target. This is not supported by omake.

Command-Line Flags

The following PM/CB command-line flags are not supported: -Batch, -C, -Compile, -NoEnvInherit, or -Rebuild.

Makefile Contents

The ~ suffix on archive extensions to handle like-named files in different directories is not supported. Instead, use a pattern-matching rule , such as this:

%.c : c:/apps/archives/%.c
get -q -w $(_SourceRev) $(_Source)($(_Target))

The _DefaultSuffixes system macro is not supported.

Shared Definitions

omake does not parse the PVCS Version Manager configuration file automatically.

Operation-Line Modifiers

For PM/CB, the (Always) operation-line modifier (Shell-Line Modifiers) overrides the -Touch flag. This is not supported in omake. You can use the .MAKE attribute instead. For example:

# PM/CB
recursive :
(Always)$(MAKE) $(MAKEFLAGS)

# Omake
recursive .MAKE :
$(MAKE) $(MAKEFLAGS)

Built-In Operations

The built-in operations that handle foot printing are not supported. These operations are %EAStamp, %ExeStamp, and %ObjStamp.