Martin Kletzander
2021-Jun-10 23:12 UTC
[Libguestfs] [libnbd PATCH v2 02/23] bash: Generate completion files during build
At that point the dependencies are more relevant and we will also avoid shipping symlinks. Signed-off-by: Martin Kletzander <mkletzan at redhat.com> --- bash/Makefile.am | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/bash/Makefile.am b/bash/Makefile.am index 4245eca485a2..7a222fc90bae 100644 --- a/bash/Makefile.am +++ b/bash/Makefile.am @@ -24,25 +24,19 @@ EXTRA_DIST = \ if HAVE_BASH_COMPLETION -dist_bashcomp_DATA = nbdfuse nbdsh +bashcomp_DATA = nbdfuse nbdsh if HAVE_LIBXML2 -dist_bashcomp_DATA += nbdcopy nbdinfo +bashcomp_DATA += nbdcopy nbdinfo endif HAVE_LIBXML2 - nbdcopy: nbdsh - rm -f $@ - $(LN_S) $(srcdir)/nbdsh $@ + $(LN_S) nbdsh $@ nbdfuse: nbdsh - rm -f $@ - $(LN_S) $(srcdir)/nbdsh $@ + $(LN_S) nbdsh $@ nbdinfo: nbdsh - rm -f $@ - $(LN_S) $(srcdir)/nbdsh $@ - -CLEANFILES += nbdcopy nbdfuse nbdinfo + $(LN_S) nbdsh $@ endif -- 2.32.0
Richard W.M. Jones
2021-Jun-11 08:27 UTC
[Libguestfs] [libnbd PATCH v2 02/23] bash: Generate completion files during build
On Fri, Jun 11, 2021 at 01:12:06AM +0200, Martin Kletzander wrote:> nbdcopy: nbdsh > - rm -f $@ > - $(LN_S) $(srcdir)/nbdsh $@ > + $(LN_S) nbdsh $@ > > nbdfuse: nbdsh > - rm -f $@ > - $(LN_S) $(srcdir)/nbdsh $@ > + $(LN_S) nbdsh $@ > > nbdinfo: nbdsh > - rm -f $@ > - $(LN_S) $(srcdir)/nbdsh $@ > - > -CLEANFILES += nbdcopy nbdfuse nbdinfo > + $(LN_S) nbdsh $@I don't understand this part of the change. I'm pretty sure you need to keep the rm -f $@ part because $(LN_S) expands to "ln -s" which won't overwrite the target if it already exists. I imagine this will break if nbdsh is edited and make attempts to rebuild these targets. Also nbdsh will still be in $(srcdir) so removing that seems like it could break srcdir != builddir (although that is probably broken in other places too). And CLEANFILES is needed (or perhaps DISCLEANFILES) so that generated files like the symlinks get removed on "make clean". Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW