gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, cmake, updated. gawk-4.1.0-92-g9c32ff7


From: Juergen Kahrs
Subject: [gawk-diffs] [SCM] gawk branch, cmake, updated. gawk-4.1.0-92-g9c32ff7
Date: Sat, 18 May 2013 16:35:35 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, cmake has been updated
       via  9c32ff7ed5aeca6906dbdb5bcf602f675893f3be (commit)
      from  31ab1e85c7423384a19575217178f34d54f4be7e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=9c32ff7ed5aeca6906dbdb5bcf602f675893f3be

commit 9c32ff7ed5aeca6906dbdb5bcf602f675893f3be
Author: Juergen Kahrs <address@hidden>
Date:   Sat May 18 18:35:13 2013 +0200

    Doc files are now built with clean dependencies.

diff --git a/cmake/docmaker b/cmake/docmaker
new file mode 100755
index 0000000..f9a821e
--- /dev/null
+++ b/cmake/docmaker
@@ -0,0 +1,61 @@
+#!/bin/sh
+
+# TODO
+# Check all dependencies first, then build the target.
+# Each target shall be implemented as one function.
+
+if test $# -lt 1; then
+  echo "  $0: Incorrect number ($#) of parameters passed: $*"
+fi
+OUTFILE=$1
+if test $OUTFILE = gawk.texi; then
+  INFILE=gawktexi.in
+  COMMAND="awk -f sidebar.awk < gawktexi.in > gawk.texi"
+elif test $OUTFILE = gawk.dvi; then
+  INFILE=gawk.texi
+  COMMAND="texi2dvi  -q --clean gawk.texi"
+elif test $OUTFILE = gawkinet.dvi; then
+  INFILE=gawkinet.texi
+  COMMAND="texi2dvi  -q --clean gawkinet.texi"
+elif test $OUTFILE = gawk.1.ps; then
+  INFILE=gawk.1
+  COMMAND="groff -z -man gawk.1 > gawk.1.ps"
+elif test $OUTFILE = igawk.1.ps; then
+  INFILE=igawk.1
+  COMMAND="groff -z -man igawk.1 > igawk.1.ps"
+elif test $OUTFILE = gawk.1.pdf; then
+  INFILE=gawk.1.ps
+  COMMAND="ps2pdf -q gawk.1.ps gawk.1.pdf"
+elif test $OUTFILE = igawk.1.pdf; then
+  INFILE=igawk.1.ps
+  COMMAND="ps2pdf -q igawk.1.ps igawk.1.pdf"
+elif test $OUTFILE = gawk.ps; then
+  INFILE=gawk.dvi
+  COMMAND="dvips -q -o gawk.ps gawk.dvi"
+elif test $OUTFILE = gawkinet.ps; then
+  INFILE=gawkinet.dvi
+  COMMAND="dvips -q -o gawkinet.ps gawkinet.dvi"
+elif test $OUTFILE = gawk.pdf; then
+  INFILE=gawk.ps
+  COMMAND="ps2pdf -q gawk.ps gawk.pdf"
+elif test $OUTFILE = gawkinet.pdf; then
+  INFILE=gawkinet.ps
+  COMMAND="ps2pdf -q gawkinet.ps gawkinet.pdf"
+else
+  echo "  unknwon target $OUTFILE"
+  exit 1
+fi
+
+if ! test -r "$INFILE"; then
+  echo " $0: Cannot read input file $INFILE"
+  exit 1
+fi
+
+if test -f "$OUTFILE"; then
+  if test "$INFILE" -ot "$OUTFILE" ; then
+    printf "  Target %15s is up-to-date\n" $OUTFILE
+    exit 0
+  fi
+fi
+echo "  Generating $OUTFILE from $INFILE"
+echo $COMMAND | sh
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 44db22f..85ac0b3 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -24,54 +24,51 @@
 
 ## process this file with CMake to produce Makefile
 
-add_custom_target(doc)
-if (LATEX_COMPILER)
-  add_custom_command(
-    TARGET doc
+MACRO(DocDependency outfile)
+  add_dependencies(doc ${outfile})
+  add_custom_target(
+    ${outfile}
+    DEPENDS ${ARGN}
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-    COMMAND echo Compiling to .dvi for gawk.texi and gawkinet.texi
-    COMMAND texi2dvi  -q --clean gawkinet.texi gawk.texi
-    COMMAND echo Compiling to .ps for gawk.1 and igawk.1
-    COMMAND groff -z -man gawk.1 > gawk.1.ps
-    COMMAND groff -z -man igawk.1 > igawk.1.ps
+    COMMAND ${CMAKE_SOURCE_DIR}/cmake/docmaker ${outfile} ${ARGN}
   )
+ENDMACRO(DocDependency)
 
+find_program(TEXI2DVI_CONVERTER texi2dvi)
+if (TEXI2DVI_CONVERTER)
+  add_custom_target(doc)
+  DocDependency(gawk.texi gawktexi.in)
+  DocDependency(gawk.dvi gawk.texi)
+  DocDependency(gawkinet.dvi gawkinet.texi)
+  DocDependency(gawk.1.ps gawk.1)
+  DocDependency(igawk.1.ps igawk.1)
+  find_program(DVIPS_CONVERTER dvips)
   if (DVIPS_CONVERTER)
-    add_custom_command(
-      TARGET doc
-      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-      COMMAND echo Compiling to .ps for gawk.dvi and gawkinet.dvi
-      COMMAND dvips -q -o gawk.ps gawk.dvi
-      COMMAND dvips -q -o gawkinet.ps gawkinet.dvi
-    )
+    DocDependency(gawk.ps gawk.dvi)
+    DocDependency(gawkinet.ps gawkinet.dvi)
+    find_program(PS2PDF_CONVERTER ps2pdf)
     if (PS2PDF_CONVERTER)
-      add_custom_command(
-        TARGET doc
-        WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-        COMMAND echo Compiling to .pdf for gawk.1.ps, igawk.1.ps, gawk.ps and 
gawkinet.ps
-        COMMAND ps2pdf -q gawk.1.ps gawk.1.pdf
-        COMMAND ps2pdf -q igawk.1.ps igawk.1.pdf
-        COMMAND ps2pdf -q gawk.ps gawk.pdf
-        COMMAND ps2pdf -q gawkinet.ps gawkinet.pdf
-      )
+      DocDependency(gawk.1.pdf gawk.1.ps)
+      DocDependency(igawk.1.pdf igawk.1.ps)
+      DocDependency(gawk.pdf gawk.ps)
+      DocDependency(gawkinet.pdf gawkinet.ps)
       install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gawk.1.pdf DESTINATION doc)
       install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/igawk.1.pdf DESTINATION doc)
       install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gawk.pdf DESTINATION doc)
       install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gawkinet.pdf DESTINATION doc)
     else()
-      message(WARNING "Found no PS2PDF_CONVERTER; no doc will be generated")
+      message(WARNING "Found no ps2pdf tool; no doc will be generated")
       install(CODE "MESSAGE(\"doc generated only in .ps files\")")
     endif()
   else()
-    message(WARNING "Found no DVIPS_CONVERTER; no doc will be generated")
+    message(WARNING "Found no dvips tool; no doc will be generated")
     install(CODE "MESSAGE(\"doc generated only in .dvi files and man pages in 
.ps files\")")
   endif()
 else()
-  message(WARNING "Found no LATEX_COMPILER; no doc will be generated")
+  message(WARNING "Found no texi2dvi tool; no doc will be generated")
   add_custom_command(
     TARGET doc
-    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-    COMMAND echo no doc generated because of missing LATEX_COMPILER
+    COMMAND echo no doc generated because of missing texi2dvi
   )
 endif()
 

-----------------------------------------------------------------------

Summary of changes:
 cmake/docmaker     |   61 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 doc/CMakeLists.txt |   57 +++++++++++++++++++++++-------------------------
 2 files changed, 88 insertions(+), 30 deletions(-)
 create mode 100755 cmake/docmaker


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]