Hi Ralf, Ralf Wildenhues wrote: > Hi Harald, > > * Harald Dunkel wrote on Tue, Aug 16, 2005 at 12:39:46PM CEST: > >>I would need some way to add recursive targets to all generated >>Makefiles, without asking every owner of every Makefile.am >>to append some include statement or some keyword to be replaced >>by AC_SUBST_FILE. > > > Hmm. I remember you asking a similar question before. >
Kevin Teich started a thread about this in April. But the issue wasn't resolve, AFAIR. > >>What would be your suggestion to solve this? > > > I don't have a good answer to your specific question at the moment > (short of extending Automake). But I have a suggestion for questions > such as yours: > > For other people (e.g. me), requirements such as above would be much > easier to understand if a good reason for it was given as well. > I mean, what is it that prevents you from doing something like this > > find $top_srcdir -name Makefile.am | while read file > do > echo 'include $top_srcdir/some_snippet.am' >>"$file" > done > This would assume that I am allowed to change the foreign Makefile.am files, it assumes that this command wasn't run before, and it assumes that there is no AC_CONFIG_SUBDIRS. If something like this is supposed to be run, then it should work on the generated Makefile.in files. (That would be the job of automake, anyway.) The some_snippet.am would have to be converted into some_snippet.in in $(top_srcdir), and this would break the $(top_srcdir) variable for all Makefiles in subdirectories. I would like to add recursive targets to extend the test framework (e.g. to not stop testing completely if a single unittest fails in a subdirectory deep inside), or to recursively create a coverage report, to add common build targets for the documentation, and so on. My suggestion would be something like this: Some macro in configure.ac AM_ADD_TARGET([mytarget],[dependencies], some program lines could go here ) It could be used to create targets "mytarget" and "mytarget-am" as for the existing recursive targets, to add mytarget-recursive to $(RECURSIVE_TARGETS), to add it to .PHONY, and so on. Of course this might introduce problems, too (e.g. when using recursive targets in the dependencies). It would be necessary to document the difference between "install" and "install-am", for example. Regards Harri