This article was previously published under Q94295
This article has been archived. It is offered "as is" and will no longer be updated.
The "!" command modifier in a macro substitution does not work as expected.A "too many parameters" warning may also occur.
Either the $** or $? macro is modified using a macro substitution or it isplaced in another macro.
This behavior is expected. The "!" modifier is designed to work with the$** and $? macros without any modifications.
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
# 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 $?