Mercurial > hg > octave-nkf
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 +++ b/scripts/ChangeLog @@ -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 +++ b/scripts/Makefile.in @@ -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 +++ b/scripts/mkdoc @@ -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