make install only works once

`make install` shouldn't fail if a directory it created still exists.
In this case we can blow away the spl src directory before recreating
it.  This also gracefully handles the migration from pre-spl-merge to
post-spl-merge.

Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #7580
This commit is contained in:
Matthew Ahrens 2018-05-31 09:19:59 -07:00 committed by Brian Behlendorf
parent 928046b744
commit d1f06ec5bc
1 changed files with 3 additions and 2 deletions

View File

@ -49,6 +49,7 @@ dist-hook:
# compatibility links will be removed in the next major release.
if CONFIG_KERNEL
install-data-hook:
rm -rf $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
mkdir $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
cd $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
ln -s ../zfs-$(VERSION)/include/spl include && \
@ -56,8 +57,8 @@ install-data-hook:
ln -s ../zfs-$(VERSION)/zfs_config.h.in spl_config.h.in && \
ln -s ../zfs-$(VERSION)/zfs.release.in spl.release.in && \
cd $(DESTDIR)$(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) && \
ln -s zfs_config.h spl_config.h && \
ln -s zfs.release spl.release
ln -fs zfs_config.h spl_config.h && \
ln -fs zfs.release spl.release
endif
checkstyle: cstyle shellcheck flake8 commitcheck mancheck testscheck