]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] texinfo: simplify VPATH handling
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 18 May 2012 09:24:55 +0000 (11:24 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 18 May 2012 09:24:55 +0000 (11:24 +0200)
GNU make doesn't do VPATH rewrites a' la' Solaris make, but does VPATH
rewrites for the '$<' automatic variable.  Take advantage of these facts
to simplify some texinfo-related recipes.

It is worth nothing that with this change, Automake-generated texinfo
rules will assume Texinfo >= 4.1.  Since that is more than 10 years old,
this new requirement should be perfectly acceptable.

* lib/am/texi-vers.am, lib/am/texibuild.am: Simplify some rules by
assuming Texinfo >= 4.1 and GNU make VPATH semantics.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/am/texi-vers.am
lib/am/texibuild.am

index 4f2495c5ac83ad54ef7fac5d47151ca747bc3ed2..c930f206f316cda1619c2b56e3b2133eb6a02cb8 100644 (file)
@@ -32,8 +32,7 @@ am__dist_common += %VTEXI% %STAMPVTI%
 ## should never be dependent upon a non-distributed built file.
 ## Therefore we ensure that %DIRSTAMP% exists in the rule.
 ?DIRSTAMP?     test -f %DIRSTAMP% || $(MAKE) %DIRSTAMP%
-       @(dir=.; test -f ./%TEXI% || dir=$(srcdir); \
-       set `$(SHELL) %MDDIR%mdate-sh $$dir/%TEXI%`; \
+       @(set `$(SHELL) %MDDIR%mdate-sh $<`; \
        echo "@set UPDATED $$1 $$2 $$3"; \
        echo "@set UPDATED-MONTH $$2 $$3"; \
        echo "@set EDITION $(VERSION)"; \
index 73abd1f0fdec060e162b75bdc902656ee89cef9d..088b857046122fad981c4d4cc04873aa9c9eb28c 100644 (file)
          done; \
        else :; fi && \
 ?INSRC?        cd "$$am__cwd"; \
-       if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
-?!INSRC?        -o $@ `test -f '%SOURCE_INFO%' || echo '$(srcdir)/'`%SOURCE_INFO%; \
-?INSRC??!GENERIC_INFO?  -o $@ $(srcdir)/%SOURCE_INFO%; \
-?INSRC??GENERIC_INFO?   -o $@ $<; \
+       if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% -o $@ $<; \
        then \
          rc=0; \
 ?INSRC?          $(am__cd) $(srcdir); \
@@ -65,14 +62,12 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ## Must set MAKEINFO like this so that version.texi will be found even
 ## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%).
        MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \
-## Do not use '-o' unless necessary: it is only supported since Texinfo 4.1.
 ## texi2dvi doesn't silence everything with -q, redirect to /dev/null instead.
 ## We still want -q (%TEXIQUIET%) because it turns on batch mode.
 ## Use '--clean' to avoid leaving auxiliary files behind cluttering the build
 ## directory (see automake bug#11146).  We should start using '--tidy' when we
 ## can assume Texinf 4.9 or later.
-?GENERIC?      $(TEXI2DVI) %TEXIQUIET% --clean %SOURCE% %TEXIDEVNULL%
-?!GENERIC?     $(TEXI2DVI) %TEXIQUIET% --clean -o $@ `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% %TEXIDEVNULL%
+       $(TEXI2DVI) %TEXIQUIET% --clean -o $@ $< %TEXIDEVNULL%
 
 ?GENERIC?%.pdf: %%SOURCE_SUFFIX%
 ?!GENERIC?%DEST_PREFIX%.pdf: %SOURCE% %DEPS% %DIRSTAMP%
@@ -80,14 +75,12 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ## Must set MAKEINFO like this so that version.texi will be found even
 ## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%).
        MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \
-## Do not use '-o' unless necessary: it is only supported since Texinfo 4.1.
 ## texi2pdf doesn't silence everything with -q, redirect to /dev/null instead.
 ## We still want -q (%TEXIQUIET%) because it turns on batch mode.
 ## Use '--clean' to avoid leaving auxiliary files behind cluttering the build
 ## directory (see automake bug#11146).  We should start using '--tidy' when we
 ## can assume Texinf 4.9 or later.
-?GENERIC?      $(TEXI2PDF) %TEXIQUIET% --clean %SOURCE% %TEXIDEVNULL%
-?!GENERIC?     $(TEXI2PDF) %TEXIQUIET% --clean -o $@ `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% %TEXIDEVNULL%
+       $(TEXI2PDF) %TEXIQUIET% --clean -o $@ $< %TEXIDEVNULL%
 
 ?GENERIC?%.html: %%SOURCE_SUFFIX%
 ?!GENERIC?%DEST_PREFIX%.html: %SOURCE% %DEPS% %DIRSTAMP%
@@ -98,9 +91,8 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
 ## is to build under a temporary name, and replace the target on
 ## success.
        %AM_V_MAKEINFO%rm -rf $(@:.html=.htp)
-       %SILENT%if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS% \
-?GENERIC?       -o $(@:.html=.htp) %SOURCE%; \
-?!GENERIC?      -o $(@:.html=.htp) `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%; \
+       %SILENT%if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) \
+                                  %MAKEINFOFLAGS% -o $(@:.html=.htp) $<; \
        then \
          rm -rf $@; \
 ## Work around a bug in Texinfo 4.1 (-o foo.html outputs files in foo/