How can I automatically add '.s' to a target in my Makefile?
问题 I have a phony debug and asm target. debug works by updating the variable CFLAGS and then compiles the normal target, which uses these new CFLAGS to produce debug symbols. This works as intended. Analogously I want to define the asm target set the -S switch and to change the output name from file to file.s . However, the last part does not work, and I get: $ make asm -B gcc -fmessage-length=0 -ansi -pedantic -Werror -Wall -Wextra -Wwrite-strings -Winit-self -Wcast-align -Wcast-qual -Wpointer