I have a C ++ project that uses Autoconf and Automake. I decided that there were too many source files in my src directory, and moved some files to a subdirectory. Then I changed Makefile.am and changed these files from source.cpp to subdir/source.cpp . I knew this approach should work, as I did it before for some new files (but then I didnβt rename anything). Now I have done the following, as usual:
autoreconf ./configure make clean make
I got an error message:
No rule to make target "source.cpp" needed for "source.o"
I did not understand what went wrong. I checked my Makefile, but it seemed to be correct. So I cloned the git repository to a new location and tried to do there, and it worked. No problem, I thought, and did git clean -xf in my source directory. After that, compilation still didn't work. Now I made diff for the two directory structures (after another git clean -xf and found that the .deps directory .deps . After deleting this file, it compiled.
The moral of this story is this:
make clean does not remove dependencies.git clean -xf does not remove dependencies (probably due to a hidden directory).
Is there a way to make clean (or maybe git clean ) automatically delete this directory? Of course, I can do it manually, but itβs very annoying that there are dependency files after cleaning.
source share