That's the right track. My problem, though, is that your little snippet is in an included automake snippet.
bin_PROGRAMS=hello CLEANFILES=something include $(top_srcdir)/extra.am or simply bin_PROGRAMS=goodbye include $(top_srcdir)/extra.am and extra.am needs to add one file to CLEANFILES in both cases. Cheers, Shaun > I haven't tried this with CLEANFILES, but I have run the same problem > with other automake variables. > > I get around it with something like: > > CLEANFILES = > > if BUILD_FOO > CLEANFILES += bar quux > endif > > > The automake files of my project may or may not define CLEANFILES, > > they then include an automake snippet which conditionally appends a > > file to CLEANFILES. I can't use either = or += because I get either > > > > flash-image.am:4: CLEANFILES must be set with `=' before using `+=' > > or > > flash-image.am:4: CLEANFILES was already defined in condition TRUE, > > which includes condition FLASH_IMAGE ... > > > > How do I append to CLEANFILES in an included automake snippet?