On Tue, May 14, 2019 at 09:21:12AM +0200, Andrea Bolognani wrote:
On Mon, 2019-05-13 at 16:14 +0100, Daniel P. Berrangé wrote:
> On Mon, May 13, 2019 at 02:55:14PM +0200, Andrea Bolognani wrote:
> > +# List of example programs. We need to list them here instead of using
> > +# $(noinst_PROGRAMS) directly because we want to have access to the
> > +# unmodified list during (un)installation, but at the same time automake
> > +# might tweak $(noinst_PROGRAMS) to eg. automatically add the .exe file
> > +# extension when targeting Windows.
> > +EXAMPLES = \
> > + admin/client_close \
> > + admin/client_info \
> > + admin/client_limits \
> > + admin/list_clients \
> > + admin/list_servers \
> > + admin/logging \
> > + admin/threadpool_params \
> > + dominfo/info1 \
> > + dommigrate/dommigrate \
> > + domsuspend/suspend \
> > + domtop/domtop \
> > + hellolibvirt/hellolibvirt \
> > + object-events/event-test \
> > + openauth/openauth \
> > + rename/rename \
> > + $(NULL)
> > +
> > +noinst_PROGRAMS = \
> > + $(EXAMPLES) \
> > + $(NULL)
>
> I wonder if we should just directly use the _SOURCES vars instead of making
> the assumption that binary names match source files. eg
>
> EXAMPLE_SRCS = \
> $(dominfo_info1_SOURCES) \
> $(dommigrate_dommigrate_SOURCES) \
> .....
That would (probably, I haven't actually tested it) work, however it
seems to me like it would be much more likely that such a solution
would eventually fall out of sync than the one I'm proposing, since
when adding a new example you'd only notice the missing file if you
actively performed an installation and checked the contents of the
documentation directory, rather than not seeing the binary you're
working on which is a much more obvious failure.
I don't think such a bug is any more likely here than anywhere else
in our makefiles & we cope fine in general. We need a list of source
files & we have variables defining the source files, so it just feels
wrong to instead use a list of binary names and infer the source files
from that.
Regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|