@@ -889,11 +889,32 @@ man1_MANS += \
889
889
man3_MANS += $(OSHMEM_MAN3_BUILT )
890
890
endif
891
891
892
+ # We do not know the names of all the generated HTML files: we only
893
+ # know that the generated tree will of files be in _build/html/.
894
+ # Unfortunately, Automake's installation process only handles
895
+ # individual files -- not entire trees of files. Hence, we use a
896
+ # "find ..." to copy the entire generated tree to the target
897
+ # directory.
898
+ #
899
+ # Note: we do not use "cp -r ..." because if the source directory is
900
+ # write-protected (e.g., during "make distcheck"), then the cp -r will
901
+ # also write-protect the target directory. Instead, use the
902
+ # Automake-provided install macros to set desirable permissions on the
903
+ # target directories and files.
904
+ #
905
+ # Since this might be a VPATH build, first check to see if _build/html
906
+ # exists in the source tree. If not, do the find+install from the
907
+ # build tree.
892
908
install-data-hook :
893
909
$(MKDIR_P ) $(DESTDIR )$(docdir )
894
- cp -r $(srcdir ) /_build/html $(DESTDIR )$(docdir )
895
- find $(DESTDIR )$(docdir ) -type d -exec chmod 0755 {} \;
896
- find $(DESTDIR )$(docdir ) -type f -exec chmod 0644 {} \;
910
+ if test -d $( srcdir) /_build/html; then \
911
+ topdir=$(srcdir ) /_build; \
912
+ else \
913
+ topdir=_build; \
914
+ fi ; \
915
+ cd $$ topdir; \
916
+ find html -type d -exec $(mkinstalldirs ) $(DESTDIR )$(docdir ) /{} \; ; \
917
+ find html -type f -exec $(INSTALL_DATA ) {} $(DESTDIR )$(docdir ) /{} \;
897
918
898
919
uninstall-hook :
899
920
rm -rf $(DESTDIR )$(docdir )
0 commit comments