# HG changeset patch # User John W. Eaton # Date 1254323454 14400 # Node ID acf9952463c3850b0f656963388adecb7e942c02 # Parent 43a07df0ed4c365daa0a16c6fe86ea65d6e74809 make mkdoc work on list of filenames diff -r 43a07df0ed4c -r acf9952463c3 scripts/ChangeLog --- 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 + + * 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 * plot/clabel.m: Spelling fix. diff -r 43a07df0ed4c -r acf9952463c3 scripts/Makefile.in --- 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 diff -r 43a07df0ed4c -r acf9952463c3 scripts/mkdoc --- 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