Home    Product Info    Orders    Downloads    About Us    Contact Us


 

Opus Make v6.11 Addendum

This addendum documents the changes from Make v6.10 to 6.11 and from MKMF v6.10 to MKMF v6.11. This addendum will be included in the next revision of the manual. The changes are listed in order according to where they will appear in the next manual. The page numbers are for the Make v6.10 manual.

1.4  Upgrading To Opus Make v6.11

New Features for v6.11 (p5: Add before the "New Features for v6.10")

1.5  Upgrading To Opus MKMF v6.11

New Features for v6.11 (p8: Added before "New Features for v6.10")

Using Double-Quoted Target Names (p56: New section after "Using / or \ as the Path ...")

Normally, target names on dependency lines are separated by whitespace. Target names containing spaces are supported by Make if you place double quotes around the name and use the ".OPTIONS : TargetQuoted" directive (Page 118). For example:

.OPTIONS : TargetQuoted
all : "Program Files\make.exe"
"Program Files\make.exe" : main.obj sub.obj ...
	...

Note that macro modifications on a macro whose value contains double-quoted target names requires the "Q+" macro modifier (Page 69) or the ".OPTIONS : MacroQuoted" (Page 118) directive so that the double quotes are interpreted properly.

Macro Modifiers

Double-Quoted Macro Elements (p69: New macro modifiers)

Q+ Turn on handling of double-quoted macro elements. This modifier allows subsequent modifiers to work properly on double-quoted macro elements. See Page 75 for examples.

Q- Turn off handling of double-quoted macro elements. If "Q+" was used in a sequence of macro modifiers Make automatically does a "Q-" for you after the sequence of macro modifiers is complete. This means you normally don’t need to use "Q-", but it may have uses we haven’t anticipated. See Page 75 for examples.

Include File with Regular Expression Matching (p71: Replace pattern and add paragraph after "The d is a single ...")

@d regex d subst d [ g ]

If "g" is given after the final delimiter d then the substitution is "global", occurring at all matches of regex. Without "g", only the first match is substituted.

Include File with Regular Expression Matching (p71: insert paragraph before "Regular expressions ...")

An example of a global substation is:

@/\.obj/.o/g

This specified that every .obj is replaced with .o. Note that in regular expression syntax, "\.obj" matches a literal dot followed by "obj".

String Substitution (p73: Replace pattern and add sentences before "The element is not ...")

Sd regex d subst d [ g ]

If "g" is given after the final delimiter d then the substitution is "global", occurring at all matches of regex. Without "g", only the first match is substituted.

Using Double-Quoted Macro Elements (p75: New section before "Regular Expressions")

Normally, a macro value is comprised of zero or more whitespace-separated macro elements. In order to support macro elements that contain spaces, you can tell Make and MKMF to consider the effect of double quotes on macro elements. This means, for example, that you can now use macros such as:

SRCS = "Program Files\main.c" "Program Files\sub.c"

Note that it has always been possible to define macros like the one above, but macro modifiers did not work properly because Make normally divides macro elements at whitespace. For example:

$(SRCS,F) evaluates to:	"Program main.c" "Program sub.c"

Once you turn on support of double-quoted macro elements you’ll be able to do modifications on these elements. The "easiest" way to turn on this support is with the new ".OPTIONS : MacroQuoted" keyword. We say easiest in that you only have to put:

.OPTIONS : MacroQuoted

in your makefile or MAKE.INI and Make will then handle double-quoted macro elements. Of course, if your macro values don’t use double quotes, there’s no harm in using ".OPTIONS : MacroQuoted". This option just turns on extra handling.

Since there may be reasons you want to handle double-quoted macro elements on a case-by-case basis we've also provided two new macro modifiers:

Q+ Handle double quotes in macro elements.

Q- Ignore double quotes in macro elements.

With the addition of the "Q+" modifier the previous modification gives the desired result:

$(SRCS,Q+,F) evaluates to:	main.c sub.c

Likewise, the directory components are:

$(SRCS,Q+,D) evaluates to:	"Program Files" "Program Files"

The corresponding "Q-" modifier turns off handling of double-quoted macro elements but normally you don't need to use "Q-" because Make automatically turns off double-quote handling after each set of macro modifiers. There may be special times to use "Q-", but we don't know what they are yet.

New Problems Created by Double Quote Support

The addition of double quotes around the target name or macro element can break some of your existing makefile code — in particular, conditional expressions. For example, the following:

%if "$(.NEWSOURCES)"

works fine for all values of $(.NEWSOURCES) unless $(.NEWSOURCES) contains any double-quoted target names. In this case Make stops with a syntax error at this makefile statement.

When you add double-quoted name support, you'll need to replace the double quotes of any problematic %if directives with single quotes. For example, the following works fine:

%if '$(.NEWSOURCES)'

Predefined Macros — Run-Time Macros (p77: Add sentence to end of "The run-time macros ..." paragraph)

The path names are double quoted if they contain whitespace.

Multiple-Command Shell Lines (p94: Add the following before "Simultaneous support of ...")

Using Separators in Portable Makefiles

Rather than using ";" in some makefiles and "&" in others, you can use either separator and the ".SHELL : .FIXMULTISEP" directive (Page 118) to have Make fix up the shell line to use OS-specific separator. Note that in order for Make to recognize ";" or "&" as the separator it must be followed by at least one space then a non-space character.

Command Execution Operator (page 104: Clarification)

The [] operator executes a command line using the last-known shell program — the default shell program or the shell program as set with your .SHELL directive.

%exec (page 109: Clarification)

This directive executes a command line using the last-known shell program — the default shell program or the shell program as set with your .SHELL directive.

Dot Directives (p118: Replace the .OPTIONS directive with the following)

.OPTIONS : [ MacroQuoted | MacroRecursiveDef | TargetKeepCase| TargetMergeDotSlash | TargetQuoted | TargetSlashEq ] ...

This directive defines some optional behavior for Make. Each appearance of .OPTIONS adds the named options to the current .OPTIONS. An empty .OPTIONS directive clears all options. The options are:

MacroQuoted — enables correct macro modifier action on double-quoted macro elements, where double quotes are used to protect space characters in the macro elements. See Page 75, Using Double-Quoted Macro Elements.

MacroRecursiveDef —enables self-referential macro definitions such as:

NAME = [ text ] $(NAME) [ text ]

On the right-hand side the current value of $(NAME) is expanded but any other macro references in text are left unexpanded.

TargetKeepCase — for Win95 Make and MKMF, causes the "A", "*", "*F" and "*D" macro modifiers and wild-card specifications on dependency lines to preserve the case of file names. By default, without this keyword, the file names are converted lower case.

TargetMergeDotSlash —causes targets .\name and name to refer to the same target. This keyword is used to fix a problem in VC++ generated makefiles and the keyword is turned on automatically in VC2OPUS.INI.

TargetQuoted — enables handling of double-quoted target names, where double quotes are used to protect space characters in the target name.

TargetSlashEq — causes slash "/" and backslash "\" to be treated as the same character in target names and in inference rules. Without this option, slash and backslash are treated as distinct characters.

Note: The MacroRecursiveDef, TargetSlashEq, TargetQuoted and TargetKeepCase keywords are all enabled during NMAKE emulation.

Dot Directives (p118: New .SHELL keyword)

.SHELL : [ .AUTO | .FIXMULTISEP | .NOMULTI | .NOREDIR ] ... [ program files ]

The .FIXMULTISEP keyword allows ";" or "&" to be used as the command separator in multiple-command shell lines. Without this feature, OS/2 & WinNT makefiles must use "&" as the command separator and MS-DOS, Win95 and UNIX makefiles must use ";" as the command separator.

To enable this feature, add the following to your makefile or make.ini:

.SHELL : .FIXMULTISEP

Note: For Make to recognize ";"or "&" as the separator the character must be followed by at least one space then a non-space character.

Inline Response Files (p148: Clarification)

The manual indicates that each makefile line between the pairs of "<<" delimiters is copied to the response file verbatim (as is). In fact, the following interpretations are made:

Defining VCS Support (p154: Replace the bulleted line "A "%", in which case ...")

A "%"-containing pattern, like that used in an inference rule, where "%" matches zero or more characters in the source file name. If "%" is used in source then it can also be used in storage and evaluates to the matched portion of the source file name.

Intersolv Version Manager (PVCS)

Adding Version Control Support (p157: Add example line (4) and text)

.PVCS_STORAGE : VCS/%.c(%.c -r "Rel_1")	(4)

Line (4) shows how to set up PVCS support without mangling of the storage file extension. Here the source file and storage file have the same names, except the storage file is in the VCS subdirectory.

Using Unmangled Storage-File Extensions (p158: After section "The Storage-Naming Scheme")

By using the "%" rule character in both the source file name and in the storage file name, you can specify that a source file is extracted from a like-named storage file in a different directory (see example (4), Page 157).

Microsoft SourceSafe (SS)

Adding Version Control Support (p160: Replace line (4) with the following lines and text)

.SS_STORAGE : $$/AltProject(.pas "-VLBeta 3")	        (4a)
.SS_STORAGE : $$/AltProject/%.pas(%.pas "-VLBeta 3")	(4b)

Line (4a) specifies an explicit SourceSafe project name and project version "Beta 3". Line (4b) has the same effect as (4a), but the use of the rule character gives .SS_STORAGE an inference-rule-like appearance.

Burton Systems Software TLIB

Adding Version Control Support (p163: Add example line (6) and text)

.TLIB_STORAGE : VCS/%.c(%.c *-1)	(6)

Line (6) shows how to set up TLIB support without mangling of the storage file extension. Here the source file and storage file have the same names, except the storage file is in the VCS subdirectory. As in line (3), the "*-1" references the next-to-most-recent version.

Using Unmangled Storage-File Extensions (p164: Add after sec. "The Storage-Naming...")

By using the "%" rule character in both the source file name and in the storage file name, you can specify that a source file is extracted from a like-named storage file in a different directory (see example (6), Page 163).

Accessing Source Integrity Project Files (page 167: Clarification)

The MKS SourceIntegrity support has been enhanced beyond what the manual says. This section should now read:

The expression $(PROJECT,@) returns the file list contained in the project file or sandbox file named by the PROJECT macro. The file list names reference some internal Source Integrity macros that are resolved in the following manner:

The value of SI macro $(projectdir) is "." if $(PROJECT) names a project file. Otherwise, if $(PROJECT) names a sandbox file the value of $(projectdir) is the directory of the project file referenced by the sandbox file.

The value of SI macros $(drive_directory) are literally DRIVE:/directory unless you define your own drive_directory macro. For example, $(e_src) resolves to E:/src unless you define your own e_src macro.

4.19 Sample Makefiles (p185: New samples)

Two enhanced samples have been added:

samples/si/readme.txt An example showing the use of Source Integrity to access and build files in a:
samples/si/simake.ini
samples/si/makefile       Source Integrity project
samples/si/sbox/makefile       Source Integrity sandbox
samples/ss A large example showing the use of SourceSafe to maintain and self-extract an entire project.

Please see the readme.txt for each of these samples.

5.2 MKMF Command Line (p194: Changed "-s" flag and new "-S" flag)

–s Slow (C-mode only). Normally, files are read for dependencies the first time they are encountered and MKMF uses these dependencies each subsequent time the same file is seen. For C-language files this can cause problems as symbols defined in one include file may be needed in another include file for proper dependencies. The "–s" flag causes MKMF to read each include file every time it is encountered, always giving the correct dependencies (but at a much slower rate.)
  New for v6.11, for all but MS-DOS and OS/2 MKMF, the "–s" flag now caches included files in memory and reads from the in-memory files, improving performance.
   
–S The same as "–s" except included files are not cached in memory.

5.7 Configuration Macros (p205)

.HDRPATH.ext (p205: MKMF defined more defaults than were listed. Here’s the full set of defined .HDRPATHs)

MKMF for Unix defines the following:

.HDRPATH.c   = $(.SOURCE,D) $(CFLAGS,M^-I,S///) | /usr/include /usr/include/sys
.HDRPATH.cpp = $(.HDRPATH.c)
.HDRPATH.C   = $(.HDRPATH.c)

MKMF for MS-DOS, OS/2, Win95 & WinNT define the following:

.HDRPATH.asm = $(AFLAGS,M^/I,S///) .
.HDRPATH.c   = $(.SOURCE,D) $(CFLAGS,M^[/-]I,S///) | $(INCLUDE,;= )
.HDRPATH.cxx = $(.HDRPATH.c)
.HDRPATH.cpp = $(.HDRPATH.c)
.HDRPATH.for = .
.HDRPATH.f   = $(.HDRPATH.for)
.HDRPATH.pas = $(.SOURCE,D) $(PFLAGS,M^[-/]I,S///)
.HDRPATH.rc  = . $(RCFLAGS,M^[-/][iI],S///)

NMAKE Compatibility

Makefile Contents (p232: Add the following before the "Search paths ..." bullet)

Wild card characters used on the right-side of dependency lines return both file names and directory names. Without emulation, only file names are returned.

NMAKE Emulation: Macros (page 249)

Environment variables override most built-in macro definitions (those on Page 84). Built-in macros that are not overridden by environment variables are: FIRSTTARGET, MAKE, MAKEFILE, OSRELEASE, OSVERSION and SHELLSUFFIX.

 

 Appendix E: Integrating Make with Visual C++

E.2 Integrating with Visual C++ 4.x and 5.x (p257: Changed section)

Setting up the Files

You must perform the following steps:

  1. Enable automatic update of proj.omk by setting the _VCVer macro in make.ini.
  2. Edit the %setenv commands in vc2opus.ini that initialize the PATH, INCLUDE, LIB and TEMP environment variables. The INCLUDE and LIB variables must match the values in VC++ Tools Menu / Options... / Directories Tab / Show Directories for: Include files and for: Library files.

For VC++ 5.x only:

  1. Tell VC++ 5.x to create a makefile (which it normally does not do). Do one of:

Check the Tools Menu / Options... / Build Tab / Export makefile when saving project file box.

Use the Project Menu / Export Makefile item to export manually the makefile.

Setting up the Tools Menu

For VC++ 4.x, for each Tool item to be added, do the following:

  1. Choose Tools Menu / Customize...
  2. Choose Tools Tab
  3. Click Add... In the Command field add the full path name to the Opus Make executable (e.g. e:\opus\nti\make.exe). Click OK
  4. Modify Menu Text (see below for details).
  5. Modify Arguments (see below for details)
  6. Modify Initial Directory, selecting the "Workspace Directory" from the menu.
  7. Check Redirect to Output Window
  8. Click Close

For VC++ 5.x, for each Tool item to be added, do the following:

  1. Choose Tools Menu / Customize...
  2. Choose Tools Tab
  3. Click New icon at the right of the Menu contents bar.
  4. In the newly-opened dialog, add the menu text (see below for details) and hit Enter.
  5. In the Command field add the full path name to the Opus Make executable (e.g. e:\opus\nti\make.exe).
  6. Modify Arguments as shown in the table below.
  7. In the Initial Directory field, select the "Workspace Directory" from the menu.
  8. Check Use Output Window.
  9. Click Close.

Repeat the above steps once for each Tool item. We suggest the following items:

Desired Action

Menu Text

Arguments

Make the default target &OMake _VCDir=$(TargetDir)
Clean the directory OMake &clean _VCDir=$(TargetDir) clean
Make all targets OMake &all _VCDir=$(TargetDir) –a

Note: The _VCDir command-line macro is used in the makefile to define a configuration macro, letting Make know you are building the main "debug" or "release" configuration. To build a particular subsystem you must instead define the CFG command-line macro. Here’s an example Tool menu item using CFG:

Desired Action

Menu Text

Arguments

Make debug IOLIB OMake &iolib CFG="IOLib - Win32 Debug"

To find out all configuration strings, use the MS-DOS shell, change directory to the project directory and execute "make –n CFG=x".

Optional Shortcut Keys

Add a shortcut key to call Opus Make by doing the following:

  1. Choose Tools / Customize...
  2. Choose Keyboard Tab
  3. Select Categories: Tools
  4. Select Commands: UserTool<N>, where <N> is the numerical position of the "OMake" command in Tools / Customize... / Tools Tab / Menu Contents.
  5. Select Press New Shortcut Key:
  6. Press the key (egs: shift+f8, ctrl+shift+m).
  7. Click Assign.

For VC++ 4.x, if you’ve picked shift+f8 for Opus Make’s shortcut key you need to remove the current binding of the shortcut key to the Project menu build:

  1. Choose Tools / Customize...
  2. Choose Keyboard Tab
  3. Select Categories: Project
  4. Select Commands: ProjectBuild
  5. Select Current Keys: Shift+F8
  6. Click Remove.

Home    Product Info    Orders    Downloads    About Us    Contact Us

Opus Software, Inc. 1032 Irving Street, Suite 439 San Francisco, CA 94122 USA
Phone: 415-485-9703 Fax: 415-485-9704 Email:
biz@opussoftware.com