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.
The assumption "one example program, one C file" would be too heavy
handed in most contexts but for examples that's basically a guiding
principle, so I don't think it'll be a problem in practice, and we
can always revisit it later on if needs be.
--
Andrea Bolognani / Red Hat / Virtualization