public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: support installation if sphinx-build is missing
@ 2022-11-08 10:21 Martin Liska
  0 siblings, 0 replies; 9+ messages in thread
From: Martin Liska @ 2022-11-08 10:21 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:95e6f332a1c192b1d5f89b030bbcddfe547c6914

commit 95e6f332a1c192b1d5f89b030bbcddfe547c6914
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Nov 8 11:06:26 2022 +0100

    sphinx: support installation if sphinx-build is missing
    
    gcc/ChangeLog:
    
            * Makefile.in: Support installation if sphinx-build is missing.
    
    gcc/ada/ChangeLog:
    
            * gcc-interface/Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/cp/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/d/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/fortran/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/go/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
            Support installation if sphinx-build is missing.
    
    gcc/jit/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.

Diff:
---
 gcc/Makefile.in                    | 100 +++++++++++++------------------------
 gcc/ada/gcc-interface/Make-lang.in |   9 ++--
 gcc/cp/Make-lang.in                |  10 ++--
 gcc/d/Make-lang.in                 |   9 ++--
 gcc/fortran/Make-lang.in           |  10 ++--
 gcc/go/Make-lang.in                |   7 +--
 gcc/jit/Make-lang.in               |  10 ++--
 7 files changed, 54 insertions(+), 101 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f156ea6ae5c..428078fbcf9 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3685,42 +3685,32 @@ install-info:: doc installdirs \
 	$(DESTDIR)$(infodir)/gccint.info \
 	lang.install-info
 
-$(DESTDIR)$(infodir)/gcc.info: doc/gcc/info/texinfo/gcc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcc.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcc.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcc.info $@; fi
 
-$(DESTDIR)$(infodir)/gccint.info: doc/gccint/info/texinfo/gccint.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gccint.info: installdirs
+	-if [ -f doc/gccint/info/texinfo/gccint.info ]; then rm -f $@; $(INSTALL_DATA) doc/gccint/info/texinfo/gccint.info $@; fi
 
-$(DESTDIR)$(infodir)/install.info: doc/install/info/texinfo/install.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/install.info: installdirs
+	-if [ -f doc/install/info/texinfo/install.info ]; then rm -f $@; $(INSTALL_DATA) doc/install/info/texinfo/install.info $@; fi
 
-$(DESTDIR)$(infodir)/cpp.info: doc/cpp/info/texinfo/cpp.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cpp.info: installdirs
+	-if [ -f doc/cpp/info/texinfo/cpp.info ]; then rm -f $@; $(INSTALL_DATA) doc/cpp/info/texinfo/cpp.info $@; fi
 
-$(DESTDIR)$(infodir)/cppinternals.info: doc/cppinternals/info/texinfo/cppinternals.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cppinternals.info: installdirs
+	-if [ -f doc/cppinternals/info/texinfo/cppinternals.info ]; then rm -f $@; $(INSTALL_DATA) doc/cppinternals/info/texinfo/cppinternals.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov.info: doc/gcc/info/texinfo/gcov.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-tool.info: doc/gcc/info/texinfo/gcov-tool.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-tool.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-tool.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-tool.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-dump.info: doc/gcc/info/texinfo/gcov-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-
-$(DESTDIR)$(infodir)/lto-dump.info: doc/gcc/info/texinfo/lto-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-dump.info $@; fi
 
+$(DESTDIR)$(infodir)/lto-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/lto-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/lto-dump.info $@; fi
 
 dvi__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 
@@ -3782,50 +3772,32 @@ $(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs
 	-$(INSTALL_DATA) $< $@
 	-chmod a-x $@
 
-$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/gcc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcc.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp/man/man/cpp.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/cpp.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/cpp.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-tool.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-tool.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-tool.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/lto-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/lto-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/lto-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): doc/gcc/man/man/fsf-funding.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/fsf-funding.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/fsf-funding.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gfdl$(man7ext): doc/gcc/man/man/gfdl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gfdl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gfdl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gfdl.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gpl$(man7ext): doc/gcc/man/man/gpl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gpl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gpl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gpl.7 $@; chmod a-x $@; fi
 
 # Install all the header files built in the include subdirectory.
 install-headers: $(INSTALL_HEADERS_DIR)
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 50a0babc525..c3f2040219b 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -837,16 +837,13 @@ ada.install-info: $(DESTDIR)$(infodir)/gnat_ugn.info \
 	$(DESTDIR)$(infodir)/gnat-style.info
 
 $(DESTDIR)$(infodir)/gnat_ugn.info: doc/gnat_ugn/info/texinfo/gnat_ugn.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat_rm.info: doc/gnat_rm/info/texinfo/gnat_rm.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat-style.info: doc/gnat-style/info/texinfo/gnat-style.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 ADA_PDFFILES = doc/gnat_ugn/pdf/latex/gnat_ugn.pdf\
 	       doc/gnat_rm/pdf/latex/gnat_rm.pdf \
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index f8fa4d171ea..57b89e2fdf9 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -285,15 +285,13 @@ c++.install-common: installdirs
 
 # We can't use links because not everyone supports them.  So just copy the
 # manpage.
-doc/g++.1: doc/gcc/man/man/gcc.1
-	cp $< doc/g++.1
+doc/g++.1:
+	if [ -f doc/gcc/man/man/gcc.1 ]; then cp doc/gcc/man/man/gcc.1 $@; fi
 
 c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): doc/g++.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/g++.1 ]; then rm -f $@; $(INSTALL_DATA) doc/g++.1 $@; chmod a-x $@; fi
 
 c++.install-plugin: installdirs
 # We keep the directory structure for files in config and .def files. All
diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in
index 47bee4c74f4..b7a4ef3af15 100644
--- a/gcc/d/Make-lang.in
+++ b/gcc/d/Make-lang.in
@@ -307,8 +307,7 @@ doc/gdc/pdf/latex/gdc.pdf: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_srcdir)/d/doc BUILDDIR=$(objdir)/doc/gdc/pdf SPHINXBUILD=$(SPHINX_BUILD)
 
 $(DESTDIR)$(infodir)/gdc.info: doc/gdc/info/texinfo/gdc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 d.install-pdf: doc/gdc.pdf
 	@$(NORMAL_INSTALL)
@@ -349,10 +348,8 @@ d.install-html: $(build_htmldir)/d
 
 d.install-man: $(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): doc/gdc/man/man/gdc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gdc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gdc.1 $@; chmod a-x $@; fi
 
 d.uninstall:
 	-rm -rf $(DESTDIR)$(bindir)/$(D_INSTALL_NAME)$(exeext)
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
index dc2006d8bed..48acbed1754 100644
--- a/gcc/fortran/Make-lang.in
+++ b/gcc/fortran/Make-lang.in
@@ -227,16 +227,12 @@ fortran.install-plugin:
 fortran.install-info: $(DESTDIR)$(infodir)/gfortran.info
 
 $(DESTDIR)$(infodir)/gfortran.info: doc/gfortran/info/texinfo/gfortran.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 fortran.install-man: $(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 fortran.uninstall:
 	if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
diff --git a/gcc/go/Make-lang.in b/gcc/go/Make-lang.in
index b1b1b5fc3ca..e1818de5901 100644
--- a/gcc/go/Make-lang.in
+++ b/gcc/go/Make-lang.in
@@ -155,8 +155,7 @@ go.install-plugin:
 go.install-info: $(DESTDIR)$(infodir)/gccgo.info
 
 $(DESTDIR)$(infodir)/gccgo.info: doc/gccgo/info/texinfo/gccgo.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 go.install-pdf: doc/gccgo.pdf
 	@$(NORMAL_INSTALL)
@@ -188,9 +187,7 @@ go.install-html: $(build_htmldir)/go
 go.install-man: $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext)
 
 $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext): doc/gccgo/man/man/gccgo.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 go.uninstall:
 	rm -rf $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
diff --git a/gcc/jit/Make-lang.in b/gcc/jit/Make-lang.in
index e972a25a55a..4b592aaf60d 100644
--- a/gcc/jit/Make-lang.in
+++ b/gcc/jit/Make-lang.in
@@ -251,8 +251,7 @@ doc/libgccjit/info/texinfo/libgccjit.info: $(SPHINX_FILES)
 jit.install-info: $(DESTDIR)$(infodir)/libgccjit.info
 
 $(DESTDIR)$(infodir)/libgccjit.info: doc/libgccjit/info/texinfo/libgccjit.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 doc/libgccjit/html/html/index.html: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc html SOURCEDIR=$(abs_srcdir)/jit/doc/ BUILDDIR=$(objdir)/doc/libgccjit/html SPHINXBUILD=$(SPHINX_BUILD)
@@ -393,11 +392,8 @@ endif
 
 jit.install-man: $(DESTDIR)$(man1dir)/libgccjit$(man1ext)
 
-$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 jit.install-plugin:

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: support installation if sphinx-build is missing
@ 2022-11-08 14:53 Martin Liska
  0 siblings, 0 replies; 9+ messages in thread
From: Martin Liska @ 2022-11-08 14:53 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:533954a063acc30648857a8322ea437f592ce690

commit 533954a063acc30648857a8322ea437f592ce690
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Nov 8 11:06:26 2022 +0100

    sphinx: support installation if sphinx-build is missing
    
    gcc/ChangeLog:
    
            * Makefile.in: Support installation if sphinx-build is missing.
    
    gcc/ada/ChangeLog:
    
            * gcc-interface/Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/cp/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/d/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/fortran/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/go/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
            Support installation if sphinx-build is missing.
    
    gcc/jit/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.

Diff:
---
 gcc/Makefile.in                    | 100 +++++++++++++------------------------
 gcc/ada/gcc-interface/Make-lang.in |   9 ++--
 gcc/cp/Make-lang.in                |  10 ++--
 gcc/d/Make-lang.in                 |   9 ++--
 gcc/fortran/Make-lang.in           |  10 ++--
 gcc/go/Make-lang.in                |   7 +--
 gcc/jit/Make-lang.in               |  10 ++--
 7 files changed, 54 insertions(+), 101 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f156ea6ae5c..428078fbcf9 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3685,42 +3685,32 @@ install-info:: doc installdirs \
 	$(DESTDIR)$(infodir)/gccint.info \
 	lang.install-info
 
-$(DESTDIR)$(infodir)/gcc.info: doc/gcc/info/texinfo/gcc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcc.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcc.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcc.info $@; fi
 
-$(DESTDIR)$(infodir)/gccint.info: doc/gccint/info/texinfo/gccint.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gccint.info: installdirs
+	-if [ -f doc/gccint/info/texinfo/gccint.info ]; then rm -f $@; $(INSTALL_DATA) doc/gccint/info/texinfo/gccint.info $@; fi
 
-$(DESTDIR)$(infodir)/install.info: doc/install/info/texinfo/install.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/install.info: installdirs
+	-if [ -f doc/install/info/texinfo/install.info ]; then rm -f $@; $(INSTALL_DATA) doc/install/info/texinfo/install.info $@; fi
 
-$(DESTDIR)$(infodir)/cpp.info: doc/cpp/info/texinfo/cpp.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cpp.info: installdirs
+	-if [ -f doc/cpp/info/texinfo/cpp.info ]; then rm -f $@; $(INSTALL_DATA) doc/cpp/info/texinfo/cpp.info $@; fi
 
-$(DESTDIR)$(infodir)/cppinternals.info: doc/cppinternals/info/texinfo/cppinternals.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cppinternals.info: installdirs
+	-if [ -f doc/cppinternals/info/texinfo/cppinternals.info ]; then rm -f $@; $(INSTALL_DATA) doc/cppinternals/info/texinfo/cppinternals.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov.info: doc/gcc/info/texinfo/gcov.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-tool.info: doc/gcc/info/texinfo/gcov-tool.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-tool.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-tool.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-tool.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-dump.info: doc/gcc/info/texinfo/gcov-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-
-$(DESTDIR)$(infodir)/lto-dump.info: doc/gcc/info/texinfo/lto-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-dump.info $@; fi
 
+$(DESTDIR)$(infodir)/lto-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/lto-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/lto-dump.info $@; fi
 
 dvi__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 
@@ -3782,50 +3772,32 @@ $(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs
 	-$(INSTALL_DATA) $< $@
 	-chmod a-x $@
 
-$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/gcc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcc.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp/man/man/cpp.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/cpp.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/cpp.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-tool.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-tool.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-tool.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/lto-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/lto-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/lto-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): doc/gcc/man/man/fsf-funding.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/fsf-funding.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/fsf-funding.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gfdl$(man7ext): doc/gcc/man/man/gfdl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gfdl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gfdl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gfdl.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gpl$(man7ext): doc/gcc/man/man/gpl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gpl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gpl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gpl.7 $@; chmod a-x $@; fi
 
 # Install all the header files built in the include subdirectory.
 install-headers: $(INSTALL_HEADERS_DIR)
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 555d2ef24c1..c404bef807f 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -837,16 +837,13 @@ ada.install-info: $(DESTDIR)$(infodir)/gnat_ugn.info \
 	$(DESTDIR)$(infodir)/gnat-style.info
 
 $(DESTDIR)$(infodir)/gnat_ugn.info: doc/gnat_ugn/info/texinfo/gnat_ugn.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat_rm.info: doc/gnat_rm/info/texinfo/gnat_rm.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat-style.info: doc/gnat-style/info/texinfo/gnat-style.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 ADA_PDFFILES = doc/gnat_ugn/pdf/latex/gnat_ugn.pdf\
 	       doc/gnat_rm/pdf/latex/gnat_rm.pdf \
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index f8fa4d171ea..57b89e2fdf9 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -285,15 +285,13 @@ c++.install-common: installdirs
 
 # We can't use links because not everyone supports them.  So just copy the
 # manpage.
-doc/g++.1: doc/gcc/man/man/gcc.1
-	cp $< doc/g++.1
+doc/g++.1:
+	if [ -f doc/gcc/man/man/gcc.1 ]; then cp doc/gcc/man/man/gcc.1 $@; fi
 
 c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): doc/g++.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/g++.1 ]; then rm -f $@; $(INSTALL_DATA) doc/g++.1 $@; chmod a-x $@; fi
 
 c++.install-plugin: installdirs
 # We keep the directory structure for files in config and .def files. All
diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in
index 47bee4c74f4..b7a4ef3af15 100644
--- a/gcc/d/Make-lang.in
+++ b/gcc/d/Make-lang.in
@@ -307,8 +307,7 @@ doc/gdc/pdf/latex/gdc.pdf: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_srcdir)/d/doc BUILDDIR=$(objdir)/doc/gdc/pdf SPHINXBUILD=$(SPHINX_BUILD)
 
 $(DESTDIR)$(infodir)/gdc.info: doc/gdc/info/texinfo/gdc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 d.install-pdf: doc/gdc.pdf
 	@$(NORMAL_INSTALL)
@@ -349,10 +348,8 @@ d.install-html: $(build_htmldir)/d
 
 d.install-man: $(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): doc/gdc/man/man/gdc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gdc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gdc.1 $@; chmod a-x $@; fi
 
 d.uninstall:
 	-rm -rf $(DESTDIR)$(bindir)/$(D_INSTALL_NAME)$(exeext)
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
index dc2006d8bed..48acbed1754 100644
--- a/gcc/fortran/Make-lang.in
+++ b/gcc/fortran/Make-lang.in
@@ -227,16 +227,12 @@ fortran.install-plugin:
 fortran.install-info: $(DESTDIR)$(infodir)/gfortran.info
 
 $(DESTDIR)$(infodir)/gfortran.info: doc/gfortran/info/texinfo/gfortran.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 fortran.install-man: $(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 fortran.uninstall:
 	if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
diff --git a/gcc/go/Make-lang.in b/gcc/go/Make-lang.in
index b1b1b5fc3ca..e1818de5901 100644
--- a/gcc/go/Make-lang.in
+++ b/gcc/go/Make-lang.in
@@ -155,8 +155,7 @@ go.install-plugin:
 go.install-info: $(DESTDIR)$(infodir)/gccgo.info
 
 $(DESTDIR)$(infodir)/gccgo.info: doc/gccgo/info/texinfo/gccgo.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 go.install-pdf: doc/gccgo.pdf
 	@$(NORMAL_INSTALL)
@@ -188,9 +187,7 @@ go.install-html: $(build_htmldir)/go
 go.install-man: $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext)
 
 $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext): doc/gccgo/man/man/gccgo.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 go.uninstall:
 	rm -rf $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
diff --git a/gcc/jit/Make-lang.in b/gcc/jit/Make-lang.in
index e972a25a55a..4b592aaf60d 100644
--- a/gcc/jit/Make-lang.in
+++ b/gcc/jit/Make-lang.in
@@ -251,8 +251,7 @@ doc/libgccjit/info/texinfo/libgccjit.info: $(SPHINX_FILES)
 jit.install-info: $(DESTDIR)$(infodir)/libgccjit.info
 
 $(DESTDIR)$(infodir)/libgccjit.info: doc/libgccjit/info/texinfo/libgccjit.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 doc/libgccjit/html/html/index.html: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc html SOURCEDIR=$(abs_srcdir)/jit/doc/ BUILDDIR=$(objdir)/doc/libgccjit/html SPHINXBUILD=$(SPHINX_BUILD)
@@ -393,11 +392,8 @@ endif
 
 jit.install-man: $(DESTDIR)$(man1dir)/libgccjit$(man1ext)
 
-$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 jit.install-plugin:

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: support installation if sphinx-build is missing
@ 2022-11-08 14:43 Martin Liska
  0 siblings, 0 replies; 9+ messages in thread
From: Martin Liska @ 2022-11-08 14:43 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:2f635b59d5a6dd2dc026aebb0ab256356dbc77c3

commit 2f635b59d5a6dd2dc026aebb0ab256356dbc77c3
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Nov 8 11:06:26 2022 +0100

    sphinx: support installation if sphinx-build is missing
    
    gcc/ChangeLog:
    
            * Makefile.in: Support installation if sphinx-build is missing.
    
    gcc/ada/ChangeLog:
    
            * gcc-interface/Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/cp/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/d/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/fortran/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/go/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
            Support installation if sphinx-build is missing.
    
    gcc/jit/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.

Diff:
---
 gcc/Makefile.in                    | 100 +++++++++++++------------------------
 gcc/ada/gcc-interface/Make-lang.in |   9 ++--
 gcc/cp/Make-lang.in                |  10 ++--
 gcc/d/Make-lang.in                 |   9 ++--
 gcc/fortran/Make-lang.in           |  10 ++--
 gcc/go/Make-lang.in                |   7 +--
 gcc/jit/Make-lang.in               |  10 ++--
 7 files changed, 54 insertions(+), 101 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f156ea6ae5c..428078fbcf9 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3685,42 +3685,32 @@ install-info:: doc installdirs \
 	$(DESTDIR)$(infodir)/gccint.info \
 	lang.install-info
 
-$(DESTDIR)$(infodir)/gcc.info: doc/gcc/info/texinfo/gcc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcc.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcc.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcc.info $@; fi
 
-$(DESTDIR)$(infodir)/gccint.info: doc/gccint/info/texinfo/gccint.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gccint.info: installdirs
+	-if [ -f doc/gccint/info/texinfo/gccint.info ]; then rm -f $@; $(INSTALL_DATA) doc/gccint/info/texinfo/gccint.info $@; fi
 
-$(DESTDIR)$(infodir)/install.info: doc/install/info/texinfo/install.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/install.info: installdirs
+	-if [ -f doc/install/info/texinfo/install.info ]; then rm -f $@; $(INSTALL_DATA) doc/install/info/texinfo/install.info $@; fi
 
-$(DESTDIR)$(infodir)/cpp.info: doc/cpp/info/texinfo/cpp.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cpp.info: installdirs
+	-if [ -f doc/cpp/info/texinfo/cpp.info ]; then rm -f $@; $(INSTALL_DATA) doc/cpp/info/texinfo/cpp.info $@; fi
 
-$(DESTDIR)$(infodir)/cppinternals.info: doc/cppinternals/info/texinfo/cppinternals.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cppinternals.info: installdirs
+	-if [ -f doc/cppinternals/info/texinfo/cppinternals.info ]; then rm -f $@; $(INSTALL_DATA) doc/cppinternals/info/texinfo/cppinternals.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov.info: doc/gcc/info/texinfo/gcov.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-tool.info: doc/gcc/info/texinfo/gcov-tool.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-tool.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-tool.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-tool.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-dump.info: doc/gcc/info/texinfo/gcov-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-
-$(DESTDIR)$(infodir)/lto-dump.info: doc/gcc/info/texinfo/lto-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-dump.info $@; fi
 
+$(DESTDIR)$(infodir)/lto-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/lto-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/lto-dump.info $@; fi
 
 dvi__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 
@@ -3782,50 +3772,32 @@ $(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs
 	-$(INSTALL_DATA) $< $@
 	-chmod a-x $@
 
-$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/gcc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcc.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp/man/man/cpp.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/cpp.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/cpp.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-tool.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-tool.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-tool.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/lto-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/lto-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/lto-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): doc/gcc/man/man/fsf-funding.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/fsf-funding.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/fsf-funding.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gfdl$(man7ext): doc/gcc/man/man/gfdl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gfdl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gfdl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gfdl.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gpl$(man7ext): doc/gcc/man/man/gpl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gpl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gpl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gpl.7 $@; chmod a-x $@; fi
 
 # Install all the header files built in the include subdirectory.
 install-headers: $(INSTALL_HEADERS_DIR)
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 555d2ef24c1..c404bef807f 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -837,16 +837,13 @@ ada.install-info: $(DESTDIR)$(infodir)/gnat_ugn.info \
 	$(DESTDIR)$(infodir)/gnat-style.info
 
 $(DESTDIR)$(infodir)/gnat_ugn.info: doc/gnat_ugn/info/texinfo/gnat_ugn.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat_rm.info: doc/gnat_rm/info/texinfo/gnat_rm.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat-style.info: doc/gnat-style/info/texinfo/gnat-style.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 ADA_PDFFILES = doc/gnat_ugn/pdf/latex/gnat_ugn.pdf\
 	       doc/gnat_rm/pdf/latex/gnat_rm.pdf \
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index f8fa4d171ea..57b89e2fdf9 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -285,15 +285,13 @@ c++.install-common: installdirs
 
 # We can't use links because not everyone supports them.  So just copy the
 # manpage.
-doc/g++.1: doc/gcc/man/man/gcc.1
-	cp $< doc/g++.1
+doc/g++.1:
+	if [ -f doc/gcc/man/man/gcc.1 ]; then cp doc/gcc/man/man/gcc.1 $@; fi
 
 c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): doc/g++.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/g++.1 ]; then rm -f $@; $(INSTALL_DATA) doc/g++.1 $@; chmod a-x $@; fi
 
 c++.install-plugin: installdirs
 # We keep the directory structure for files in config and .def files. All
diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in
index 47bee4c74f4..b7a4ef3af15 100644
--- a/gcc/d/Make-lang.in
+++ b/gcc/d/Make-lang.in
@@ -307,8 +307,7 @@ doc/gdc/pdf/latex/gdc.pdf: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_srcdir)/d/doc BUILDDIR=$(objdir)/doc/gdc/pdf SPHINXBUILD=$(SPHINX_BUILD)
 
 $(DESTDIR)$(infodir)/gdc.info: doc/gdc/info/texinfo/gdc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 d.install-pdf: doc/gdc.pdf
 	@$(NORMAL_INSTALL)
@@ -349,10 +348,8 @@ d.install-html: $(build_htmldir)/d
 
 d.install-man: $(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): doc/gdc/man/man/gdc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gdc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gdc.1 $@; chmod a-x $@; fi
 
 d.uninstall:
 	-rm -rf $(DESTDIR)$(bindir)/$(D_INSTALL_NAME)$(exeext)
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
index dc2006d8bed..48acbed1754 100644
--- a/gcc/fortran/Make-lang.in
+++ b/gcc/fortran/Make-lang.in
@@ -227,16 +227,12 @@ fortran.install-plugin:
 fortran.install-info: $(DESTDIR)$(infodir)/gfortran.info
 
 $(DESTDIR)$(infodir)/gfortran.info: doc/gfortran/info/texinfo/gfortran.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 fortran.install-man: $(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 fortran.uninstall:
 	if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
diff --git a/gcc/go/Make-lang.in b/gcc/go/Make-lang.in
index b1b1b5fc3ca..e1818de5901 100644
--- a/gcc/go/Make-lang.in
+++ b/gcc/go/Make-lang.in
@@ -155,8 +155,7 @@ go.install-plugin:
 go.install-info: $(DESTDIR)$(infodir)/gccgo.info
 
 $(DESTDIR)$(infodir)/gccgo.info: doc/gccgo/info/texinfo/gccgo.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 go.install-pdf: doc/gccgo.pdf
 	@$(NORMAL_INSTALL)
@@ -188,9 +187,7 @@ go.install-html: $(build_htmldir)/go
 go.install-man: $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext)
 
 $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext): doc/gccgo/man/man/gccgo.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 go.uninstall:
 	rm -rf $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
diff --git a/gcc/jit/Make-lang.in b/gcc/jit/Make-lang.in
index e972a25a55a..4b592aaf60d 100644
--- a/gcc/jit/Make-lang.in
+++ b/gcc/jit/Make-lang.in
@@ -251,8 +251,7 @@ doc/libgccjit/info/texinfo/libgccjit.info: $(SPHINX_FILES)
 jit.install-info: $(DESTDIR)$(infodir)/libgccjit.info
 
 $(DESTDIR)$(infodir)/libgccjit.info: doc/libgccjit/info/texinfo/libgccjit.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 doc/libgccjit/html/html/index.html: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc html SOURCEDIR=$(abs_srcdir)/jit/doc/ BUILDDIR=$(objdir)/doc/libgccjit/html SPHINXBUILD=$(SPHINX_BUILD)
@@ -393,11 +392,8 @@ endif
 
 jit.install-man: $(DESTDIR)$(man1dir)/libgccjit$(man1ext)
 
-$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 jit.install-plugin:

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: support installation if sphinx-build is missing
@ 2022-11-08 14:36 Martin Liska
  0 siblings, 0 replies; 9+ messages in thread
From: Martin Liska @ 2022-11-08 14:36 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:7f9b0012dbc518cdcec3b9abb1f62406e60ba6f3

commit 7f9b0012dbc518cdcec3b9abb1f62406e60ba6f3
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Nov 8 11:06:26 2022 +0100

    sphinx: support installation if sphinx-build is missing
    
    gcc/ChangeLog:
    
            * Makefile.in: Support installation if sphinx-build is missing.
    
    gcc/ada/ChangeLog:
    
            * gcc-interface/Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/cp/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/d/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/fortran/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/go/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
            Support installation if sphinx-build is missing.
    
    gcc/jit/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.

Diff:
---
 gcc/Makefile.in                    | 100 +++++++++++++------------------------
 gcc/ada/gcc-interface/Make-lang.in |   9 ++--
 gcc/cp/Make-lang.in                |  10 ++--
 gcc/d/Make-lang.in                 |   9 ++--
 gcc/fortran/Make-lang.in           |  10 ++--
 gcc/go/Make-lang.in                |   7 +--
 gcc/jit/Make-lang.in               |  10 ++--
 7 files changed, 54 insertions(+), 101 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f156ea6ae5c..428078fbcf9 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3685,42 +3685,32 @@ install-info:: doc installdirs \
 	$(DESTDIR)$(infodir)/gccint.info \
 	lang.install-info
 
-$(DESTDIR)$(infodir)/gcc.info: doc/gcc/info/texinfo/gcc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcc.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcc.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcc.info $@; fi
 
-$(DESTDIR)$(infodir)/gccint.info: doc/gccint/info/texinfo/gccint.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gccint.info: installdirs
+	-if [ -f doc/gccint/info/texinfo/gccint.info ]; then rm -f $@; $(INSTALL_DATA) doc/gccint/info/texinfo/gccint.info $@; fi
 
-$(DESTDIR)$(infodir)/install.info: doc/install/info/texinfo/install.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/install.info: installdirs
+	-if [ -f doc/install/info/texinfo/install.info ]; then rm -f $@; $(INSTALL_DATA) doc/install/info/texinfo/install.info $@; fi
 
-$(DESTDIR)$(infodir)/cpp.info: doc/cpp/info/texinfo/cpp.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cpp.info: installdirs
+	-if [ -f doc/cpp/info/texinfo/cpp.info ]; then rm -f $@; $(INSTALL_DATA) doc/cpp/info/texinfo/cpp.info $@; fi
 
-$(DESTDIR)$(infodir)/cppinternals.info: doc/cppinternals/info/texinfo/cppinternals.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cppinternals.info: installdirs
+	-if [ -f doc/cppinternals/info/texinfo/cppinternals.info ]; then rm -f $@; $(INSTALL_DATA) doc/cppinternals/info/texinfo/cppinternals.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov.info: doc/gcc/info/texinfo/gcov.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-tool.info: doc/gcc/info/texinfo/gcov-tool.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-tool.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-tool.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-tool.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-dump.info: doc/gcc/info/texinfo/gcov-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-
-$(DESTDIR)$(infodir)/lto-dump.info: doc/gcc/info/texinfo/lto-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-dump.info $@; fi
 
+$(DESTDIR)$(infodir)/lto-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/lto-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/lto-dump.info $@; fi
 
 dvi__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 
@@ -3782,50 +3772,32 @@ $(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs
 	-$(INSTALL_DATA) $< $@
 	-chmod a-x $@
 
-$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/gcc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcc.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp/man/man/cpp.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/cpp.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/cpp.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-tool.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-tool.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-tool.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/lto-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/lto-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/lto-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): doc/gcc/man/man/fsf-funding.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/fsf-funding.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/fsf-funding.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gfdl$(man7ext): doc/gcc/man/man/gfdl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gfdl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gfdl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gfdl.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gpl$(man7ext): doc/gcc/man/man/gpl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gpl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gpl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gpl.7 $@; chmod a-x $@; fi
 
 # Install all the header files built in the include subdirectory.
 install-headers: $(INSTALL_HEADERS_DIR)
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 555d2ef24c1..c404bef807f 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -837,16 +837,13 @@ ada.install-info: $(DESTDIR)$(infodir)/gnat_ugn.info \
 	$(DESTDIR)$(infodir)/gnat-style.info
 
 $(DESTDIR)$(infodir)/gnat_ugn.info: doc/gnat_ugn/info/texinfo/gnat_ugn.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat_rm.info: doc/gnat_rm/info/texinfo/gnat_rm.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat-style.info: doc/gnat-style/info/texinfo/gnat-style.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 ADA_PDFFILES = doc/gnat_ugn/pdf/latex/gnat_ugn.pdf\
 	       doc/gnat_rm/pdf/latex/gnat_rm.pdf \
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index f8fa4d171ea..57b89e2fdf9 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -285,15 +285,13 @@ c++.install-common: installdirs
 
 # We can't use links because not everyone supports them.  So just copy the
 # manpage.
-doc/g++.1: doc/gcc/man/man/gcc.1
-	cp $< doc/g++.1
+doc/g++.1:
+	if [ -f doc/gcc/man/man/gcc.1 ]; then cp doc/gcc/man/man/gcc.1 $@; fi
 
 c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): doc/g++.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/g++.1 ]; then rm -f $@; $(INSTALL_DATA) doc/g++.1 $@; chmod a-x $@; fi
 
 c++.install-plugin: installdirs
 # We keep the directory structure for files in config and .def files. All
diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in
index 47bee4c74f4..b7a4ef3af15 100644
--- a/gcc/d/Make-lang.in
+++ b/gcc/d/Make-lang.in
@@ -307,8 +307,7 @@ doc/gdc/pdf/latex/gdc.pdf: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_srcdir)/d/doc BUILDDIR=$(objdir)/doc/gdc/pdf SPHINXBUILD=$(SPHINX_BUILD)
 
 $(DESTDIR)$(infodir)/gdc.info: doc/gdc/info/texinfo/gdc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 d.install-pdf: doc/gdc.pdf
 	@$(NORMAL_INSTALL)
@@ -349,10 +348,8 @@ d.install-html: $(build_htmldir)/d
 
 d.install-man: $(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): doc/gdc/man/man/gdc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gdc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gdc.1 $@; chmod a-x $@; fi
 
 d.uninstall:
 	-rm -rf $(DESTDIR)$(bindir)/$(D_INSTALL_NAME)$(exeext)
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
index dc2006d8bed..48acbed1754 100644
--- a/gcc/fortran/Make-lang.in
+++ b/gcc/fortran/Make-lang.in
@@ -227,16 +227,12 @@ fortran.install-plugin:
 fortran.install-info: $(DESTDIR)$(infodir)/gfortran.info
 
 $(DESTDIR)$(infodir)/gfortran.info: doc/gfortran/info/texinfo/gfortran.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 fortran.install-man: $(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 fortran.uninstall:
 	if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
diff --git a/gcc/go/Make-lang.in b/gcc/go/Make-lang.in
index b1b1b5fc3ca..e1818de5901 100644
--- a/gcc/go/Make-lang.in
+++ b/gcc/go/Make-lang.in
@@ -155,8 +155,7 @@ go.install-plugin:
 go.install-info: $(DESTDIR)$(infodir)/gccgo.info
 
 $(DESTDIR)$(infodir)/gccgo.info: doc/gccgo/info/texinfo/gccgo.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 go.install-pdf: doc/gccgo.pdf
 	@$(NORMAL_INSTALL)
@@ -188,9 +187,7 @@ go.install-html: $(build_htmldir)/go
 go.install-man: $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext)
 
 $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext): doc/gccgo/man/man/gccgo.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 go.uninstall:
 	rm -rf $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
diff --git a/gcc/jit/Make-lang.in b/gcc/jit/Make-lang.in
index e972a25a55a..4b592aaf60d 100644
--- a/gcc/jit/Make-lang.in
+++ b/gcc/jit/Make-lang.in
@@ -251,8 +251,7 @@ doc/libgccjit/info/texinfo/libgccjit.info: $(SPHINX_FILES)
 jit.install-info: $(DESTDIR)$(infodir)/libgccjit.info
 
 $(DESTDIR)$(infodir)/libgccjit.info: doc/libgccjit/info/texinfo/libgccjit.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 doc/libgccjit/html/html/index.html: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc html SOURCEDIR=$(abs_srcdir)/jit/doc/ BUILDDIR=$(objdir)/doc/libgccjit/html SPHINXBUILD=$(SPHINX_BUILD)
@@ -393,11 +392,8 @@ endif
 
 jit.install-man: $(DESTDIR)$(man1dir)/libgccjit$(man1ext)
 
-$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 jit.install-plugin:

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: support installation if sphinx-build is missing
@ 2022-11-08 14:35 Martin Liska
  0 siblings, 0 replies; 9+ messages in thread
From: Martin Liska @ 2022-11-08 14:35 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ff8757e2241c5b778c9d0fa441e5ec17b62f5f37

commit ff8757e2241c5b778c9d0fa441e5ec17b62f5f37
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Nov 8 11:06:26 2022 +0100

    sphinx: support installation if sphinx-build is missing
    
    gcc/ChangeLog:
    
            * Makefile.in: Support installation if sphinx-build is missing.
    
    gcc/ada/ChangeLog:
    
            * gcc-interface/Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/cp/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/d/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/fortran/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/go/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
            Support installation if sphinx-build is missing.
    
    gcc/jit/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.

Diff:
---
 gcc/Makefile.in                    | 100 +++++++++++++------------------------
 gcc/ada/gcc-interface/Make-lang.in |   9 ++--
 gcc/cp/Make-lang.in                |  10 ++--
 gcc/d/Make-lang.in                 |   9 ++--
 gcc/fortran/Make-lang.in           |  10 ++--
 gcc/go/Make-lang.in                |   7 +--
 gcc/jit/Make-lang.in               |  10 ++--
 7 files changed, 54 insertions(+), 101 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f156ea6ae5c..428078fbcf9 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3685,42 +3685,32 @@ install-info:: doc installdirs \
 	$(DESTDIR)$(infodir)/gccint.info \
 	lang.install-info
 
-$(DESTDIR)$(infodir)/gcc.info: doc/gcc/info/texinfo/gcc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcc.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcc.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcc.info $@; fi
 
-$(DESTDIR)$(infodir)/gccint.info: doc/gccint/info/texinfo/gccint.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gccint.info: installdirs
+	-if [ -f doc/gccint/info/texinfo/gccint.info ]; then rm -f $@; $(INSTALL_DATA) doc/gccint/info/texinfo/gccint.info $@; fi
 
-$(DESTDIR)$(infodir)/install.info: doc/install/info/texinfo/install.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/install.info: installdirs
+	-if [ -f doc/install/info/texinfo/install.info ]; then rm -f $@; $(INSTALL_DATA) doc/install/info/texinfo/install.info $@; fi
 
-$(DESTDIR)$(infodir)/cpp.info: doc/cpp/info/texinfo/cpp.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cpp.info: installdirs
+	-if [ -f doc/cpp/info/texinfo/cpp.info ]; then rm -f $@; $(INSTALL_DATA) doc/cpp/info/texinfo/cpp.info $@; fi
 
-$(DESTDIR)$(infodir)/cppinternals.info: doc/cppinternals/info/texinfo/cppinternals.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cppinternals.info: installdirs
+	-if [ -f doc/cppinternals/info/texinfo/cppinternals.info ]; then rm -f $@; $(INSTALL_DATA) doc/cppinternals/info/texinfo/cppinternals.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov.info: doc/gcc/info/texinfo/gcov.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-tool.info: doc/gcc/info/texinfo/gcov-tool.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-tool.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-tool.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-tool.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-dump.info: doc/gcc/info/texinfo/gcov-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-
-$(DESTDIR)$(infodir)/lto-dump.info: doc/gcc/info/texinfo/lto-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-dump.info $@; fi
 
+$(DESTDIR)$(infodir)/lto-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/lto-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/lto-dump.info $@; fi
 
 dvi__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 
@@ -3782,50 +3772,32 @@ $(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs
 	-$(INSTALL_DATA) $< $@
 	-chmod a-x $@
 
-$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/gcc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcc.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp/man/man/cpp.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/cpp.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/cpp.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-tool.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-tool.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-tool.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/lto-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/lto-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/lto-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): doc/gcc/man/man/fsf-funding.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/fsf-funding.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/fsf-funding.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gfdl$(man7ext): doc/gcc/man/man/gfdl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gfdl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gfdl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gfdl.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gpl$(man7ext): doc/gcc/man/man/gpl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gpl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gpl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gpl.7 $@; chmod a-x $@; fi
 
 # Install all the header files built in the include subdirectory.
 install-headers: $(INSTALL_HEADERS_DIR)
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 555d2ef24c1..c404bef807f 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -837,16 +837,13 @@ ada.install-info: $(DESTDIR)$(infodir)/gnat_ugn.info \
 	$(DESTDIR)$(infodir)/gnat-style.info
 
 $(DESTDIR)$(infodir)/gnat_ugn.info: doc/gnat_ugn/info/texinfo/gnat_ugn.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat_rm.info: doc/gnat_rm/info/texinfo/gnat_rm.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat-style.info: doc/gnat-style/info/texinfo/gnat-style.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 ADA_PDFFILES = doc/gnat_ugn/pdf/latex/gnat_ugn.pdf\
 	       doc/gnat_rm/pdf/latex/gnat_rm.pdf \
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index f8fa4d171ea..57b89e2fdf9 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -285,15 +285,13 @@ c++.install-common: installdirs
 
 # We can't use links because not everyone supports them.  So just copy the
 # manpage.
-doc/g++.1: doc/gcc/man/man/gcc.1
-	cp $< doc/g++.1
+doc/g++.1:
+	if [ -f doc/gcc/man/man/gcc.1 ]; then cp doc/gcc/man/man/gcc.1 $@; fi
 
 c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): doc/g++.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/g++.1 ]; then rm -f $@; $(INSTALL_DATA) doc/g++.1 $@; chmod a-x $@; fi
 
 c++.install-plugin: installdirs
 # We keep the directory structure for files in config and .def files. All
diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in
index 47bee4c74f4..b7a4ef3af15 100644
--- a/gcc/d/Make-lang.in
+++ b/gcc/d/Make-lang.in
@@ -307,8 +307,7 @@ doc/gdc/pdf/latex/gdc.pdf: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_srcdir)/d/doc BUILDDIR=$(objdir)/doc/gdc/pdf SPHINXBUILD=$(SPHINX_BUILD)
 
 $(DESTDIR)$(infodir)/gdc.info: doc/gdc/info/texinfo/gdc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 d.install-pdf: doc/gdc.pdf
 	@$(NORMAL_INSTALL)
@@ -349,10 +348,8 @@ d.install-html: $(build_htmldir)/d
 
 d.install-man: $(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): doc/gdc/man/man/gdc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gdc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gdc.1 $@; chmod a-x $@; fi
 
 d.uninstall:
 	-rm -rf $(DESTDIR)$(bindir)/$(D_INSTALL_NAME)$(exeext)
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
index dc2006d8bed..48acbed1754 100644
--- a/gcc/fortran/Make-lang.in
+++ b/gcc/fortran/Make-lang.in
@@ -227,16 +227,12 @@ fortran.install-plugin:
 fortran.install-info: $(DESTDIR)$(infodir)/gfortran.info
 
 $(DESTDIR)$(infodir)/gfortran.info: doc/gfortran/info/texinfo/gfortran.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 fortran.install-man: $(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 fortran.uninstall:
 	if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
diff --git a/gcc/go/Make-lang.in b/gcc/go/Make-lang.in
index b1b1b5fc3ca..e1818de5901 100644
--- a/gcc/go/Make-lang.in
+++ b/gcc/go/Make-lang.in
@@ -155,8 +155,7 @@ go.install-plugin:
 go.install-info: $(DESTDIR)$(infodir)/gccgo.info
 
 $(DESTDIR)$(infodir)/gccgo.info: doc/gccgo/info/texinfo/gccgo.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 go.install-pdf: doc/gccgo.pdf
 	@$(NORMAL_INSTALL)
@@ -188,9 +187,7 @@ go.install-html: $(build_htmldir)/go
 go.install-man: $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext)
 
 $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext): doc/gccgo/man/man/gccgo.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 go.uninstall:
 	rm -rf $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
diff --git a/gcc/jit/Make-lang.in b/gcc/jit/Make-lang.in
index e972a25a55a..4b592aaf60d 100644
--- a/gcc/jit/Make-lang.in
+++ b/gcc/jit/Make-lang.in
@@ -251,8 +251,7 @@ doc/libgccjit/info/texinfo/libgccjit.info: $(SPHINX_FILES)
 jit.install-info: $(DESTDIR)$(infodir)/libgccjit.info
 
 $(DESTDIR)$(infodir)/libgccjit.info: doc/libgccjit/info/texinfo/libgccjit.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 doc/libgccjit/html/html/index.html: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc html SOURCEDIR=$(abs_srcdir)/jit/doc/ BUILDDIR=$(objdir)/doc/libgccjit/html SPHINXBUILD=$(SPHINX_BUILD)
@@ -393,11 +392,8 @@ endif
 
 jit.install-man: $(DESTDIR)$(man1dir)/libgccjit$(man1ext)
 
-$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 jit.install-plugin:

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: support installation if sphinx-build is missing
@ 2022-11-08 12:07 Martin Liska
  0 siblings, 0 replies; 9+ messages in thread
From: Martin Liska @ 2022-11-08 12:07 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:e537bc26d1b1fdc49d029377341b8dd7fa1bc222

commit e537bc26d1b1fdc49d029377341b8dd7fa1bc222
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Nov 8 11:06:26 2022 +0100

    sphinx: support installation if sphinx-build is missing
    
    gcc/ChangeLog:
    
            * Makefile.in: Support installation if sphinx-build is missing.
    
    gcc/ada/ChangeLog:
    
            * gcc-interface/Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/cp/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/d/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/fortran/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/go/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
            Support installation if sphinx-build is missing.
    
    gcc/jit/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.

Diff:
---
 gcc/Makefile.in                    | 100 +++++++++++++------------------------
 gcc/ada/gcc-interface/Make-lang.in |   9 ++--
 gcc/cp/Make-lang.in                |  10 ++--
 gcc/d/Make-lang.in                 |   9 ++--
 gcc/fortran/Make-lang.in           |  10 ++--
 gcc/go/Make-lang.in                |   7 +--
 gcc/jit/Make-lang.in               |  10 ++--
 7 files changed, 54 insertions(+), 101 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f156ea6ae5c..428078fbcf9 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3685,42 +3685,32 @@ install-info:: doc installdirs \
 	$(DESTDIR)$(infodir)/gccint.info \
 	lang.install-info
 
-$(DESTDIR)$(infodir)/gcc.info: doc/gcc/info/texinfo/gcc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcc.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcc.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcc.info $@; fi
 
-$(DESTDIR)$(infodir)/gccint.info: doc/gccint/info/texinfo/gccint.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gccint.info: installdirs
+	-if [ -f doc/gccint/info/texinfo/gccint.info ]; then rm -f $@; $(INSTALL_DATA) doc/gccint/info/texinfo/gccint.info $@; fi
 
-$(DESTDIR)$(infodir)/install.info: doc/install/info/texinfo/install.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/install.info: installdirs
+	-if [ -f doc/install/info/texinfo/install.info ]; then rm -f $@; $(INSTALL_DATA) doc/install/info/texinfo/install.info $@; fi
 
-$(DESTDIR)$(infodir)/cpp.info: doc/cpp/info/texinfo/cpp.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cpp.info: installdirs
+	-if [ -f doc/cpp/info/texinfo/cpp.info ]; then rm -f $@; $(INSTALL_DATA) doc/cpp/info/texinfo/cpp.info $@; fi
 
-$(DESTDIR)$(infodir)/cppinternals.info: doc/cppinternals/info/texinfo/cppinternals.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cppinternals.info: installdirs
+	-if [ -f doc/cppinternals/info/texinfo/cppinternals.info ]; then rm -f $@; $(INSTALL_DATA) doc/cppinternals/info/texinfo/cppinternals.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov.info: doc/gcc/info/texinfo/gcov.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-tool.info: doc/gcc/info/texinfo/gcov-tool.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-tool.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-tool.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-tool.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-dump.info: doc/gcc/info/texinfo/gcov-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-
-$(DESTDIR)$(infodir)/lto-dump.info: doc/gcc/info/texinfo/lto-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-dump.info $@; fi
 
+$(DESTDIR)$(infodir)/lto-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/lto-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/lto-dump.info $@; fi
 
 dvi__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 
@@ -3782,50 +3772,32 @@ $(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs
 	-$(INSTALL_DATA) $< $@
 	-chmod a-x $@
 
-$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/gcc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcc.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp/man/man/cpp.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/cpp.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/cpp.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-tool.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-tool.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-tool.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/lto-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/lto-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/lto-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): doc/gcc/man/man/fsf-funding.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/fsf-funding.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/fsf-funding.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gfdl$(man7ext): doc/gcc/man/man/gfdl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gfdl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gfdl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gfdl.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gpl$(man7ext): doc/gcc/man/man/gpl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gpl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gpl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gpl.7 $@; chmod a-x $@; fi
 
 # Install all the header files built in the include subdirectory.
 install-headers: $(INSTALL_HEADERS_DIR)
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 555d2ef24c1..c404bef807f 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -837,16 +837,13 @@ ada.install-info: $(DESTDIR)$(infodir)/gnat_ugn.info \
 	$(DESTDIR)$(infodir)/gnat-style.info
 
 $(DESTDIR)$(infodir)/gnat_ugn.info: doc/gnat_ugn/info/texinfo/gnat_ugn.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat_rm.info: doc/gnat_rm/info/texinfo/gnat_rm.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat-style.info: doc/gnat-style/info/texinfo/gnat-style.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 ADA_PDFFILES = doc/gnat_ugn/pdf/latex/gnat_ugn.pdf\
 	       doc/gnat_rm/pdf/latex/gnat_rm.pdf \
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index f8fa4d171ea..57b89e2fdf9 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -285,15 +285,13 @@ c++.install-common: installdirs
 
 # We can't use links because not everyone supports them.  So just copy the
 # manpage.
-doc/g++.1: doc/gcc/man/man/gcc.1
-	cp $< doc/g++.1
+doc/g++.1:
+	if [ -f doc/gcc/man/man/gcc.1 ]; then cp doc/gcc/man/man/gcc.1 $@; fi
 
 c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): doc/g++.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/g++.1 ]; then rm -f $@; $(INSTALL_DATA) doc/g++.1 $@; chmod a-x $@; fi
 
 c++.install-plugin: installdirs
 # We keep the directory structure for files in config and .def files. All
diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in
index 47bee4c74f4..b7a4ef3af15 100644
--- a/gcc/d/Make-lang.in
+++ b/gcc/d/Make-lang.in
@@ -307,8 +307,7 @@ doc/gdc/pdf/latex/gdc.pdf: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_srcdir)/d/doc BUILDDIR=$(objdir)/doc/gdc/pdf SPHINXBUILD=$(SPHINX_BUILD)
 
 $(DESTDIR)$(infodir)/gdc.info: doc/gdc/info/texinfo/gdc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 d.install-pdf: doc/gdc.pdf
 	@$(NORMAL_INSTALL)
@@ -349,10 +348,8 @@ d.install-html: $(build_htmldir)/d
 
 d.install-man: $(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): doc/gdc/man/man/gdc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gdc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gdc.1 $@; chmod a-x $@; fi
 
 d.uninstall:
 	-rm -rf $(DESTDIR)$(bindir)/$(D_INSTALL_NAME)$(exeext)
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
index dc2006d8bed..48acbed1754 100644
--- a/gcc/fortran/Make-lang.in
+++ b/gcc/fortran/Make-lang.in
@@ -227,16 +227,12 @@ fortran.install-plugin:
 fortran.install-info: $(DESTDIR)$(infodir)/gfortran.info
 
 $(DESTDIR)$(infodir)/gfortran.info: doc/gfortran/info/texinfo/gfortran.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 fortran.install-man: $(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 fortran.uninstall:
 	if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
diff --git a/gcc/go/Make-lang.in b/gcc/go/Make-lang.in
index b1b1b5fc3ca..e1818de5901 100644
--- a/gcc/go/Make-lang.in
+++ b/gcc/go/Make-lang.in
@@ -155,8 +155,7 @@ go.install-plugin:
 go.install-info: $(DESTDIR)$(infodir)/gccgo.info
 
 $(DESTDIR)$(infodir)/gccgo.info: doc/gccgo/info/texinfo/gccgo.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 go.install-pdf: doc/gccgo.pdf
 	@$(NORMAL_INSTALL)
@@ -188,9 +187,7 @@ go.install-html: $(build_htmldir)/go
 go.install-man: $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext)
 
 $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext): doc/gccgo/man/man/gccgo.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 go.uninstall:
 	rm -rf $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
diff --git a/gcc/jit/Make-lang.in b/gcc/jit/Make-lang.in
index e972a25a55a..4b592aaf60d 100644
--- a/gcc/jit/Make-lang.in
+++ b/gcc/jit/Make-lang.in
@@ -251,8 +251,7 @@ doc/libgccjit/info/texinfo/libgccjit.info: $(SPHINX_FILES)
 jit.install-info: $(DESTDIR)$(infodir)/libgccjit.info
 
 $(DESTDIR)$(infodir)/libgccjit.info: doc/libgccjit/info/texinfo/libgccjit.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 doc/libgccjit/html/html/index.html: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc html SOURCEDIR=$(abs_srcdir)/jit/doc/ BUILDDIR=$(objdir)/doc/libgccjit/html SPHINXBUILD=$(SPHINX_BUILD)
@@ -393,11 +392,8 @@ endif
 
 jit.install-man: $(DESTDIR)$(man1dir)/libgccjit$(man1ext)
 
-$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 jit.install-plugin:

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: support installation if sphinx-build is missing
@ 2022-11-08 11:43 Martin Liska
  0 siblings, 0 replies; 9+ messages in thread
From: Martin Liska @ 2022-11-08 11:43 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:c034263cb0ae05c0cc27dceef726a60f28a59590

commit c034263cb0ae05c0cc27dceef726a60f28a59590
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Nov 8 11:06:26 2022 +0100

    sphinx: support installation if sphinx-build is missing
    
    gcc/ChangeLog:
    
            * Makefile.in: Support installation if sphinx-build is missing.
    
    gcc/ada/ChangeLog:
    
            * gcc-interface/Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/cp/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/d/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/fortran/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/go/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
            Support installation if sphinx-build is missing.
    
    gcc/jit/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.

Diff:
---
 gcc/Makefile.in                    | 100 +++++++++++++------------------------
 gcc/ada/gcc-interface/Make-lang.in |   9 ++--
 gcc/cp/Make-lang.in                |  10 ++--
 gcc/d/Make-lang.in                 |   9 ++--
 gcc/fortran/Make-lang.in           |  10 ++--
 gcc/go/Make-lang.in                |   7 +--
 gcc/jit/Make-lang.in               |  10 ++--
 7 files changed, 54 insertions(+), 101 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f156ea6ae5c..428078fbcf9 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3685,42 +3685,32 @@ install-info:: doc installdirs \
 	$(DESTDIR)$(infodir)/gccint.info \
 	lang.install-info
 
-$(DESTDIR)$(infodir)/gcc.info: doc/gcc/info/texinfo/gcc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcc.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcc.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcc.info $@; fi
 
-$(DESTDIR)$(infodir)/gccint.info: doc/gccint/info/texinfo/gccint.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gccint.info: installdirs
+	-if [ -f doc/gccint/info/texinfo/gccint.info ]; then rm -f $@; $(INSTALL_DATA) doc/gccint/info/texinfo/gccint.info $@; fi
 
-$(DESTDIR)$(infodir)/install.info: doc/install/info/texinfo/install.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/install.info: installdirs
+	-if [ -f doc/install/info/texinfo/install.info ]; then rm -f $@; $(INSTALL_DATA) doc/install/info/texinfo/install.info $@; fi
 
-$(DESTDIR)$(infodir)/cpp.info: doc/cpp/info/texinfo/cpp.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cpp.info: installdirs
+	-if [ -f doc/cpp/info/texinfo/cpp.info ]; then rm -f $@; $(INSTALL_DATA) doc/cpp/info/texinfo/cpp.info $@; fi
 
-$(DESTDIR)$(infodir)/cppinternals.info: doc/cppinternals/info/texinfo/cppinternals.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cppinternals.info: installdirs
+	-if [ -f doc/cppinternals/info/texinfo/cppinternals.info ]; then rm -f $@; $(INSTALL_DATA) doc/cppinternals/info/texinfo/cppinternals.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov.info: doc/gcc/info/texinfo/gcov.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-tool.info: doc/gcc/info/texinfo/gcov-tool.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-tool.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-tool.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-tool.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-dump.info: doc/gcc/info/texinfo/gcov-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-
-$(DESTDIR)$(infodir)/lto-dump.info: doc/gcc/info/texinfo/lto-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-dump.info $@; fi
 
+$(DESTDIR)$(infodir)/lto-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/lto-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/lto-dump.info $@; fi
 
 dvi__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 
@@ -3782,50 +3772,32 @@ $(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs
 	-$(INSTALL_DATA) $< $@
 	-chmod a-x $@
 
-$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/gcc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcc.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp/man/man/cpp.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/cpp.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/cpp.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-tool.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-tool.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-tool.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/lto-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/lto-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/lto-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): doc/gcc/man/man/fsf-funding.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/fsf-funding.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/fsf-funding.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gfdl$(man7ext): doc/gcc/man/man/gfdl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gfdl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gfdl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gfdl.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gpl$(man7ext): doc/gcc/man/man/gpl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gpl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gpl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gpl.7 $@; chmod a-x $@; fi
 
 # Install all the header files built in the include subdirectory.
 install-headers: $(INSTALL_HEADERS_DIR)
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 555d2ef24c1..c404bef807f 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -837,16 +837,13 @@ ada.install-info: $(DESTDIR)$(infodir)/gnat_ugn.info \
 	$(DESTDIR)$(infodir)/gnat-style.info
 
 $(DESTDIR)$(infodir)/gnat_ugn.info: doc/gnat_ugn/info/texinfo/gnat_ugn.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat_rm.info: doc/gnat_rm/info/texinfo/gnat_rm.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat-style.info: doc/gnat-style/info/texinfo/gnat-style.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 ADA_PDFFILES = doc/gnat_ugn/pdf/latex/gnat_ugn.pdf\
 	       doc/gnat_rm/pdf/latex/gnat_rm.pdf \
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index f8fa4d171ea..57b89e2fdf9 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -285,15 +285,13 @@ c++.install-common: installdirs
 
 # We can't use links because not everyone supports them.  So just copy the
 # manpage.
-doc/g++.1: doc/gcc/man/man/gcc.1
-	cp $< doc/g++.1
+doc/g++.1:
+	if [ -f doc/gcc/man/man/gcc.1 ]; then cp doc/gcc/man/man/gcc.1 $@; fi
 
 c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): doc/g++.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/g++.1 ]; then rm -f $@; $(INSTALL_DATA) doc/g++.1 $@; chmod a-x $@; fi
 
 c++.install-plugin: installdirs
 # We keep the directory structure for files in config and .def files. All
diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in
index 47bee4c74f4..b7a4ef3af15 100644
--- a/gcc/d/Make-lang.in
+++ b/gcc/d/Make-lang.in
@@ -307,8 +307,7 @@ doc/gdc/pdf/latex/gdc.pdf: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_srcdir)/d/doc BUILDDIR=$(objdir)/doc/gdc/pdf SPHINXBUILD=$(SPHINX_BUILD)
 
 $(DESTDIR)$(infodir)/gdc.info: doc/gdc/info/texinfo/gdc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 d.install-pdf: doc/gdc.pdf
 	@$(NORMAL_INSTALL)
@@ -349,10 +348,8 @@ d.install-html: $(build_htmldir)/d
 
 d.install-man: $(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): doc/gdc/man/man/gdc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gdc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gdc.1 $@; chmod a-x $@; fi
 
 d.uninstall:
 	-rm -rf $(DESTDIR)$(bindir)/$(D_INSTALL_NAME)$(exeext)
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
index dc2006d8bed..48acbed1754 100644
--- a/gcc/fortran/Make-lang.in
+++ b/gcc/fortran/Make-lang.in
@@ -227,16 +227,12 @@ fortran.install-plugin:
 fortran.install-info: $(DESTDIR)$(infodir)/gfortran.info
 
 $(DESTDIR)$(infodir)/gfortran.info: doc/gfortran/info/texinfo/gfortran.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 fortran.install-man: $(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 fortran.uninstall:
 	if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
diff --git a/gcc/go/Make-lang.in b/gcc/go/Make-lang.in
index b1b1b5fc3ca..e1818de5901 100644
--- a/gcc/go/Make-lang.in
+++ b/gcc/go/Make-lang.in
@@ -155,8 +155,7 @@ go.install-plugin:
 go.install-info: $(DESTDIR)$(infodir)/gccgo.info
 
 $(DESTDIR)$(infodir)/gccgo.info: doc/gccgo/info/texinfo/gccgo.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 go.install-pdf: doc/gccgo.pdf
 	@$(NORMAL_INSTALL)
@@ -188,9 +187,7 @@ go.install-html: $(build_htmldir)/go
 go.install-man: $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext)
 
 $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext): doc/gccgo/man/man/gccgo.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 go.uninstall:
 	rm -rf $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
diff --git a/gcc/jit/Make-lang.in b/gcc/jit/Make-lang.in
index e972a25a55a..4b592aaf60d 100644
--- a/gcc/jit/Make-lang.in
+++ b/gcc/jit/Make-lang.in
@@ -251,8 +251,7 @@ doc/libgccjit/info/texinfo/libgccjit.info: $(SPHINX_FILES)
 jit.install-info: $(DESTDIR)$(infodir)/libgccjit.info
 
 $(DESTDIR)$(infodir)/libgccjit.info: doc/libgccjit/info/texinfo/libgccjit.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 doc/libgccjit/html/html/index.html: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc html SOURCEDIR=$(abs_srcdir)/jit/doc/ BUILDDIR=$(objdir)/doc/libgccjit/html SPHINXBUILD=$(SPHINX_BUILD)
@@ -393,11 +392,8 @@ endif
 
 jit.install-man: $(DESTDIR)$(man1dir)/libgccjit$(man1ext)
 
-$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 jit.install-plugin:

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: support installation if sphinx-build is missing
@ 2022-11-08 11:39 Martin Liska
  0 siblings, 0 replies; 9+ messages in thread
From: Martin Liska @ 2022-11-08 11:39 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:fb09029d0f01cf8f6ff403e618f021b12c947ba2

commit fb09029d0f01cf8f6ff403e618f021b12c947ba2
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Nov 8 11:06:26 2022 +0100

    sphinx: support installation if sphinx-build is missing
    
    gcc/ChangeLog:
    
            * Makefile.in: Support installation if sphinx-build is missing.
    
    gcc/ada/ChangeLog:
    
            * gcc-interface/Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/cp/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/d/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/fortran/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/go/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
            Support installation if sphinx-build is missing.
    
    gcc/jit/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.

Diff:
---
 gcc/Makefile.in                    | 100 +++++++++++++------------------------
 gcc/ada/gcc-interface/Make-lang.in |   9 ++--
 gcc/cp/Make-lang.in                |  10 ++--
 gcc/d/Make-lang.in                 |   9 ++--
 gcc/fortran/Make-lang.in           |  10 ++--
 gcc/go/Make-lang.in                |   7 +--
 gcc/jit/Make-lang.in               |  10 ++--
 7 files changed, 54 insertions(+), 101 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f156ea6ae5c..428078fbcf9 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3685,42 +3685,32 @@ install-info:: doc installdirs \
 	$(DESTDIR)$(infodir)/gccint.info \
 	lang.install-info
 
-$(DESTDIR)$(infodir)/gcc.info: doc/gcc/info/texinfo/gcc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcc.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcc.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcc.info $@; fi
 
-$(DESTDIR)$(infodir)/gccint.info: doc/gccint/info/texinfo/gccint.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gccint.info: installdirs
+	-if [ -f doc/gccint/info/texinfo/gccint.info ]; then rm -f $@; $(INSTALL_DATA) doc/gccint/info/texinfo/gccint.info $@; fi
 
-$(DESTDIR)$(infodir)/install.info: doc/install/info/texinfo/install.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/install.info: installdirs
+	-if [ -f doc/install/info/texinfo/install.info ]; then rm -f $@; $(INSTALL_DATA) doc/install/info/texinfo/install.info $@; fi
 
-$(DESTDIR)$(infodir)/cpp.info: doc/cpp/info/texinfo/cpp.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cpp.info: installdirs
+	-if [ -f doc/cpp/info/texinfo/cpp.info ]; then rm -f $@; $(INSTALL_DATA) doc/cpp/info/texinfo/cpp.info $@; fi
 
-$(DESTDIR)$(infodir)/cppinternals.info: doc/cppinternals/info/texinfo/cppinternals.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cppinternals.info: installdirs
+	-if [ -f doc/cppinternals/info/texinfo/cppinternals.info ]; then rm -f $@; $(INSTALL_DATA) doc/cppinternals/info/texinfo/cppinternals.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov.info: doc/gcc/info/texinfo/gcov.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-tool.info: doc/gcc/info/texinfo/gcov-tool.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-tool.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-tool.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-tool.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-dump.info: doc/gcc/info/texinfo/gcov-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-
-$(DESTDIR)$(infodir)/lto-dump.info: doc/gcc/info/texinfo/lto-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-dump.info $@; fi
 
+$(DESTDIR)$(infodir)/lto-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/lto-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/lto-dump.info $@; fi
 
 dvi__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 
@@ -3782,50 +3772,32 @@ $(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs
 	-$(INSTALL_DATA) $< $@
 	-chmod a-x $@
 
-$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/gcc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcc.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp/man/man/cpp.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/cpp.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/cpp.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-tool.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-tool.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-tool.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/lto-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/lto-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/lto-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): doc/gcc/man/man/fsf-funding.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/fsf-funding.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/fsf-funding.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gfdl$(man7ext): doc/gcc/man/man/gfdl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gfdl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gfdl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gfdl.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gpl$(man7ext): doc/gcc/man/man/gpl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gpl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gpl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gpl.7 $@; chmod a-x $@; fi
 
 # Install all the header files built in the include subdirectory.
 install-headers: $(INSTALL_HEADERS_DIR)
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 555d2ef24c1..c404bef807f 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -837,16 +837,13 @@ ada.install-info: $(DESTDIR)$(infodir)/gnat_ugn.info \
 	$(DESTDIR)$(infodir)/gnat-style.info
 
 $(DESTDIR)$(infodir)/gnat_ugn.info: doc/gnat_ugn/info/texinfo/gnat_ugn.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat_rm.info: doc/gnat_rm/info/texinfo/gnat_rm.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat-style.info: doc/gnat-style/info/texinfo/gnat-style.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 ADA_PDFFILES = doc/gnat_ugn/pdf/latex/gnat_ugn.pdf\
 	       doc/gnat_rm/pdf/latex/gnat_rm.pdf \
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index f8fa4d171ea..57b89e2fdf9 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -285,15 +285,13 @@ c++.install-common: installdirs
 
 # We can't use links because not everyone supports them.  So just copy the
 # manpage.
-doc/g++.1: doc/gcc/man/man/gcc.1
-	cp $< doc/g++.1
+doc/g++.1:
+	if [ -f doc/gcc/man/man/gcc.1 ]; then cp doc/gcc/man/man/gcc.1 $@; fi
 
 c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): doc/g++.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/g++.1 ]; then rm -f $@; $(INSTALL_DATA) doc/g++.1 $@; chmod a-x $@; fi
 
 c++.install-plugin: installdirs
 # We keep the directory structure for files in config and .def files. All
diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in
index 47bee4c74f4..b7a4ef3af15 100644
--- a/gcc/d/Make-lang.in
+++ b/gcc/d/Make-lang.in
@@ -307,8 +307,7 @@ doc/gdc/pdf/latex/gdc.pdf: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_srcdir)/d/doc BUILDDIR=$(objdir)/doc/gdc/pdf SPHINXBUILD=$(SPHINX_BUILD)
 
 $(DESTDIR)$(infodir)/gdc.info: doc/gdc/info/texinfo/gdc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 d.install-pdf: doc/gdc.pdf
 	@$(NORMAL_INSTALL)
@@ -349,10 +348,8 @@ d.install-html: $(build_htmldir)/d
 
 d.install-man: $(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): doc/gdc/man/man/gdc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gdc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gdc.1 $@; chmod a-x $@; fi
 
 d.uninstall:
 	-rm -rf $(DESTDIR)$(bindir)/$(D_INSTALL_NAME)$(exeext)
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
index dc2006d8bed..48acbed1754 100644
--- a/gcc/fortran/Make-lang.in
+++ b/gcc/fortran/Make-lang.in
@@ -227,16 +227,12 @@ fortran.install-plugin:
 fortran.install-info: $(DESTDIR)$(infodir)/gfortran.info
 
 $(DESTDIR)$(infodir)/gfortran.info: doc/gfortran/info/texinfo/gfortran.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 fortran.install-man: $(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 fortran.uninstall:
 	if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
diff --git a/gcc/go/Make-lang.in b/gcc/go/Make-lang.in
index b1b1b5fc3ca..e1818de5901 100644
--- a/gcc/go/Make-lang.in
+++ b/gcc/go/Make-lang.in
@@ -155,8 +155,7 @@ go.install-plugin:
 go.install-info: $(DESTDIR)$(infodir)/gccgo.info
 
 $(DESTDIR)$(infodir)/gccgo.info: doc/gccgo/info/texinfo/gccgo.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 go.install-pdf: doc/gccgo.pdf
 	@$(NORMAL_INSTALL)
@@ -188,9 +187,7 @@ go.install-html: $(build_htmldir)/go
 go.install-man: $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext)
 
 $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext): doc/gccgo/man/man/gccgo.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 go.uninstall:
 	rm -rf $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
diff --git a/gcc/jit/Make-lang.in b/gcc/jit/Make-lang.in
index e972a25a55a..4b592aaf60d 100644
--- a/gcc/jit/Make-lang.in
+++ b/gcc/jit/Make-lang.in
@@ -251,8 +251,7 @@ doc/libgccjit/info/texinfo/libgccjit.info: $(SPHINX_FILES)
 jit.install-info: $(DESTDIR)$(infodir)/libgccjit.info
 
 $(DESTDIR)$(infodir)/libgccjit.info: doc/libgccjit/info/texinfo/libgccjit.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 doc/libgccjit/html/html/index.html: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc html SOURCEDIR=$(abs_srcdir)/jit/doc/ BUILDDIR=$(objdir)/doc/libgccjit/html SPHINXBUILD=$(SPHINX_BUILD)
@@ -393,11 +392,8 @@ endif
 
 jit.install-man: $(DESTDIR)$(man1dir)/libgccjit$(man1ext)
 
-$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 jit.install-plugin:

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: support installation if sphinx-build is missing
@ 2022-11-08 11:24 Martin Liska
  0 siblings, 0 replies; 9+ messages in thread
From: Martin Liska @ 2022-11-08 11:24 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:a6d9d28c1d47d267b7c4827893f00c8eace9b635

commit a6d9d28c1d47d267b7c4827893f00c8eace9b635
Author: Martin Liska <mliska@suse.cz>
Date:   Tue Nov 8 11:06:26 2022 +0100

    sphinx: support installation if sphinx-build is missing
    
    gcc/ChangeLog:
    
            * Makefile.in: Support installation if sphinx-build is missing.
    
    gcc/ada/ChangeLog:
    
            * gcc-interface/Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/cp/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/d/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/fortran/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
    
    gcc/go/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.
            Support installation if sphinx-build is missing.
    
    gcc/jit/ChangeLog:
    
            * Make-lang.in:
            Support installation if sphinx-build is missing.

Diff:
---
 gcc/Makefile.in                    | 100 +++++++++++++------------------------
 gcc/ada/gcc-interface/Make-lang.in |   9 ++--
 gcc/cp/Make-lang.in                |  10 ++--
 gcc/d/Make-lang.in                 |   9 ++--
 gcc/fortran/Make-lang.in           |  10 ++--
 gcc/go/Make-lang.in                |   7 +--
 gcc/jit/Make-lang.in               |  10 ++--
 7 files changed, 54 insertions(+), 101 deletions(-)

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index f156ea6ae5c..428078fbcf9 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -3685,42 +3685,32 @@ install-info:: doc installdirs \
 	$(DESTDIR)$(infodir)/gccint.info \
 	lang.install-info
 
-$(DESTDIR)$(infodir)/gcc.info: doc/gcc/info/texinfo/gcc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcc.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcc.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcc.info $@; fi
 
-$(DESTDIR)$(infodir)/gccint.info: doc/gccint/info/texinfo/gccint.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gccint.info: installdirs
+	-if [ -f doc/gccint/info/texinfo/gccint.info ]; then rm -f $@; $(INSTALL_DATA) doc/gccint/info/texinfo/gccint.info $@; fi
 
-$(DESTDIR)$(infodir)/install.info: doc/install/info/texinfo/install.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/install.info: installdirs
+	-if [ -f doc/install/info/texinfo/install.info ]; then rm -f $@; $(INSTALL_DATA) doc/install/info/texinfo/install.info $@; fi
 
-$(DESTDIR)$(infodir)/cpp.info: doc/cpp/info/texinfo/cpp.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cpp.info: installdirs
+	-if [ -f doc/cpp/info/texinfo/cpp.info ]; then rm -f $@; $(INSTALL_DATA) doc/cpp/info/texinfo/cpp.info $@; fi
 
-$(DESTDIR)$(infodir)/cppinternals.info: doc/cppinternals/info/texinfo/cppinternals.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/cppinternals.info: installdirs
+	-if [ -f doc/cppinternals/info/texinfo/cppinternals.info ]; then rm -f $@; $(INSTALL_DATA) doc/cppinternals/info/texinfo/cppinternals.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov.info: doc/gcc/info/texinfo/gcov.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-tool.info: doc/gcc/info/texinfo/gcov-tool.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-tool.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-tool.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-tool.info $@; fi
 
-$(DESTDIR)$(infodir)/gcov-dump.info: doc/gcc/info/texinfo/gcov-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-
-$(DESTDIR)$(infodir)/lto-dump.info: doc/gcc/info/texinfo/lto-dump.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+$(DESTDIR)$(infodir)/gcov-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/gcov-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/gcov-dump.info $@; fi
 
+$(DESTDIR)$(infodir)/lto-dump.info: installdirs
+	-if [ -f doc/gcc/info/texinfo/lto-dump.info ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/info/texinfo/lto-dump.info $@; fi
 
 dvi__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 
@@ -3782,50 +3772,32 @@ $(DESTDIR)$(man7dir)/%$(man7ext): doc/%.7 installdirs
 	-$(INSTALL_DATA) $< $@
 	-chmod a-x $@
 
-$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/gcc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcc.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext): doc/cpp/man/man/cpp.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(CPP_INSTALL_NAME)$(man1ext):  installdirs
+	-if [ -f doc/gcc/man/man/cpp.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/cpp.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-tool.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_TOOL_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-tool.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-tool.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/gcov-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GCOV_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gcov-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gcov-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): doc/gcc/man/man/lto-dump.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(LTO_DUMP_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/lto-dump.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/lto-dump.1 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): doc/gcc/man/man/fsf-funding.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/fsf-funding$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/fsf-funding.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/fsf-funding.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gfdl$(man7ext): doc/gcc/man/man/gfdl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gfdl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gfdl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gfdl.7 $@; chmod a-x $@; fi
 
-$(DESTDIR)$(man7dir)/gpl$(man7ext): doc/gcc/man/man/gpl.7 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man7dir)/gpl$(man7ext): installdirs
+	-if [ -f doc/gcc/man/man/gpl.7 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gpl.7 $@; chmod a-x $@; fi
 
 # Install all the header files built in the include subdirectory.
 install-headers: $(INSTALL_HEADERS_DIR)
diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index 50a0babc525..c3f2040219b 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -837,16 +837,13 @@ ada.install-info: $(DESTDIR)$(infodir)/gnat_ugn.info \
 	$(DESTDIR)$(infodir)/gnat-style.info
 
 $(DESTDIR)$(infodir)/gnat_ugn.info: doc/gnat_ugn/info/texinfo/gnat_ugn.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat_rm.info: doc/gnat_rm/info/texinfo/gnat_rm.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 $(DESTDIR)$(infodir)/gnat-style.info: doc/gnat-style/info/texinfo/gnat-style.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 ADA_PDFFILES = doc/gnat_ugn/pdf/latex/gnat_ugn.pdf\
 	       doc/gnat_rm/pdf/latex/gnat_rm.pdf \
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index f8fa4d171ea..57b89e2fdf9 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -285,15 +285,13 @@ c++.install-common: installdirs
 
 # We can't use links because not everyone supports them.  So just copy the
 # manpage.
-doc/g++.1: doc/gcc/man/man/gcc.1
-	cp $< doc/g++.1
+doc/g++.1:
+	if [ -f doc/gcc/man/man/gcc.1 ]; then cp doc/gcc/man/man/gcc.1 $@; fi
 
 c++.install-man: $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): doc/g++.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/g++.1 ]; then rm -f $@; $(INSTALL_DATA) doc/g++.1 $@; chmod a-x $@; fi
 
 c++.install-plugin: installdirs
 # We keep the directory structure for files in config and .def files. All
diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in
index 47bee4c74f4..b7a4ef3af15 100644
--- a/gcc/d/Make-lang.in
+++ b/gcc/d/Make-lang.in
@@ -307,8 +307,7 @@ doc/gdc/pdf/latex/gdc.pdf: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc latexpdf SOURCEDIR=$(abs_srcdir)/d/doc BUILDDIR=$(objdir)/doc/gdc/pdf SPHINXBUILD=$(SPHINX_BUILD)
 
 $(DESTDIR)$(infodir)/gdc.info: doc/gdc/info/texinfo/gdc.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 d.install-pdf: doc/gdc.pdf
 	@$(NORMAL_INSTALL)
@@ -349,10 +348,8 @@ d.install-html: $(build_htmldir)/d
 
 d.install-man: $(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): doc/gdc/man/man/gdc.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(D_INSTALL_NAME)$(man1ext): installdirs
+	-if [ -f doc/gcc/man/man/gdc.1 ]; then rm -f $@; $(INSTALL_DATA) doc/gcc/man/man/gdc.1 $@; chmod a-x $@; fi
 
 d.uninstall:
 	-rm -rf $(DESTDIR)$(bindir)/$(D_INSTALL_NAME)$(exeext)
diff --git a/gcc/fortran/Make-lang.in b/gcc/fortran/Make-lang.in
index dc2006d8bed..48acbed1754 100644
--- a/gcc/fortran/Make-lang.in
+++ b/gcc/fortran/Make-lang.in
@@ -227,16 +227,12 @@ fortran.install-plugin:
 fortran.install-info: $(DESTDIR)$(infodir)/gfortran.info
 
 $(DESTDIR)$(infodir)/gfortran.info: doc/gfortran/info/texinfo/gfortran.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 fortran.install-man: $(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext)
 
-$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/$(GFORTRAN_INSTALL_NAME)$(man1ext): doc/gfortran/man/man/gfortran.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 fortran.uninstall:
 	if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
diff --git a/gcc/go/Make-lang.in b/gcc/go/Make-lang.in
index b1b1b5fc3ca..e1818de5901 100644
--- a/gcc/go/Make-lang.in
+++ b/gcc/go/Make-lang.in
@@ -155,8 +155,7 @@ go.install-plugin:
 go.install-info: $(DESTDIR)$(infodir)/gccgo.info
 
 $(DESTDIR)$(infodir)/gccgo.info: doc/gccgo/info/texinfo/gccgo.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 go.install-pdf: doc/gccgo.pdf
 	@$(NORMAL_INSTALL)
@@ -188,9 +187,7 @@ go.install-html: $(build_htmldir)/go
 go.install-man: $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext)
 
 $(DESTDIR)$(man1dir)/$(GCCGO_INSTALL_NAME)$(man1ext): doc/gccgo/man/man/gccgo.1 installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 go.uninstall:
 	rm -rf $(DESTDIR)$(bindir)/$(GCCGO_INSTALL_NAME)$(exeext)
diff --git a/gcc/jit/Make-lang.in b/gcc/jit/Make-lang.in
index e972a25a55a..4b592aaf60d 100644
--- a/gcc/jit/Make-lang.in
+++ b/gcc/jit/Make-lang.in
@@ -251,8 +251,7 @@ doc/libgccjit/info/texinfo/libgccjit.info: $(SPHINX_FILES)
 jit.install-info: $(DESTDIR)$(infodir)/libgccjit.info
 
 $(DESTDIR)$(infodir)/libgccjit.info: doc/libgccjit/info/texinfo/libgccjit.info installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; fi
 
 doc/libgccjit/html/html/index.html: $(SPHINX_FILES)
 	+ make -C $(srcdir)/../doc html SOURCEDIR=$(abs_srcdir)/jit/doc/ BUILDDIR=$(objdir)/doc/libgccjit/html SPHINXBUILD=$(SPHINX_BUILD)
@@ -393,11 +392,8 @@ endif
 
 jit.install-man: $(DESTDIR)$(man1dir)/libgccjit$(man1ext)
 
-$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 \
-		installdirs
-	-rm -f $@
-	-$(INSTALL_DATA) $< $@
-	-chmod a-x $@
+$(DESTDIR)$(man1dir)/libgccjit$(man1ext): doc/libgccjit/man/man/libgccjit.1 installdirs
+	-if [ -f $< ]; then rm -f $@; $(INSTALL_DATA) $< $@; chmod a-x $@; fi
 
 jit.install-plugin:

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-11-08 14:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-08 10:21 [gcc(refs/users/marxin/heads/sphinx-final)] sphinx: support installation if sphinx-build is missing Martin Liska
2022-11-08 11:24 Martin Liska
2022-11-08 11:39 Martin Liska
2022-11-08 11:43 Martin Liska
2022-11-08 12:07 Martin Liska
2022-11-08 14:35 Martin Liska
2022-11-08 14:36 Martin Liska
2022-11-08 14:43 Martin Liska
2022-11-08 14:53 Martin Liska

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).