Syntax:
$[s,separator,string]
In this transformation, NMAKE32 will place the separator text between every two words in string. This transformation is useful when a character other than a space is required to separate multiple words on a program's command lines, or when writing in-line files.
The separator text can be enclosed in quotes, and if so, can contain special characters such as spaces, commas, and the following escape sequences:
Escape Sequence
Example:
When creating a response file for a program, such as LINK386 which has a limit to the length of any single line in the response file, and a method for continuing that single logical line across several physical lines, the following transformation macro should be used. Assuming the line continuation character is a plus sign(+), and there is a long list of object modules in the macro OBJS:
OBJS = p1.obj p2.obj p3.obj
The transformation:
$[s,"+\n",$(OBJS)]
would return
p1.obj+ p2.obj+ p3.obj
Using this macro, the line limit will not be exceeded, and they can be put together in one logical line.
In the above example, NMAKE32 will take a list of object file specifications and place one per line in a response file. However, since NMAKE32 never changes the text, the file specifications will end up as they were specified, without information such as paths.
Since the expansion of the built-in macros can yield path information, the separate and pattern matching transformations can be nested for more flexibility.
If the following line was in a description file:
prog.exe: $(OBJS) prof.def other.lib
The following transformation:
$[s,"+\n",$[m,*.obj,$**]]
would return only those dependents of prog.exe that are object modules, but with any path information that NMAKE32 was able to determine, and write them one per line.
<path for p1>\p1.obj+ <path for p2>\p2.obj+ <path for p3>\p3.obj