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.
omake supports the PolyMake/Configuration Builder system macros listed in Table 25:
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 |
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.
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. |
In conditional expressions omake accepts:
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.
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. |
omake supports the following PM/CB reserved targets:
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
omake supports all PM/CB operation-line modifiers, which are listed in Table 28.
PM/CB operation-line modifier | omake shell-line prefix |
---|---|
(Always) | & |
(ExtraLine) | > |
(Ignore)[ status ] | - [ status ] |
(Iterate) | ! |
(NoShell) | : (* if emulating PM/CB) |
(Shell) | + |
(Silent) | @ |
(TrackErrors) | ~ |
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.
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.
The .POLY_MAKE directive turns on PM/CB emulation mode from the point it appears in the initialization file or any makefile.
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:
Handling the case-insensitivity of the PM/CB command line.
Mapping options into omake equivalents. The help screen switches to the options available with our emulation of PolyMake v4.0 and Configuration Builder v5.x. The help screen's contents are stored in the file omhelp.cb.
Handling the long-named Configuration Builder v5.x options.
Warning about unconvertible command-line options.
Without emulation at startup, the command line is as documented in the section Command-Line Options.
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.
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 :
Named by the -Init command-line option
Named tools.ini in the current directory
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
.
If omake is emulating PM/CB at startup, omake searches for the built-in file, and reads the first one it finds:
Named by the -b command-line flag
Named builtins in the current directory
Named builtins.mak in the current directory
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.
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.
If omake is emulating PM/CB:
The line continuation character sequence \<ENTER> is removed from the input.
The ^ character is used for quoting and produces the following effects:
Character | Effect |
---|---|
^^ | literal ^ |
^<ENTER> | literal newline |
^$ | literal $ |
^\ | literal \ |
^# | literal # |
The PM/CB-compatible directives listed in the previous section can be used at run time as well as read time.
The %end directive is the same as %endif. Without emulation, %end terminates a %foreach or %while directive.
.INCLUDE file searches only the current directory.
Makefile macro names are case-sensitive.
The =+ macro (prepend) definition is supported.
Environment variables override built-in macro definitions.
The MFLAGS macro is the same as _FlagsMacros.
The TMP, TEMP, and WORK environment variables are tried, in order, for the location of the directory where temporary files are created. Without emulation, omake uses the value of the MAKE_TMP macro.
Duplicate entries in a target's dependencies are allowed. Without emulation, omake removes duplicate dependencies.
If omake is emulating PM/CB:
The shell program is used for executing every build script. The * and (NoShell) prefixes suppress execution of the shell program for this build script.
The build scripts cd dir and chdir dir both change to directory dir and stay there until changed back explicitly. Otherwise, omake starts each build script from the directory that omake started in the $(MAKEDIR) directory.
The : modifier means swap out of memory and * means suppress shell. Without emulation, * means swap out and : means suppress shell.
The - shell-line prefix does not print the Error code ... (ignored)
message.
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.
.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. |
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 allow the specification of a set of suffixes to be tried when building a particular target. This is not supported by omake.
The following PM/CB command-line flags are not supported: -Batch, -C, -Compile, -NoEnvInherit, or -Rebuild.
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.
omake does not parse the PVCS Version Manager configuration file automatically.
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)
The built-in operations that handle foot printing are not supported. These operations are %EAStamp, %ExeStamp, and %ObjStamp.
Feedback on the documentation in this site? We welcome any comments!
Copyright © 2001 by Rational Software Corporation. All rights reserved. |