views:

35

answers:

1

Is there any way around having to specify every sourcefile I create manually in my automake scripts?

I've tried several ways of specifying sourcefiles using find -name *.cc or the like. I've also tried finding the list in autoconf and substituting it into the Makefile.am, but automake protested that this is not allowed.

If I have to maintain the list by hand, I'm likely to keep forgetting to add newly created files to the list. I'd rather not have to do that. Is there any way to have new files selected for me automatically?

Any help is appreciated.

A: 

Try this:

Makefile.am:

include srcs.am
new-src:
    # Some shell command to update srcs.am

Put the definition of foo_SOURCES in srcs.am. Then to update the source list, do make new-src; make.

This seems like a really bad idea, though. Once your project is established, you'll rarely change the file list anyway and you'll still have magic baggage hanging around.

Jack Kelly
Well then I'll just have to put the file list back in once I'm done. As a solution to my problem, this seems sensible: I'll try it out. Thanks.
Romke van der Meulen
Romke van der Meulen
N00b question: How do I put sourcecode in my comments?
Romke van der Meulen
@Romke: Use \`backticks\` around your code to get `this effect`. Use `\\\`backslashes\\\`` to get `\`this effect\``.
Jack Kelly