bash: fix build/clean when srcdir==builddir

Use CLEANFILES to remove the generated symlinks, and just ignore the
errors when copying the scripts in srcdir!=builddir situations.

Followup of commit 40ac54829d.
This commit is contained in:
Pino Toscano
2014-11-04 10:49:01 +01:00
parent 40ac54829d
commit 65a54c6c92

View File

@@ -42,6 +42,9 @@ EXTRA_DIST = \
README \
$(scripts)
CLEANFILES = \
$(symlinks)
# Some of the scripts are simply symbolic links.
virt-cat virt-df virt-edit virt-filesystems virt-format virt-inspector \
virt-log virt-ls virt-sysprep:
@@ -60,13 +63,13 @@ bashcompletiondir = $(BASH_COMPLETIONS_DIR)
#bashcompletion_DATA = $(scripts)
all-local: $(scripts) $(symlinks)
test $(srcdir) != $(builddir) && cd $(srcdir) && cp $(scripts) $(abs_builddir)/
-test $(srcdir) != $(builddir) && cd $(srcdir) && cp $(scripts) $(abs_builddir)/
install-data-local:
$(mkdir_p) $(DESTDIR)$(bashcompletiondir)
cp -d $(scripts) $(symlinks) $(DESTDIR)$(bashcompletiondir)
clean-local:
test $(srcdir) != $(builddir) && rm -f $(symlinks) $(scripts)
-test $(srcdir) != $(builddir) && rm -f $(scripts)
endif