changeset 9673:acf9952463c3

make mkdoc work on list of filenames
author John W. Eaton <jwe@octave.org>
date Wed, 30 Sep 2009 11:10:54 -0400
parents 43a07df0ed4c
children 4cf195710ae8
files scripts/ChangeLog scripts/Makefile.in scripts/mkdoc
diffstat 3 files changed, 21 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Wed Sep 30 10:18:32 2009 -0400
+++ b/scripts/ChangeLog	Wed Sep 30 11:10:54 2009 -0400
@@ -1,3 +1,10 @@
+2009-09-30  John W. Eaton  <jwe@octave.org>
+
+	* mkdoc: Work on list of file names instead of a directory.
+	* Makefile.in (ALL_M_FILES): Don't strip directories.
+	Also search build directory if it is different from $(srcdir).
+	Pass $(ALL_M_FILES) to mkdoc.
+
 2009-09-30  Michael D. Godfrey  <godfrey@isl.stanford.edu>
 
 	* plot/clabel.m: Spelling fix.
--- a/scripts/Makefile.in	Wed Sep 30 10:18:32 2009 -0400
+++ b/scripts/Makefile.in	Wed Sep 30 11:10:54 2009 -0400
@@ -35,8 +35,13 @@
 
 SOURCES =
 
-ALL_M_FILES1 := $(shell find $(srcdir) -name '*.m' -print)
-ALL_M_FILES := $(patsubst $(srcdir)/%, %, $(ALL_M_FILES1))
+ifeq ($(srcdir),.)
+  M_FILE_DIRS := $(srcdir)
+else
+  M_FILE_DIRS := $(srcdir) .
+endif
+
+ALL_M_FILES := $(shell find $(M_FILE_DIRS) -name '*.m' -print)
 
 DISTFILES = $(addprefix $(srcdir)/, Makefile.in ChangeLog $(SOURCES) \
 	configure.ac configure mkinstalldirs mkdoc mkpkgadd gethelp.cc \
@@ -75,7 +80,7 @@
 .PHONY: $(SUBDIRS)
 
 DOCSTRINGS: gethelp$(BUILD_EXEEXT) mkdoc $(ALL_M_FILES)
-	$(srcdir)/mkdoc $(srcdir) > $@.t
+	$(srcdir)/mkdoc $(ALL_M_FILES) > $@.t
 	mv $@.t $@
 
 gethelp$(BUILD_EXEEXT): gethelp.cc
--- a/scripts/mkdoc	Wed Sep 30 10:18:32 2009 -0400
+++ b/scripts/mkdoc	Wed Sep 30 11:10:54 2009 -0400
@@ -20,16 +20,10 @@
 
 set -e
 
-FIND=${FIND:-'find'}
-
 PERL=${PERL:-'perl'}
 
-if test $# -eq 1; then
-  d=$1
-elif test $# -eq 0; then
-  d=.
-else
-  echo "usage: mkdoc [directory]" 1>&2
+if test $# -eq 0; then
+  echo "usage: mkdoc file ..." 1>&2
   exit 1
 fi
 
@@ -41,8 +35,9 @@
 ### Edit those files instead and run make to update this file.
 
 EOF
-  $FIND $d -name '*.m' | \
-    $PERL -n -e 'chop;
+  for arg
+  do
+    echo "$arg" | $PERL -n -e 'chop;
                $f = "$_";
                m{(.*)/(.*)\.m};
                for (qx{./gethelp $2 "$f" < "$f"}) {
@@ -53,6 +48,7 @@
                  $i_am_in_example = 0 if /\s*\@end\s+example/;
                  print;
                }'
+  done
 else
   echo "gethelp program seems to be missing!" 1>&2
   exit 1