4 ms·
There's a -MT flag which does what the sed line does. From the gcc man page: Change the target of the rule emitted by dependency generation... An -MT optio
by frankzinger 9y ago
There's a -MT flag which does what the sed line does. From the gcc man page:
Change the target of the rule emitted by
dependency generation... An -MT option will
set the target to be exactly the string you
specify...
So in your example one might do something like
-MT "$@ $(basename $@).d"
which would output
main.o main.d : main.c defs.h
for the main.o target.