I have a C++ project which uses Autoconf and Automake. I decided that there are too many source files in my src directory, and moved some files to a subdirectory. Then, I modified the Makefile.am and changed these files from source.cpp to subdir/source.cpp. I knew this approach should work, as I did this before for some new files (but then I didn't rename anything). Now I ran the following, as usual:
autoreconf
./configure
make clean
make
I got an error message of something like this:
No rule to make target "source.cpp" needed for "source.o"
I didn't understand what went wrong. I checked my Makefile, but it seemed to be right. So I cloned my git repository to a new place, and tried a make there, and it worked. No problem, thought I, and did a git clean -xf on my original directory. After this, compilation still didn't work. Now I did a diff on the two directory stuctures (after another git clean -xf, and found that there remained a .deps directory. After deleting that, it compiled.
The moral of the story is the following:
make cleandoesn't delete dependencies.git clean -xfdoesn't delete dependencies (probably because of the hidden directory).
Is there any way to make make clean (or possibly git clean) remove this directory automatically? Sure I can do it manually, but it is very annoying that there are dependency files left after a clean.
autoreconfafter editingMakefile.am, or removingAM_MAINTAINER_MODEfromconfigure.ac, might solve your problem. - ptomato