I have an autotools setup coexisting with a traditional Makefile in a single repository. In order to avoid overwriting ./Makefile, I have set configure.ac to copy Makefile.in into Makefile.test.
There is a subdirectory that is managed by the generated Makefile.test. When I run
make -f Makefile.test clean
the script correctly enters the test directory, runs clean, and steps out of the directory. However, upon returning to the root it attempts to call clean-am, using what appears to be a plain
make clean-am
This invokes the wrong make file, and I get the following error.
rm -f *.lo
make[2]: Leaving directory `/home/somedude/work_repos/some-repo/test'
make[2]: Entering directory `/home/somedude/work_repos/some-repo'
make[2]: *** No rule to make target `clean-am'. Stop.
make[2]: Leaving directory `/home/somedude/work_repos/some-rep'
make[1]: *** [clean-recursive] Error 1
make[1]: Leaving directory `/home/somedude/work_repos/some-repo'
make: *** [clean] Error 2
Any help on how to solve this problem would be much appreciated.