PRB: "!" Modifier Fails in a Macro Substitution

This article was previously published under Q94295
This article has been archived. It is offered "as is" and will no longer be updated.
SYMPTOMS
The "!" command modifier in a macro substitution does not work as expected.A "too many parameters" warning may also occur.
CAUSE
Either the $** or $? macro is modified using a macro substitution or it isplaced in another macro.
STATUS
This behavior is expected. The "!" modifier is designed to work with the$** and $? macros without any modifications.
MORE INFORMATION
The "!" modifier executes the specified command once for each specifieddependent file. It uses the $** and $? predefined macros to determine thedependents. The error occurs when the $** or $? macro is modified or whenthe macro is placed in another macro.

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

Sample Makefile

# Command line options needed: noneFILES = test1.exe test2.exeCMD   = !DEL $**all : clean1 clean2 clean3$(FILES):# This should repeat once for each fileclean1 : $(FILES)    !DEL $(?:.exe=.map)# This should repeat once for each fileclean2 : $(FILES)    !$(CMD)# This worksclean3 : $(FILES)    !DEL $?				
1.20 1.30 1.40 1.50
Properties

Article ID: 94295 - Last Review: 01/06/2015 00:47:22 - Revision: 2.0

  • 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
  • kbnosurvey kbarchive KB94295
Feedback