I wrote a Makefile and found out that when executing make command, an unexpected rm was executed, after all command in Mmakefile were done. But I didn't write the rm command in the Makefile.
run-%: d/%.out
$<
d/%.out: d/%.c
gcc -o $(subst .c,.out,$<) $<
Output of running make run-a:
gcc -o d/a.out d/a.c
d/a.out
rm d/a.out
Notice the trailing rm d/a.out, which I didn't write.
Under what circumstance will the automatic rm command be added?