Ralf Wildenhues <[EMAIL PROTECTED]> writes: > * Ralf Wildenhues wrote on Fri, Jul 08, 2005 at 08:15:08PM CEST: >> * Ed Hartnett wrote on Fri, Jul 08, 2005 at 07:28:38PM CEST: > > >> > I have a slew of test programs, and my Makefile.am contains something >> > like this: >> > >> > # These programs are all built for make check in this directory. >> > check_PROGRAMS = tst_nc_converts tst_h_files tst_h_atts tst_h_vars \ >> >> > # Each program depends on its C file and tests.h. >> > tst_nc_converts_SOURCES = tst_nc_converts.c tests.h >> > tst_h_files_SOURCES = tst_h_files.c tests.h >> >> > It's a long list, and I am wondering if there is any easy way to >> > specify that they *all* depend on tests.h, instead of listing it for >> > each. >> >> You don't need to specify header dependencies manually at all. All that >> is necessary is that tests.h is listed _once_ in some variable that will >> cause Automake to put the header into the tarball when you do `make dist'. > > More to the point: you should be able to omit _all_ the *_SOURCES > variables -- Automake has a default value that takes foo.c as source for > a program foo. So you end up with something like > > # list all programs > check_PROGRAMS = tst_nc_converts tst_h_files tst_h_atts tst_h_vars .. > > noinst_HEADERS = test.h > # end of file > > Regards, > Ralf >
Thanks Ralf! Once again, you are quite correct, and this eliminated a lot of lines from my Makefile.am. Less in the file means less to maintain, less to distribute, less for a very busy programmer to have to deal with. Thanks again! Ed -- Ed Hartnett -- [EMAIL PROTECTED]
