PRB: "!" Modifier Fails in a Macro SubstitutionLast reviewed: February 14, 1995Article ID: Q94295 |
The information in this article applies to:
SYMPTOMSThe "!" command modifier in a macro substitution does not work as expected. A "too many parameters" warning may also occur.
CAUSEEither the $** or $? macro is modified using a macro substitution or it is placed in another macro.
STATUSThis behavior is expected. The "!" modifier is designed to work with the $** and $? macros without any modifications.
MORE INFORMATIONThe "!" 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.mapclean2 DEL test1.exe test2.execlean3 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 $? |
Additional reference words: 1.20 1.30 1.40 1.50
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |