- #1
TylerH
- 729
- 0
How do I use GCC to generate dependencies for makefiles? I tried using the -M option, like below, but I don't know how to insert the name of the .cpp into the shell command that calls GCC with the -M option.
Instead of the desired effect, $< is replaced by nothing, causing GCC to generate an error and my attempt to generate dependencies to fail.
Code:
%.cpp : $(shell gcc -M $<)
Instead of the desired effect, $< is replaced by nothing, causing GCC to generate an error and my attempt to generate dependencies to fail.