]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
Build: Install Doxygen docs and include in distribution if generated.
authorJia Tan <jiat0218@gmail.com>
Thu, 16 Mar 2023 13:34:36 +0000 (21:34 +0800)
committerJia Tan <jiat0218@gmail.com>
Fri, 17 Mar 2023 12:18:36 +0000 (20:18 +0800)
Added a install-data-local target to install the Doxygen documentation
only when it has been generated. In order to correctly remove the docs,
a corresponding uninstall-local target was added.

If the doxygen docs exist in the source tree, they will also be included
in the distribution now too.

Makefile.am

index 1756e5cb21baba02ce4f6d0778fd564b931fd5b3..0df658fdaef85f244b897ab080412b663b09245b 100644 (file)
@@ -44,12 +44,25 @@ examplesolddir = $(docdir)/examples_old
 dist_examplesold_DATA = \
        doc/examples_old/xz_pipe_comp.c \
        doc/examples_old/xz_pipe_decomp.c
+
+# Install the Doxygen generated documentation if they were built.
+install-data-local:
+       if test -d "$(srcdir)/doc/liblzma" ; then \
+               $(MKDIR_P) "$(DESTDIR)$(docdir)/liblzma" && \
+               $(INSTALL_DATA) "$(srcdir)"/doc/liblzma/* \
+                       "$(DESTDIR)$(docdir)/liblzma"; \
+       fi
+
+# Remove the Doxygen generated documentation when uninstalling.
+uninstall-local:
+       rm -rf "$(DESTDIR)$(docdir)/liblzma"
 endif
 
 EXTRA_DIST = \
        po4a \
        extra \
        dos \
+       doxygen \
        windows \
        macosx \
        cmake \
@@ -99,6 +112,11 @@ dist-hook:
                                > "$$dest/txt/$$BASE.txt"; \
                done; \
        fi
+       if test -d "$(srcdir)/doc/liblzma" ; then \
+               $(MKDIR_P) "$(distdir)/doc/liblzma" && \
+               $(INSTALL_DATA) "$(srcdir)"/doc/liblzma/* \
+                       "$(distdir)/doc/liblzma"; \
+       fi
 
 # This works with GNU tar and gives cleaner package than normal 'make dist'.
 # This also ensures that the man page translations are up to date (dist-hook