Microsoft KB Archive/94295

= PRB: &quot;!&quot; Modifier Fails in a Macro Substitution =

Article ID: 94295

Article Last Modified on 12/1/2003

-

APPLIES TO


 * Microsoft Program Maintenance Utility 1.2
 * Microsoft Program Maintenance Utility 1.2
 * Microsoft Program Maintenance Utility 1.2
 * Microsoft Program Maintenance Utility 1.2
 * Microsoft Program Maintenance Utility 1.3
 * Microsoft Program Maintenance Utility 1.4
 * Microsoft Program Maintenance Utility 1.4
 * Microsoft Program Maintenance Utility 1.4
 * Microsoft Program Maintenance Utility 1.4

-



This article was previously published under Q94295



SYMPTOMS
The &quot;!&quot; command modifier in a macro substitution does not work as expected. A &quot;too many parameters&quot; warning may also occur.



CAUSE
Either the $** or $? macro is modified using a macro substitution or it is placed in another macro.



STATUS
This behavior is expected. The &quot;!&quot; modifier is designed to work with the $** and $? macros without any modifications.



MORE INFORMATION
The &quot;!&quot; modifier executes the specified command once for each specified dependent file. It uses the $** and $? predefined macros to determine the dependents. The error occurs when the $** or $? macro is modified or when the macro is placed in another macro.

The following makefile illustrates this error because the targets &quot;clean1&quot; and &quot;clean2&quot; do not execute commands separately for each dependent. However, the target &quot;clean3&quot; executes correctly. The targets execute commands as follows: clean1 DEL test1.map test2.map

clean2 DEL test1.exe test2.exe

clean3 DEL test1.exe DEL test2.exe

Sample Makefile
# Command line options needed: none

FILES = test1.exe test2.exe CMD  = !DEL $**

all : clean1 clean2 clean3

$(FILES):

clean1 : $(FILES) !DEL $(?:.exe=.map)
 * 1) This should repeat once for each file

clean2 : $(FILES) !$(CMD)
 * 1) This should repeat once for each file

clean3 : $(FILES) !DEL $?
 * 1) This works

Additional query words: 1.20 1.30 1.40 1.50

Keywords: KB94295

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.