PRB: "!" Modifier Fails in a Macro Substitution

Article translations Article translations
Article ID: 94295 - View products that this article applies to.
This article was previously published under Q94295
Expand all | Collapse all

On This Page

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 is placed 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 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 "clean1" and "clean2" do not execute commands separately for each dependent. However, the target "clean3" 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):

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

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

# This works
clean3 : $(FILES)
    !DEL $?

				

Properties

Article ID: 94295 - Last Review: December 1, 2003 - Revision: 2.0
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
Keywords: 
KB94295
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com