[Libguestfs] [libnbd PATCH v2 02/23] bash: Generate completion files during build
Richard W.M. Jones
rjones at redhat.com
Fri Jun 11 08:27:22 UTC 2021
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
More information about the Libguestfs
mailing list