preventing variable expansion in makefile

Viewed 1947

I want to write this into a file:

-MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"

but when I echo this into a file, with "", or '', the variables will expand, how can I prevent the expansion and write it as is?

P.S. echo '-MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"' is called in a makefile.

in my makefile, I let's say I have:

all:
    echo '-MF"$(@:%.o=%.d)" -MT"$(@)" -o "$@" "$<"' > $file

what I see in the file is

-MF"all" -MT"all" -o "all" ""

1 Answers
Related