# HG changeset patch # User John W. Eaton # Date 1259872760 18000 # Node ID 8d20fb66a0dc15cae7c6f5cc8c05b257c5c67325 # Parent 84a7c11ff928c1c34185a78e33d5d93ca2c4ded7 more automake fixes diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2009-12-03 John W. Eaton + + * common.mk (OCTAVE_VERSION, OCTAVE_API_VERSION) + (OCTAVE_RELEASE_DATE, OCTAVE_COPYRIGHT, OCTAVE_IDX_TYPE): + New substituted variables. + (version): Define from $(OCTAVE_VERSION). + (api_version): Define from $(OCTAVE_API_VERSION). + (do_subst_texinfo_vals): Delete macro. + + * configure.ac (AC_CONFIG_HEADER): Quote arg. + (AC_CONFIG_FILES): Remove mxarray.h and version.h from the list. + + * examples/Makefile.am (CLEANFILES): New variable. + 2009-11-30 Kacper Kowalik * acinclude.m4 (OCTAVE_HDF5_HAS_ENFORCED_16_API): New macro that diff --git a/common.mk b/common.mk --- a/common.mk +++ b/common.mk @@ -18,8 +18,13 @@ DESKTOP_FILE_INSTALL = @DESKTOP_FILE_INSTALL@ -version = @OCTAVE_VERSION@ -api_version = @OCTAVE_API_VERSION@ +OCTAVE_VERSION = @OCTAVE_VERSION@ +OCTAVE_API_VERSION = @OCTAVE_API_VERSION@ +OCTAVE_RELEASE_DATE = @OCTAVE_RELEASE_DATE@ +OCTAVE_COPYRIGHT = @OCTAVE_COPYRIGHT@ + +version = $(OCTAVE_VERSION) +api_version = $(OCTAVE_API_VERSION) ## AM_LIBTOOLFLAGS = --silent @@ -273,6 +278,7 @@ FFTW_XLIBS = $(FFTW3_LIBS) $(FFTW3F_LIBS) USE_64_BIT_IDX_T = @USE_64_BIT_IDX_T@ +OCTAVE_IDX_TYPE = @OCTAVE_IDX_TYPE@ TEXINFO_COLAMD = @TEXINFO_COLAMD@ TEXINFO_CHOLMOD = @TEXINFO_CHOLMOD@ @@ -621,21 +627,6 @@ $(simple_move_if_change_rule) endef -define do_subst_texinfo_vals -echo "making $@ from $<" -$(SED) < $< \ - -e "s|%abs_top_srcdir%|${abs_top_srcdir}|" \ - -e "s|%top_srcdir%|${top_srcdir}|" \ - -e "s|%OCTAVE_HOME%|${prefix}|" \ - -e "s|%OCTAVE_VERSION%|${version}|" \ - -e "s|%TEXINFO_COLAMD%|${TEXINFO_COLAMD}|" \ - -e "s|%TEXINFO_CHOLMOD%|${TEXINFO_CHOLMOD}|" \ - -e "s|%TEXINFO_UMFPACK%|${TEXINFO_UMFPACK}|" \ - -e "s|%TEXINFO_QHULL%|${TEXINFO_QHULL}|" | \ - $(SED) -e "s|%OCTAVE_CONF_DEFS%|\"${UGLY_DEFS}\"|" > $@-t -$(simple_move_if_change_rule) -endef - define do_subst_script_vals echo "making $@ from $<" $(SED) < $< \ diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -45,7 +45,7 @@ AC_REVISION($Revision: 1.603 $) AC_PREREQ(2.60) AC_CONFIG_SRCDIR([src/octave.cc]) -AC_CONFIG_HEADER(config.h) +AC_CONFIG_HEADER([config.h]) AC_CONFIG_MACRO_DIR([m4]) OCTAVE_HOST_TYPE @@ -2144,8 +2144,6 @@ liboctave/Makefile scripts/Makefile src/Makefile - src/mxarray.h - src/version.h test/Makefile]) AC_OUTPUT diff --git a/doc/ChangeLog b/doc/ChangeLog --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,44 @@ +2009-12-03 John W. Eaton + + * doc/Makefile.am (MUNGED_TEXI_SRC): Define as explicit list. + (TXI_SRC): Define using substitution rule. + + * doc/Makefile.am (conf.texi): Only substitute OCTAVE_VERSION. + * conf.texi: Likewise. + + * doc/interpreter/find-docstring-files.sh: New file. + * doc/interpreter/Makefile.am (DOCSTRING_FILES): Use it. + ($(TOPDIR)/src/DOCSTRINGS, $(TOPDIR)/scripts/DOCSTRINGS): + Delete rules. + (.txi.texi): Pass $(top_srcdir) to munge-texi. + (octave.info octave.dvi octave.pdf octave.html): + Depend on $(octave_TEXINFOS), not $(nodist_octave_TEXINFOS). + (nodist_octave_TEXINFOS): Delete variable. + (octave_TEXINFOS): Include ../conf.texi in the list. + (dist-hook): Delete target. + (EXTRA_DIST): Add find-docstring-files.sh to the list. + + * doc/interpreter/basics.texi: Eliminate @value{OCTAVEHOME} + * doc/interpreter/dynamic.txi: Delete examplefile and + longexamplefile macro definitions. Replace uses with + @EXAMPLEFILE, to be expanded by munge-texi. + * doc/interpreter/geometry.txi: Eliminate @ifset HAVE_QHULL. + * doc/interpreter/oop.txi: Delete classfile and polynomialfile + macro definitions. Replace uses with @EXAMPLEFILE, to be expanded + by munge-texi. + * doc/interpreter/sparse.txi: Eliminate @ifset HAVE_CHOLMOD, + @ifset HAVE_UMFPACK, and @ifset HAVE_COLAMD. + + * munge-texi.cc (top_srcdir): New global variable. + (main): set top_srcdir from first arg. + (usage): Include TOP-SRCDIR in the message. + (recover_from_macro, process_example_file): New functions. + (process_texi_input_file): Handle @EXAMPLEFILE tag. + + * doc/liboctave/Makefile.am (nodist_liboctave_TEXINFOS): + Delete variable. + (liboctave_TEXINFOS): Include ../conf.texi in the list. + 2009-12-02 Rik * interpreter/Makefile.am: Correct Makefile.am to allow VPATH builds of diff --git a/doc/Makefile.am b/doc/Makefile.am --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -36,17 +36,10 @@ all-local: conf.texi -conf.texi: conf.texi.in $(TOPDIR)/common.mk +conf.texi: conf.texi.in Makefile @echo "making $@ from $<" @$(SED) < $< \ - -e "s|%abs_top_srcdir%|${abs_top_srcdir}|" \ - -e "s|%top_srcdir%|${top_srcdir}|" \ - -e "s|%OCTAVE_HOME%|${prefix}|" \ - -e "s|%OCTAVE_VERSION%|${version}|" \ - -e "s|%TEXINFO_COLAMD%|${TEXINFO_COLAMD}|" \ - -e "s|%TEXINFO_CHOLMOD%|${TEXINFO_CHOLMOD}|" \ - -e "s|%TEXINFO_UMFPACK%|${TEXINFO_UMFPACK}|" \ - -e "s|%TEXINFO_QHULL%|${TEXINFO_QHULL}|" > $@-t + -e "s|%OCTAVE_VERSION%|${version}|" > $@-t $(simple_move_if_change_rule) ../BUGS ../INSTALL.OCTAVE: diff --git a/doc/conf.texi.in b/doc/conf.texi.in --- a/doc/conf.texi.in +++ b/doc/conf.texi.in @@ -17,11 +17,4 @@ @c . @set OCTAVE_MANUAL -@set top_srcdir %top_srcdir% -@set abs_top_srcdir %abs_top_srcdir% -@set OCTAVEHOME %OCTAVE_HOME% @set VERSION %OCTAVE_VERSION% -%TEXINFO_COLAMD% -%TEXINFO_CHOLMOD% -%TEXINFO_UMFPACK% -%TEXINFO_QHULL% diff --git a/doc/interpreter/Makefile.am b/doc/interpreter/Makefile.am --- a/doc/interpreter/Makefile.am +++ b/doc/interpreter/Makefile.am @@ -84,73 +84,71 @@ IMAGES = $(IMAGES_EPS) $(IMAGES_PDF) $(IMAGES_PNG) $(IMAGES_TXT) -TXI_SRC = \ - arith.txi \ - audio.txi \ - basics.txi \ - bugs.txi \ - container.txi \ - contrib.txi \ - cp-idx.txi \ - data.txi \ - debug.txi \ - diffeq.txi \ - diagperm.txi \ - dynamic.txi \ - emacs.txi \ - errors.txi \ - eval.txi \ - expr.txi \ - fn-idx.txi \ - func.txi \ - geometry.txi \ - gpl.txi \ - grammar.txi \ - image.txi \ - install.txi \ - interp.txi \ - intro.txi \ - io.txi \ - linalg.txi \ - matrix.txi \ - nonlin.txi \ - numbers.txi \ - oop.txi \ - op-idx.txi \ - optim.txi \ - package.txi \ - plot.txi \ - poly.txi \ - preface.txi \ - quad.txi \ - set.txi \ - signal.txi \ - sparse.txi \ - stats.txi \ - stmt.txi \ - strings.txi \ - system.txi \ - testfun.txi \ - tips.txi \ - var.txi +MUNGED_TEXI_SRC = \ + arith.texi \ + audio.texi \ + basics.texi \ + bugs.texi \ + container.texi \ + contrib.texi \ + cp-idx.texi \ + data.texi \ + debug.texi \ + diffeq.texi \ + diagperm.texi \ + dynamic.texi \ + emacs.texi \ + errors.texi \ + eval.texi \ + expr.texi \ + fn-idx.texi \ + func.texi \ + geometry.texi \ + gpl.texi \ + grammar.texi \ + image.texi \ + install.texi \ + interp.texi \ + intro.texi \ + io.texi \ + linalg.texi \ + matrix.texi \ + nonlin.texi \ + numbers.texi \ + oop.texi \ + op-idx.texi \ + optim.texi \ + package.texi \ + plot.texi \ + poly.texi \ + preface.texi \ + quad.texi \ + set.texi \ + signal.texi \ + sparse.texi \ + stats.texi \ + stmt.texi \ + strings.texi \ + system.texi \ + testfun.texi \ + tips.texi \ + var.texi -MUNGED_TEXI_SRC = $(TXI_SRC:.txi=.texi) +TXI_SRC = $(MUNGED_TEXI_SRC:.texi=.txi) info_TEXINFOS = octave.texi -nodist_octave_TEXINFOS = \ - ../conf.texi - octave_TEXINFOS = \ + ../conf.texi \ contributors.texi \ $(MUNGED_TEXI_SRC) ../conf.texi: $(MAKE) -C .. conf.texi -octave.info octave.dvi octave.pdf octave.html: $(nodist_octave_TEXINFOS) $(octave_TEXINFOS) $(EXAMPLE_FILES) +$(srcdir)/octave.info octave.dvi octave.pdf octave.html: $(octave_TEXINFOS) $(octave_TEXINFOS) $(EXAMPLE_FILES) -octave.info: $(IMAGES_TXT) +$(srcdir)/octave.info: $(IMAGES_TXT) octave.dvi octave.ps: $(IMAGES_EPS) @@ -158,7 +156,6 @@ octave.html: $(IMAGES_PNG) - all-local: dvi html pdf ps doc-cache # Install doc-cache of help files @@ -169,13 +166,7 @@ uninstall-local: rm -f $(DESTDIR)$(octetcdir)/doc-cache -DOCSTRING_FILES = $(TOPDIR)/src/DOCSTRINGS $(TOPDIR)/scripts/DOCSTRINGS - -$(TOPDIR)/src/DOCSTRINGS: - $(MAKE) -C $(TOPDIR)/src DOCSTRINGS - -$(TOPDIR)/scripts/DOCSTRINGS: - $(MAKE) -C $(TOPDIR)/scripts DOCSTRINGS +DOCSTRING_FILES = $(shell $(srcdir)/find-docstring-files.sh "$(top_srcdir)") doc-cache: $(DOCSTRING_FILES) mk_doc_cache.m $(TOPDIR)/run-octave -f -q -H $(srcdir)/mk_doc_cache.m doc-cache $(DOCSTRING_FILES) || { rm -f doc-cache; exit 1; } @@ -186,7 +177,7 @@ $(BUILD_CXX) $(BUILD_CXXFLAGS) -o $@ $^ $(BUILD_LDFLAGS) .txi.texi: - ./munge-texi $(DOCSTRING_FILES) < $< > $@-t + ./munge-texi $(top_srcdir) $(DOCSTRING_FILES) < $< > $@-t mv $@-t $@ contributors.texi: contributors.in @@ -210,6 +201,7 @@ EXTRA_DIST = \ config-images.sh \ contributors.in \ + find-docstring-files.sh \ images \ images.mk \ mk_doc_cache.m \ @@ -223,15 +215,4 @@ MAINTAINERCLEANFILES = $(IMAGES) -## .texi files are generated files, not primary sources, and should not -## be distributed. Automake, however, does not create rules to generate -## pdf and html documentation unless the info and texi files will be -## distributed. Various hacks, including using the nodist_ prefix and -## DISTCLEANFILES, do not work. The current solution is to build the texi -## files and create the correct Makefile rules and then use the dist-hook -## feature to remove the .texi files from the distribution just before it -## is archived in a tar file. -dist-hook: - ( cd $(distdir) ; rm -f $(octave_TEXINFOS) ; ) - -.NOTPARALLEL: +.NOPARALLEL: diff --git a/doc/interpreter/basics.txi b/doc/interpreter/basics.txi --- a/doc/interpreter/basics.txi +++ b/doc/interpreter/basics.txi @@ -294,7 +294,7 @@ @item @var{octave-home}/share/octave/site/m/startup/octaverc @cindex site startup file where @var{octave-home} is the directory in which Octave is installed -(the default is @file{@value{OCTAVEHOME}}). +(the default is @file{/usr/local}). This file is provided so that changes to the default Octave environment can be made globally for all users at your site for all versions of Octave you have installed. Care should be taken when making changes to this file @@ -304,7 +304,7 @@ @item @var{octave-home}/share/octave/@var{version}/m/startup/octaverc @cindex version startup file where @var{octave-home} is the directory in which Octave is -installed (the default is @file{@value{OCTAVEHOME}}), and @var{version} +installed (the default is @file{/usr/local}), and @var{version} is the version number of Octave. This file is provided so that changes to the default Octave environment can be made globally for all users of a particular version of Octave. Care should be taken when making diff --git a/doc/interpreter/dynamic.txi b/doc/interpreter/dynamic.txi --- a/doc/interpreter/dynamic.txi +++ b/doc/interpreter/dynamic.txi @@ -17,20 +17,6 @@ @c along with Octave; see the file COPYING. If not, see @c . -@macro examplefile{file} -@example -@group -@verbatiminclude @value{abs_top_srcdir}/examples/\file\ -@end group -@end example -@end macro - -@macro longexamplefile{file} -@example -@verbatiminclude @value{abs_top_srcdir}/examples/\file\ -@end example -@end macro - @node Dynamically Linked Functions @appendix Dynamically Linked Functions @cindex dynamic-linking @@ -112,7 +98,11 @@ Consider the short example -@examplefile{helloworld.cc} +@example +@group +@EXAMPLEFILE(helloworld.cc) +@end group +@end example This example although short introduces the basics of writing a C++ function that can be dynamically linked to Octave. The easiest way to @@ -294,7 +284,11 @@ The typical way to extract a matrix or array from the input arguments of @w{@code{DEFUN_DLD}} function is as follows -@examplefile{addtwomatrices.cc} +@example +@group +@EXAMPLEFILE(addtwomatrices.cc) +@end group +@end example To avoid segmentation faults causing Octave to abort, this function explicitly checks that there are sufficient arguments available before @@ -353,7 +347,9 @@ In Octave a character string is just a special @code{Array} class. Consider the example -@longexamplefile{stringdemo.cc} +@example +@EXAMPLEFILE(stringdemo.cc) +@end example An example of the use of this function is @@ -414,7 +410,11 @@ array can then be treated just like any other @code{octave_value}. A simple example is -@examplefile{celldemo.cc} +@example +@group +@EXAMPLEFILE(celldemo.cc) +@end group +@end example Note that cell arrays are used less often in standard oct-files and so the @file{Cell.h} header file must be explicitly included. The rest of this @@ -444,7 +444,9 @@ A simple example demonstrating the use of structures within oct-files is -@longexamplefile{structdemo.cc} +@example +@EXAMPLEFILE(structdemo.cc) +@end example An example of its use is @@ -822,7 +824,9 @@ that no global variable of the desired name is found. An example of the use of these two functions is -@longexamplefile{globaldemo.cc} +@example +@EXAMPLEFILE(globaldemo.cc) +@end example An example of its use is @@ -861,7 +865,9 @@ The example below demonstrates an example that accepts all four means of passing a function to an oct-file. -@longexamplefile{funcdemo.cc} +@example +@EXAMPLEFILE(funcdemo.cc) +@end example The first argument to this demonstration is the user supplied function and the following arguments are all passed to the user function. @@ -956,12 +962,16 @@ An example of the inclusion of a Fortran function in an oct-file is given in the following example, where the C++ wrapper is -@longexamplefile{fortdemo.cc} +@example +@EXAMPLEFILE(fortdemo.cc) +@end example @noindent and the fortran function is -@longexamplefile{fortsub.f} +@example +@EXAMPLEFILE(fortsub.f) +@end example This example demonstrates most of the features needed to link to an external Fortran function, including passing arrays and strings, as well @@ -1018,7 +1028,9 @@ more specialized functions. Some of the more common ones are demonstrated in the following example -@longexamplefile{paramdemo.cc} +@example +@EXAMPLEFILE(paramdemo.cc) +@end example @noindent and an example of its use is @@ -1087,7 +1099,9 @@ to allow variables, etc. to be restored even if an exception occurs. An example of the use of this mechanism is -@longexamplefile{unwinddemo.cc} +@example +@EXAMPLEFILE(unwinddemo.cc) +@end example As can be seen in the example @@ -1216,7 +1230,11 @@ Consider the short example -@examplefile{firstmexdemo.c} +@example +@group +@EXAMPLEFILE(firstmexdemo.c) +@end group +@end example This simple example demonstrates the basics of writing a mex-file. The entry point into the mex-file is defined by @code{mexFunction}. Note @@ -1261,7 +1279,11 @@ the mex-file was called with. This can be used to alter the behavior of the mex-file based on the function name. For example if -@examplefile{myfunc.c} +@example +@group +@EXAMPLEFILE(myfunc.c) +@end group +@end example @noindent is in file @file{myfunc.c}, and it is compiled with @@ -1347,7 +1369,9 @@ double precision arrays is given by the file @file{mypow2.c} as given below. -@longexamplefile{mypow2.c} +@example +@EXAMPLEFILE(mypow2.c) +@end example @noindent with an example of its use @@ -1376,7 +1400,9 @@ use, that parallels the demo in @file{stringdemo.cc}, is given in the file @file{mystring.c}, as seen below. -@longexamplefile{mystring.c} +@example +@EXAMPLEFILE(mystring.c) +@end example @noindent An example of its expected output is @@ -1404,7 +1430,11 @@ the @file{celldemo.cc} oct-file in a mex-file is given by @file{mycell.c} as below -@examplefile{mycell.c} +@example +@group +@EXAMPLEFILE(mycell.c) +@end group +@end example @noindent which as can be seen below has exactly the same behavior as the oct-file @@ -1485,7 +1515,9 @@ An example that demonstrates the use of structures in mex-file can be found in the file @file{mystruct.c}, as seen below -@longexamplefile{mystruct.c} +@example +@EXAMPLEFILE(mystruct.c) +@end example An example of the behavior of this function within Octave is then @@ -1574,7 +1606,9 @@ @code{mxGetIr}. A complete example of the use of sparse matrices in mex-files is given by the file @file{mysparse.c} as seen below -@longexamplefile{mysparse.c} +@example +@EXAMPLEFILE(mysparse.c) +@end example @node Calling Other Functions in Mex-Files @subsection Calling Other Functions in Mex-Files @@ -1583,7 +1617,9 @@ using @code{mexCallMATLAB}. An example of the use of @code{mexCallMATLAB} can be see in the example below -@longexamplefile{myfeval.c} +@example +@EXAMPLEFILE(myfeval.c) +@end example If this code is in the file @file{myfeval.c}, and is compiled to @file{myfeval.mex}, then an example of its use is @@ -1616,7 +1652,11 @@ following C++ program, uses class Matrix from liboctave.a or liboctave.so. -@examplefile{standalone.cc} +@example +@group +@EXAMPLEFILE(standalone.cc) +@end group +@end example @noindent mkoctfile can then be used to build a standalone application with a @@ -1641,7 +1681,11 @@ needs to be initialized first. An example of how to do this can then be seen in the code -@examplefile{embedded.cc} +@example +@group +@EXAMPLEFILE(embedded.cc) +@end group +@end example @noindent which is compiled and run as before as a standalone application with diff --git a/doc/interpreter/find-docstring-files.sh b/doc/interpreter/find-docstring-files.sh new file mode 100755 --- /dev/null +++ b/doc/interpreter/find-docstring-files.sh @@ -0,0 +1,22 @@ +#! /bin/sh + +if [ $# -ne 1 ]; then + echo "usage: find-docstring-files TOP-SRCDIR" 1>&2 + exit 1 +fi + +## if there is a file in teh build directory tree, assume it is +## the file we are looking for. Otherwise, get the one from the +## source tree. + +if [ -f "../../scripts/DOCSTRINGS" ]; then + echo "../../scripts/DOCSTRINGS" +else + echo "$1/scripts/DOCSTRINGS" +fi + +if [ -f "../../src/DOCSTRINGS" ]; then + echo "../../src/DOCSTRINGS" +else + echo "$1/src/DOCSTRINGS" +fi diff --git a/doc/interpreter/geometry.txi b/doc/interpreter/geometry.txi --- a/doc/interpreter/geometry.txi +++ b/doc/interpreter/geometry.txi @@ -76,7 +76,6 @@ @end group @end example -@ifset HAVE_QHULL @ifnotinfo @noindent The result of which can be seen in @ref{fig:delaunay}. @@ -86,7 +85,6 @@ @caption{Delaunay triangulation of a random set of points} @end float @end ifnotinfo -@end ifset @menu * Plotting the Triangulation:: @@ -305,7 +303,6 @@ @end group @end example -@ifset HAVE_QHULL @ifnotinfo @noindent The result of which can be seen in @ref{fig:voronoi}. Note that the @@ -318,7 +315,6 @@ @caption{Delaunay triangulation and Voronoi diagram of a random set of points} @end float @end ifnotinfo -@end ifset Additional information about the size of the facets of a Voronoi diagram, and which points of a set of points is in a polygon can be had @@ -399,7 +395,6 @@ @end group @end example -@ifset HAVE_QHULL @ifnotinfo @noindent The output of the above can be seen in @ref{fig:convhull}. @@ -409,7 +404,6 @@ @caption{The convex hull of a simple set of points} @end float @end ifnotinfo -@end ifset @node Interpolation on Scattered Data @section Interpolation on Scattered Data @@ -443,7 +437,6 @@ @end group @end example -@ifset HAVE_QHULL @noindent that interpolates from a random scattering of points, to a uniform grid. @@ -455,4 +448,3 @@ @caption{Interpolation from a scattered data to a regular grid} @end float @end ifnotinfo -@end ifset diff --git a/doc/interpreter/munge-texi.cc b/doc/interpreter/munge-texi.cc --- a/doc/interpreter/munge-texi.cc +++ b/doc/interpreter/munge-texi.cc @@ -33,6 +33,8 @@ #include #include +static std::string top_srcdir; + static const char doc_delim = ''; static std::map help_text; @@ -47,7 +49,7 @@ static void usage (void) { - std::cerr << "usage: munge-texi DOCSTRING-FILE file ...\n"; + std::cerr << "usage: munge-texi TOP-SRCDIR DOCSTRING-FILE < file\n"; exit (1); } @@ -208,6 +210,47 @@ fatal ("unable to open docfile"); } +static bool +recover_from_macro (std::ostream& os, char *buf, int i) +{ + bool bol = false; + + buf[i] = '\0'; + os << buf; + + if (buf[i - 1] == '\n') + bol = true; + + return bol; +} + +static void +process_example_file (const std::string& file_name, std::ostream& os) +{ + std::ifstream infile (file_name.c_str ()); + + if (infile) + { + os << "@verbatim\n"; + + int c; + int clast = 0; + + while ((c = infile.get ()) != EOF) + { + os << (char) c; + clast = c; + } + + if (clast != '\n') + os << "\n"; + + os << "@end verbatim\n"; + } + else + fatal ("unable to open example file " + file_name); +} + static void process_texi_input_file (std::istream& is, std::ostream& os) { @@ -222,82 +265,108 @@ { if (c == '@') { - std::string symbol_name; - char buf[16]; int i = 0; buf[i++] = (char) c; - if (( buf[i++] = (char) is.get ()) == 'D' - && (buf[i++] = (char) is.get ()) == 'O' - && (buf[i++] = (char) is.get ()) == 'C' - && (buf[i++] = (char) is.get ()) == 'S' - && (buf[i++] = (char) is.get ()) == 'T' - && (buf[i++] = (char) is.get ()) == 'R' - && (buf[i++] = (char) is.get ()) == 'I' - && (buf[i++] = (char) is.get ()) == 'N' - && (buf[i++] = (char) is.get ()) == 'G' - && (buf[i++] = (char) is.get ()) == '(') + buf[i++] = c = (char) is.get (); + + if (c == 'D') { - while ((c = is.get ()) != EOF && c != ')') - symbol_name += (char) c; + std::string symbol_name; - if (is.eof ()) - fatal ("end of file while reading @DOCSTRING command"); - else + if ( (buf[i++] = (char) is.get ()) == 'O' + && (buf[i++] = (char) is.get ()) == 'C' + && (buf[i++] = (char) is.get ()) == 'S' + && (buf[i++] = (char) is.get ()) == 'T' + && (buf[i++] = (char) is.get ()) == 'R' + && (buf[i++] = (char) is.get ()) == 'I' + && (buf[i++] = (char) is.get ()) == 'N' + && (buf[i++] = (char) is.get ()) == 'G' + && (buf[i++] = (char) is.get ()) == '(') { - std::string doc_string = help_text[symbol_name]; - - size_t len = doc_string.length (); + while ((c = is.get ()) != EOF && c != ')') + symbol_name += (char) c; - int j = 0; + if (is.eof ()) + fatal ("end of file while reading @DOCSTRING command"); + else + { + std::string doc_string = help_text[symbol_name]; - // If there is a leading comment with the file - // name, copy it to the output. - if (len > 1 - && doc_string[j] == '@' - && doc_string[j+1] == 'c') - { - j = 2; - while (doc_string[j++] != '\n') - /* find eol */; + size_t len = doc_string.length (); + + int j = 0; - os << doc_string.substr (0, j); - } - - while (doc_string[j] == ' ') - j++; + // If there is a leading comment with the file + // name, copy it to the output. + if (len > 1 + && doc_string[j] == '@' + && doc_string[j+1] == 'c') + { + j = 2; + while (doc_string[j++] != '\n') + /* find eol */; - if (doc_string.substr (j, 15) == "-*- texinfo -*-") - { - j += 15; + os << doc_string.substr (0, j); + } - while (isspace (doc_string[j])) + while (doc_string[j] == ' ') j++; - // Make `see also' references in functions - // possible using @anchor{TAG} (new with - // Texinfo 4.0). + if (doc_string.substr (j, 15) == "-*- texinfo -*-") + { + j += 15; + + while (isspace (doc_string[j])) + j++; - if (symbol_name[0] == '@') - symbol_name = "@" + symbol_name; + // Make `see also' references in functions + // possible using @anchor{TAG} (new with + // Texinfo 4.0). + + if (symbol_name[0] == '@') + symbol_name = "@" + symbol_name; + + os << "@anchor{doc-" << symbol_name << "}\n"; - os << "@anchor{doc-" << symbol_name << "}\n"; - - os << doc_string.substr (j); + os << doc_string.substr (j); + } + else + os << doc_string; } - else - os << doc_string; } + else + bol = recover_from_macro (os, buf, i); + } + else if (c == 'E') + { + std::string file_name; + + if ( (buf[i++] = (char) is.get ()) == 'X' + && (buf[i++] = (char) is.get ()) == 'A' + && (buf[i++] = (char) is.get ()) == 'M' + && (buf[i++] = (char) is.get ()) == 'P' + && (buf[i++] = (char) is.get ()) == 'L' + && (buf[i++] = (char) is.get ()) == 'E' + && (buf[i++] = (char) is.get ()) == 'F' + && (buf[i++] = (char) is.get ()) == 'I' + && (buf[i++] = (char) is.get ()) == 'L' + && (buf[i++] = (char) is.get ()) == 'E' + && (buf[i++] = (char) is.get ()) == '(') + { + while ((c = is.get ()) != EOF && c != ')') + file_name += (char) c; + + file_name = top_srcdir + "/examples/" + file_name; + + process_example_file (file_name, os); + } + else + bol = recover_from_macro (os, buf, i); } else - { - buf[i] = '\0'; - os << buf; - - if (buf[i - 1] == '\n') - bol = true; - } + bol = recover_from_macro (os, buf, i); } else os.put ((char) c); @@ -315,6 +384,8 @@ int main (int argc, char **argv) { + top_srcdir = *++argv; + while (*++argv) process_doc_file (*argv); diff --git a/doc/interpreter/oop.txi b/doc/interpreter/oop.txi --- a/doc/interpreter/oop.txi +++ b/doc/interpreter/oop.txi @@ -21,18 +21,6 @@ @c For now can't include "@" character in the path name, and so name @c the example directory without the "@"!! -@macro classfile{class, file} -@example -@group -@verbatiminclude @value{abs_top_srcdir}/examples/\class\/\file\ -@end group -@end example -@end macro - -@macro polynomialfile{file} -@classfile{@@polynomial,\file\} -@end macro - @node Object Oriented Programming @chapter Object Oriented Programming @@ -105,7 +93,11 @@ called with no arguments to should return a value object. So for example our polynomial might look like -@polynomialfile{polynomial.m} +@example +@group +@EXAMPLEFILE(@polynomial/polynomial.m) +@end group +@end example Note that the return value of the constructor must be the output of the @code{class} function called with the first argument being a @@ -184,7 +176,11 @@ @noindent An example of a display method for the polynomial class might be -@polynomialfile{display.m} +@example +@group +@EXAMPLEFILE(@polynomial/display.m) +@end group +@end example @noindent Note that in the display method, it makes sense to start the method @@ -198,13 +194,21 @@ argument of the appropriate class it should return a structure with all of the properties of the class. For example -@polynomialfile{get.m} +@example +@group +@EXAMPLEFILE(@polynomial/get.m) +@end group +@end example @noindent Similarly, the @code{set} method should taken as its first argument an object to modify, and then take property/value pairs to be modified. -@polynomialfile{set.m} +@example +@group +@EXAMPLEFILE(@polynomial/set.m) +@end group +@end example @noindent Note that as Octave does not implement pass by reference, than the @@ -276,7 +280,11 @@ polynomial and indexing with "@{@}" returns the @var{n}-th coefficient (of @var{n}-th power). In this case the @code{subsref} method of our polynomial class might look like -@polynomialfile{subsref.m} +@example +@group +@EXAMPLEFILE(@polynomial/subsref.m) +@end group +@end example The equivalent functionality for subscripted assignments uses the @code{subsasgn} method. @@ -296,7 +304,11 @@ For example the @code{end} method for our polynomial class might look like -@polynomialfile{end.m} +@example +@group +@EXAMPLEFILE(@polynomial/end.m) +@end group +@end example @noindent which is a fairly generic @code{end} method that has a behavior similar to @@ -413,13 +425,21 @@ for our polynomial class might be to overload the @code{polyval} function like -@polynomialfile{polyval.m} +@example +@group +@EXAMPLEFILE(@polynomial/polyval.m) +@end group +@end example This function just hands off the work to the normal Octave @code{polyval} function. Another interesting example for an overloaded function for our polynomial class is the @code{plot} function. -@polynomialfile{plot.m} +@example +@group +@EXAMPLEFILE(@polynomial/plot.m) +@end group +@end example @noindent which allows polynomials to be plotted in the domain near the region @@ -431,7 +451,11 @@ in the use of methods of other classes with the user class. An example @code{double} function for our polynomial class might look like. -@polynomialfile{double.m} +@example +@group +@EXAMPLEFILE(@polynomial/double.m) +@end group +@end example @node Operator Overloading @subsection Operator Overloading @@ -530,7 +554,11 @@ An example @code{mtimes} method for our polynomial class might look like -@polynomialfile{mtimes.m} +@example +@group +@EXAMPLEFILE(@polynomial/mtimes.m) +@end group +@end example @node Precedence of Objects @subsection Precedence of Objects @@ -559,7 +587,11 @@ @code{superiorto} function in the class constructor. In particular our polynomial class constructor would be modified to be -@polynomialfile{polynomial_superiorto.m} +@example +@group +@EXAMPLEFILE(@polynomial/polynomial_superiorto.m) +@end group +@end example Note that user classes always have higher precedence than built-in Octave types. So in fact marking our polynomial class higher than the @@ -598,7 +630,11 @@ @@FIRfilter that is on the octave path. The constructor is a file FIRfilter.m in the class directory. -@classfile{@@FIRfilter,FIRfilter.m} +@example +@group +@EXAMPLEFILE(@FIRfilter/FIRfilter.m) +@end group +@end example As before, the leading comments provide command-line documentation for the class constructor. This constructor is very similar to the @@ -623,7 +659,11 @@ As before, we need a @code{display} method. A simple example might be -@classfile{@@FIRfilter,display.m} +@example +@group +@EXAMPLEFILE(@FIRfilter/display.m) +@end group +@end example Note that we have used the polynomial field of the struct to display the filter coefficients. @@ -656,7 +696,11 @@ underlying struct are private by default, we could provide a mechanism to access the fields. The @code{subsref} method may be used for both. -@classfile{@@FIRfilter,subsref.m} +@example +@group +@EXAMPLEFILE(@FIRfilter/subsref.m) +@end group +@end example The "()" case allows us to filter data using the polynomial provided to the constructor. @@ -690,7 +734,11 @@ @code{subsasgn} method. For example, we may make the polynomial field publicly writeable. -@classfile{@@FIRfilter,subsasgn.m} +@example +@group +@EXAMPLEFILE(@FIRfilter/subsasgn.m) +@end group +@end example So that @@ -710,6 +758,10 @@ polynomial is simply a field in the class structure. A class constructor for this case might be -@classfile{@@FIRfilter,FIRfilter_aggregation.m} +@example +@group +@EXAMPLEFILE(@FIRfilter/FIRfilter_aggregation.m) +@end group +@end example For our example, the remaining class methods remain unchanged. diff --git a/doc/interpreter/sparse.txi b/doc/interpreter/sparse.txi --- a/doc/interpreter/sparse.txi +++ b/doc/interpreter/sparse.txi @@ -658,11 +658,7 @@ obtained by the same command that would be used for a full matrix. This can be visualized with the command @code{r = chol(A); spy(r);}. -@ifset HAVE_CHOLMOD -@ifset HAVE_COLAMD @xref{fig:simplechol}. -@end ifset -@end ifset The original matrix had @ifinfo @ifnothtml @@ -705,8 +701,6 @@ factorization, In that case this might be obtained with three return arguments as r@code{[r, p, q] = chol(A); spy(r)}. -@ifset HAVE_CHOLMOD -@ifset HAVE_COLAMD @float Figure,fig:simplechol @center @image{spchol,4in} @caption{Structure of the un-permuted Cholesky factorization of the above matrix.} @@ -716,8 +710,6 @@ @center @image{spcholperm,4in} @caption{Structure of the permuted Cholesky factorization of the above matrix.} @end float -@end ifset -@end ifset In the case of an asymmetric matrix, the appropriate sparsity preserving permutation is @dfn{colamd} and the factorization using @@ -1100,14 +1092,8 @@ Finally, in order to display the solution, we show each solved voltage value in the z-axis for each simplex vertex. @ifset htmltex -@ifset HAVE_CHOLMOD -@ifset HAVE_UMFPACK -@ifset HAVE_COLAMD @xref{fig:femmodel}. @end ifset -@end ifset -@end ifset -@end ifset @example @group @@ -1122,15 +1108,9 @@ @ifset htmltex -@ifset HAVE_CHOLMOD -@ifset HAVE_UMFPACK -@ifset HAVE_COLAMD @float Figure,fig:femmodel @center @image{grid,4in} @caption{Example finite element model the showing triangular elements. The height of each vertex corresponds to the solution value.} @end float @end ifset -@end ifset -@end ifset -@end ifset diff --git a/doc/liboctave/Makefile.am b/doc/liboctave/Makefile.am --- a/doc/liboctave/Makefile.am +++ b/doc/liboctave/Makefile.am @@ -33,10 +33,8 @@ info_TEXINFOS = liboctave.texi -nodist_liboctave_TEXINFOS = \ - ../conf.texi - dist_liboctave_TEXINFOS = \ + ../conf.texi \ array.texi \ bugs.texi \ cp-idx.texi \ diff --git a/examples/Makefile.am b/examples/Makefile.am --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -68,6 +68,8 @@ EXTRA_DIST += $(FCN_FILES) +CLEANFILES = octave.desktop + all-local: octave.desktop octave.desktop: octave.desktop.in Makefile diff --git a/libcruft/ChangeLog b/libcruft/ChangeLog --- a/libcruft/ChangeLog +++ b/libcruft/ChangeLog @@ -1,3 +1,7 @@ +2009-12-03 John W. Eaton + + * Makefile.am (DISTCLEANFILES): New variable. + 2009-11-26 Jaroslav Hajek * blas-xtra/sdot3.f: Use nested cache-aligned loop for general case. diff --git a/libcruft/Makefile.am b/libcruft/Makefile.am --- a/libcruft/Makefile.am +++ b/libcruft/Makefile.am @@ -40,6 +40,8 @@ octinclude_HEADERS = +DISTCLEANFILES = cruft.def + EXTRA_DIST = ChangeLog STOP.patch mkf77def.in include amos/module.mk diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,7 @@ +2009-12-03 John W. Eaton + + * Makefile.am (BUILT_NODISTFILES): New variable. + 2009-12-01 Jaroslav Hajek * idx-vector.cc (idx_vector::idx_range_rep::unconvert, diff --git a/liboctave/Makefile.am b/liboctave/Makefile.am --- a/liboctave/Makefile.am +++ b/liboctave/Makefile.am @@ -273,6 +273,11 @@ BUILT_SOURCES = $(BUILT_INCS) +## FIXME -- These files don't need to be distributed. They do need +## to be installed. So we need to add them to a list somewhere so +## that happens correctly. +BUILT_NODISTFILES = $(BUILT_INCS) + TEMPLATE_SRC = \ Array.cc \ DiagArray2.cc \ diff --git a/scripts/@ftp/module.mk b/scripts/@ftp/module.mk --- a/scripts/@ftp/module.mk +++ b/scripts/@ftp/module.mk @@ -20,3 +20,5 @@ FCN_FILES += $(@ftp_FCN_FILES) PKG_ADD_FILES += @ftp/PKG_ADD + +DIRSTAMP_FILES += @ftp/$(octave_dirstamp) diff --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,28 @@ +2009-12-03 John W. Eaton + + * audio/wavwrite.m: Delete generated a.wav file after each test. + + * Makefile.am (DIRSTAMP_FILES, DISTCLEANFILES): New variables. + (DOCSTRINGS): Also depend on $(FCN_FILES_IN). Pass + $(FCN_FILES_IN) to mkdoc instead of $(GEN_FCN_FILES). Tell mkdoc + to look for $(FCN_FILES_IN) files in $(srcdir), not build + directory. + (DISTCLEANFILES): New variable. + Don't silence dirstamp, DOCSTRINGS, $(GEN_FCN_FILES), and PKG_ADD + rules. + + * audio/module.mk, deprecated/module.mk, elfun/module.mk, + help/module.mk, general/module.mk, geometry/module.mk, + image/module.mk, io/module.mk, linear-algebra/module.mk, + miscellaneous/module.mk, @ftp/module.mk, optimization/module.mk, + path/module.mk, pkg/module.mk, plot/module.mk, + polynomial/module.mk, set/module.mk, signal/module.mk, + sparse/module.mk, specfun/module.mk, special-matrix/module.mk, + startup/module.mk, statistics/base/module.mk, + statistics/distributions/module.mk, statistics/models/module.mk, + statistics/tests/module.mk, strings/module.mk, testfun/module.mk, + time/module.mk: Append to DIRSTAMP_FILES. + 2009-12-02 Rik * image/imread.m: Run test case only if underlying GraphicMagick library diff --git a/scripts/Makefile.am b/scripts/Makefile.am --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -38,6 +38,8 @@ PKG_ADD_FILES = +DIRSTAMP_FILES = + IMAGES = include @ftp/module.mk @@ -70,154 +72,131 @@ include testfun/module.mk include time/module.mk +DISTCLEANFILES = \ + gethelp$(BUILD_EXEEXT) \ + $(PKG_ADD_FILES) \ + $(DIRSTAMP_FILES) \ + $(GEN_FCN_FILES) + nobase_fcnfile_DATA = $(FCN_FILES) $(GEN_FCN_FILES) octave_dirstamp = $(am__leading_dot)dirstamp @ftp/PKG_ADD: $(@ftp_FCN_FILES) $(@ftp_GEN_FCN_FILES) @ftp/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(@ftp_FCN_FILES) -- $(@ftp_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(@ftp_FCN_FILES) -- $(@ftp_GEN_FCN_FILES) > $@-t + mv $@-t $@ audio/PKG_ADD: $(audio_FCN_FILES) $(audio_GEN_FCN_FILES) audio/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(audio_FCN_FILES) -- $(audio_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(audio_FCN_FILES) -- $(audio_GEN_FCN_FILES) > $@-t + mv $@-t $@ deprecated/PKG_ADD: $(deprecated_FCN_FILES) $(deprecated_GEN_FCN_FILES) deprecated/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(deprecated_FCN_FILES) -- $(deprecated_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(deprecated_FCN_FILES) -- $(deprecated_GEN_FCN_FILES) > $@-t + mv $@-t $@ elfun/PKG_ADD: $(elfun_FCN_FILES) $(elfun_GEN_FCN_FILES) elfun/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(elfun_FCN_FILES) -- $(elfun_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(elfun_FCN_FILES) -- $(elfun_GEN_FCN_FILES) > $@-t + mv $@-t $@ general/PKG_ADD: $(general_FCN_FILES) $(general_GEN_FCN_FILES) general/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(general_FCN_FILES) -- $(general_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(general_FCN_FILES) -- $(general_GEN_FCN_FILES) > $@-t + mv $@-t $@ geometry/PKG_ADD: $(geometry_FCN_FILES) $(geometry_GEN_FCN_FILES) geometry/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(geometry_FCN_FILES) -- $(geometry_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(geometry_FCN_FILES) -- $(geometry_GEN_FCN_FILES) > $@-t + mv $@-t $@ help/PKG_ADD: $(help_FCN_FILES) $(help_GEN_FCN_FILES) help/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(help_FCN_FILES) -- $(help_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(help_FCN_FILES) -- $(help_GEN_FCN_FILES) > $@-t + mv $@-t $@ image/PKG_ADD: $(image_FCN_FILES) $(image_GEN_FCN_FILES) image/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(image_FCN_FILES) -- $(image_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(image_FCN_FILES) -- $(image_GEN_FCN_FILES) > $@-t + mv $@-t $@ io/PKG_ADD: $(io_FCN_FILES) $(io_GEN_FCN_FILES) io/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(io_FCN_FILES) -- $(io_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(io_FCN_FILES) -- $(io_GEN_FCN_FILES) > $@-t + mv $@-t $@ linear-algebra/PKG_ADD: $(linear_algebra_FCN_FILES) $(linear_algebra_GEN_FCN_FILES) linear-algebra/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(linear_algebra_FCN_FILES) -- $(linear_algebra_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(linear_algebra_FCN_FILES) -- $(linear_algebra_GEN_FCN_FILES) > $@-t + mv $@-t $@ miscellaneous/PKG_ADD: $(miscellaneous_FCN_FILES) $(miscellaneous_GEN_FCN_FILES) miscellaneous/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(miscellaneous_FCN_FILES) -- $(miscellaneous_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(miscellaneous_FCN_FILES) -- $(miscellaneous_GEN_FCN_FILES) > $@-t + mv $@-t $@ optimization/PKG_ADD: $(optimization_FCN_FILES) $(optimization_GEN_FCN_FILES) optimization/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add "$(srcdir)" $(optimization_FCN_FILES) -- $(optimization_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add "$(srcdir)" $(optimization_FCN_FILES) -- $(optimization_GEN_FCN_FILES) > $@-t + mv $@-t $@ path/PKG_ADD: $(path_FCN_FILES) $(path_GEN_FCN_FILES) path/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(path_FCN_FILES) -- $(path_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(path_FCN_FILES) -- $(path_GEN_FCN_FILES) > $@-t + mv $@-t $@ pkg/PKG_ADD: $(pkg_FCN_FILES) $(pkg_GEN_FCN_FILES) pkg/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(pkg_FCN_FILES) -- $(pkg_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(pkg_FCN_FILES) -- $(pkg_GEN_FCN_FILES) > $@-t + mv $@-t $@ plot/PKG_ADD: $(plot_FCN_FILES) $(plot_GEN_FCN_FILES) plot/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(plot_FCN_FILES) -- $(plot_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(plot_FCN_FILES) -- $(plot_GEN_FCN_FILES) > $@-t + mv $@-t $@ polynomial/PKG_ADD: $(polynomial_FCN_FILES) $(polynomial_GEN_FCN_FILES) polynomial/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(polynomial_FCN_FILES) -- $(polynomial_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(polynomial_FCN_FILES) -- $(polynomial_GEN_FCN_FILES) > $@-t + mv $@-t $@ set/PKG_ADD: $(set_FCN_FILES) $(set_GEN_FCN_FILES) set/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(set_FCN_FILES) -- $(set_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(set_FCN_FILES) -- $(set_GEN_FCN_FILES) > $@-t + mv $@-t $@ signal/PKG_ADD: $(signal_FCN_FILES) $(signal_GEN_FCN_FILES) signal/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(signal_FCN_FILES) -- $(signal_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(signal_FCN_FILES) -- $(signal_GEN_FCN_FILES) > $@-t + mv $@-t $@ sparse/PKG_ADD: $(sparse_FCN_FILES) $(sparse_GEN_FCN_FILES) sparse/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(sparse_FCN_FILES) -- $(sparse_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(sparse_FCN_FILES) -- $(sparse_GEN_FCN_FILES) > $@-t + mv $@-t $@ specfun/PKG_ADD: $(specfun_FCN_FILES) $(specfun_GEN_FCN_FILES) specfun/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(specfun_FCN_FILES) -- $(specfun_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(specfun_FCN_FILES) -- $(specfun_GEN_FCN_FILES) > $@-t + mv $@-t $@ special-matrix/PKG_ADD: $(special_matrix_FCN_FILES) $(special_matrix_GEN_FCN_FILES) special-matrix/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(special_matrix_FCN_FILES) -- $(special_matrix_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(special_matrix_FCN_FILES) -- $(special_matrix_GEN_FCN_FILES) > $@-t + mv $@-t $@ startup/PKG_ADD: $(startup_FCN_FILES) $(startup_GEN_FCN_FILES) startup/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(startup_FCN_FILES) -- $(startup_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(startup_FCN_FILES) -- $(startup_GEN_FCN_FILES) > $@-t + mv $@-t $@ statistics/base/PKG_ADD: $(statistics_base_FCN_FILES) $(statistics_base_GEN_FCN_FILES) statistics/base/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(statistics_base_FCN_FILES) -- $(statistics_base_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(statistics_base_FCN_FILES) -- $(statistics_base_GEN_FCN_FILES) > $@-t + mv $@-t $@ statistics/distributions/PKG_ADD: $(statistics_distributions_FCN_FILES) $(statistics_distributions_GEN_FCN_FILES) statistics/distributions/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(statistics_distributions_FCN_FILES) -- $(statistics_distributions_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(statistics_distributions_FCN_FILES) -- $(statistics_distributions_GEN_FCN_FILES) > $@-t + mv $@-t $@ statistics/models/PKG_ADD: $(statistics_models_FCN_FILES) $(statistics_models_GEN_FCN_FILES) statistics/models/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(statistics_models_FCN_FILES) -- $(statistics_models_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(statistics_models_FCN_FILES) -- $(statistics_models_GEN_FCN_FILES) > $@-t + mv $@-t $@ statistics/tests/PKG_ADD: $(statistics_tests_FCN_FILES) $(statistics_tests_GEN_FCN_FILES) statistics/tests/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(statistics_tests_FCN_FILES) -- $(statistics_tests_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(statistics_tests_FCN_FILES) -- $(statistics_tests_GEN_FCN_FILES) > $@-t + mv $@-t $@ strings/PKG_ADD: $(strings_FCN_FILES) $(strings_GEN_FCN_FILES) strings/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(strings_FCN_FILES) -- $(strings_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(strings_FCN_FILES) -- $(strings_GEN_FCN_FILES) > $@-t + mv $@-t $@ testfun/PKG_ADD: $(testfun_FCN_FILES) $(testfun_GEN_FCN_FILES) testfun/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(testfun_FCN_FILES) -- $(testfun_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(testfun_FCN_FILES) -- $(testfun_GEN_FCN_FILES) > $@-t + mv $@-t $@ time/PKG_ADD: $(time_FCN_FILES) $(time_GEN_FCN_FILES) time/$(octave_dirstamp) mk-pkg-add - @echo "generating $@" - @$(srcdir)/mk-pkg-add $(srcdir) $(time_FCN_FILES) -- $(time_GEN_FCN_FILES) > $@-t - @mv $@-t $@ + $(srcdir)/mk-pkg-add $(srcdir) $(time_FCN_FILES) -- $(time_GEN_FCN_FILES) > $@-t + mv $@-t $@ $(@ftp_GEN_FCN_FILES): @ftp/$(octave_dirstamp) $(audio_GEN_FCN_FILES): audio/$(octave_dirstamp) @@ -250,92 +229,92 @@ $(time_GEN_FCN_FILES): time/$(octave_dirstamp) @ftp/$(octave_dirstamp): - @$(MKDIR_P) @ftp - @: > @ftp/$(octave_dirstamp) + $(MKDIR_P) @ftp + : > @ftp/$(octave_dirstamp) audio/$(octave_dirstamp): - @$(MKDIR_P) audio - @: > audio/$(octave_dirstamp) + $(MKDIR_P) audio + : > audio/$(octave_dirstamp) deprecated/$(octave_dirstamp): - @$(MKDIR_P) deprecated - @: > deprecated/$(octave_dirstamp) + $(MKDIR_P) deprecated + : > deprecated/$(octave_dirstamp) elfun/$(octave_dirstamp): - @$(MKDIR_P) elfun - @: > elfun/$(octave_dirstamp) + $(MKDIR_P) elfun + : > elfun/$(octave_dirstamp) general/$(octave_dirstamp): - @$(MKDIR_P) general - @: > general/$(octave_dirstamp) + $(MKDIR_P) general + : > general/$(octave_dirstamp) geometry/$(octave_dirstamp): - @$(MKDIR_P) geometry - @: > geometry/$(octave_dirstamp) + $(MKDIR_P) geometry + : > geometry/$(octave_dirstamp) help/$(octave_dirstamp): - @$(MKDIR_P) help - @: > help/$(octave_dirstamp) + $(MKDIR_P) help + : > help/$(octave_dirstamp) image/$(octave_dirstamp): - @$(MKDIR_P) image - @: > image/$(octave_dirstamp) + $(MKDIR_P) image + : > image/$(octave_dirstamp) io/$(octave_dirstamp): - @$(MKDIR_P) io - @: > io/$(octave_dirstamp) + $(MKDIR_P) io + : > io/$(octave_dirstamp) linear-algebra/$(octave_dirstamp): - @$(MKDIR_P) linear-algebra - @: > linear-algebra/$(octave_dirstamp) + $(MKDIR_P) linear-algebra + : > linear-algebra/$(octave_dirstamp) miscellaneous/$(octave_dirstamp): - @$(MKDIR_P) miscellaneous - @: > miscellaneous/$(octave_dirstamp) + $(MKDIR_P) miscellaneous + : > miscellaneous/$(octave_dirstamp) optimization/$(octave_dirstamp): - @$(MKDIR_P) optimization - @: > optimization/$(octave_dirstamp) + $(MKDIR_P) optimization + : > optimization/$(octave_dirstamp) path/$(octave_dirstamp): - @$(MKDIR_P) path - @: > path/$(octave_dirstamp) + $(MKDIR_P) path + : > path/$(octave_dirstamp) pkg/$(octave_dirstamp): - @$(MKDIR_P) pkg - @: > pkg/$(octave_dirstamp) + $(MKDIR_P) pkg + : > pkg/$(octave_dirstamp) plot/$(octave_dirstamp): - @$(MKDIR_P) plot - @: > plot/$(octave_dirstamp) + $(MKDIR_P) plot + : > plot/$(octave_dirstamp) polynomial/$(octave_dirstamp): - @$(MKDIR_P) polynomial - @: > polynomial/$(octave_dirstamp) + $(MKDIR_P) polynomial + : > polynomial/$(octave_dirstamp) set/$(octave_dirstamp): - @$(MKDIR_P) set - @: > set/$(octave_dirstamp) + $(MKDIR_P) set + : > set/$(octave_dirstamp) signal/$(octave_dirstamp): - @$(MKDIR_P) signal - @: > signal/$(octave_dirstamp) + $(MKDIR_P) signal + : > signal/$(octave_dirstamp) sparse/$(octave_dirstamp): - @$(MKDIR_P) sparse - @: > sparse/$(octave_dirstamp) + $(MKDIR_P) sparse + : > sparse/$(octave_dirstamp) specfun/$(octave_dirstamp): - @$(MKDIR_P) specfun - @: > specfun/$(octave_dirstamp) + $(MKDIR_P) specfun + : > specfun/$(octave_dirstamp) special-matrix/$(octave_dirstamp): - @$(MKDIR_P) special-matrix - @: > special-matrix/$(octave_dirstamp) + $(MKDIR_P) special-matrix + : > special-matrix/$(octave_dirstamp) startup/$(octave_dirstamp): - @$(MKDIR_P) startup - @: > startup/$(octave_dirstamp) + $(MKDIR_P) startup + : > startup/$(octave_dirstamp) statistics/base/$(octave_dirstamp): - @$(MKDIR_P) statistics/base - @: > statistics/base/$(octave_dirstamp) + $(MKDIR_P) statistics/base + : > statistics/base/$(octave_dirstamp) statistics/distributions/$(octave_dirstamp): - @$(MKDIR_P) statistics/distributions - @: > statistics/distributions/$(octave_dirstamp) + $(MKDIR_P) statistics/distributions + : > statistics/distributions/$(octave_dirstamp) statistics/models/$(octave_dirstamp): - @$(MKDIR_P) statistics/models - @: > statistics/models/$(octave_dirstamp) + $(MKDIR_P) statistics/models + : > statistics/models/$(octave_dirstamp) statistics/tests/$(octave_dirstamp): - @$(MKDIR_P) statistics/tests - @: > statistics/tests/$(octave_dirstamp) + $(MKDIR_P) statistics/tests + : > statistics/tests/$(octave_dirstamp) strings/$(octave_dirstamp): - @$(MKDIR_P) strings - @: > strings/$(octave_dirstamp) + $(MKDIR_P) strings + : > strings/$(octave_dirstamp) testfun/$(octave_dirstamp): - @$(MKDIR_P) testfun - @: > testfun/$(octave_dirstamp) + $(MKDIR_P) testfun + : > testfun/$(octave_dirstamp) time/$(octave_dirstamp): - @$(MKDIR_P) time - @: > time/$(octave_dirstamp) + $(MKDIR_P) time + : > time/$(octave_dirstamp) FCN_FILES_IN = $(GEN_FCN_FILES:.m=.in) @@ -346,16 +325,15 @@ all-local: $(GEN_FCN_FILES) $(PKG_ADD_FILES) DOCSTRINGS -DOCSTRINGS: gethelp$(BUILD_EXEEXT) mkdoc $(FCN_FILES) - @echo "generating $@" - @$(srcdir)/mkdoc "$(srcdir)" $(FCN_FILES) -- $(GEN_FCN_FILES) > $@.t - @mv $@.t $@ +DOCSTRINGS: mkdoc $(FCN_FILES) $(FCN_FILES_IN) gethelp$(BUILD_EXEEXT) + $(srcdir)/mkdoc "$(srcdir)" $(FCN_FILES) $(FCN_FILES_IN) > $@-t + $(simple_move_if_change_rule) gethelp$(BUILD_EXEEXT): gethelp.cc $(BUILD_CXX) $(BUILD_CXXFLAGS) -o $@ $^ $(BUILD_LDFLAGS) $(GEN_FCN_FILES) : %.m : %.in Makefile - @$(do_subst_config_vals) + $(do_subst_config_vals) check-m-sources: @echo -n "checking whether files in source tree are listed in module.mk files..."; \ diff --git a/scripts/audio/module.mk b/scripts/audio/module.mk --- a/scripts/audio/module.mk +++ b/scripts/audio/module.mk @@ -14,3 +14,5 @@ FCN_FILES += $(audio_FCN_FILES) PKG_ADD_FILES += audio/PKG_ADD + +DIRSTAMP_FILES += audio/$(octave_dirstamp) diff --git a/scripts/audio/wavwrite.m b/scripts/audio/wavwrite.m --- a/scripts/audio/wavwrite.m +++ b/scripts/audio/wavwrite.m @@ -168,6 +168,7 @@ %! assert(A,B, 10^(-4)); %! assert(samples_per_sec, 8000); %! assert(bits_per_sample, 16); +%! delete ("a.wav"); % %!test %! A=[1:10; 1:10] / 10; @@ -176,6 +177,7 @@ %! assert(A,B, 10^(-4)); %! assert(samples_per_sec, 4000); %! assert(bits_per_sample, 16); +%! delete ("a.wav"); % %!test %! A=[1:10; 1:10] / 10; @@ -184,3 +186,4 @@ %! assert(A,B, 10^(-2)); %! assert(samples_per_sec, 4000); %! assert(bits_per_sample, 8); +%! delete ("a.wav"); diff --git a/scripts/deprecated/module.mk b/scripts/deprecated/module.mk --- a/scripts/deprecated/module.mk +++ b/scripts/deprecated/module.mk @@ -122,3 +122,5 @@ FCN_FILES += $(deprecated_FCN_FILES) PKG_ADD_FILES += deprecated/PKG_ADD + +DIRSTAMP_FILES += deprecated/$(octave_dirstamp) diff --git a/scripts/elfun/module.mk b/scripts/elfun/module.mk --- a/scripts/elfun/module.mk +++ b/scripts/elfun/module.mk @@ -30,3 +30,5 @@ FCN_FILES += $(elfun_FCN_FILES) PKG_ADD_FILES += elfun/PKG_ADD + +DIRSTAMP_FILES += elfun/$(octave_dirstamp) diff --git a/scripts/general/module.mk b/scripts/general/module.mk --- a/scripts/general/module.mk +++ b/scripts/general/module.mk @@ -83,3 +83,5 @@ FCN_FILES += $(general_FCN_FILES) PKG_ADD_FILES += general/PKG_ADD + +DIRSTAMP_FILES += general/$(octave_dirstamp) diff --git a/scripts/geometry/module.mk b/scripts/geometry/module.mk --- a/scripts/geometry/module.mk +++ b/scripts/geometry/module.mk @@ -22,3 +22,5 @@ FCN_FILES += $(geometry_FCN_FILES) PKG_ADD_FILES += geometry/PKG_ADD + +DIRSTAMP_FILES += geometry/$(octave_dirstamp) diff --git a/scripts/help/module.mk b/scripts/help/module.mk --- a/scripts/help/module.mk +++ b/scripts/help/module.mk @@ -19,3 +19,5 @@ FCN_FILES += $(help_FCN_FILES) PKG_ADD_FILES += help/PKG_ADD + +DIRSTAMP_FILES += help/$(octave_dirstamp) diff --git a/scripts/image/module.mk b/scripts/image/module.mk --- a/scripts/image/module.mk +++ b/scripts/image/module.mk @@ -45,3 +45,5 @@ FCN_FILES += $(image_FCN_FILES) PKG_ADD_FILES += image/PKG_ADD + +DIRSTAMP_FILES += image/$(octave_dirstamp) diff --git a/scripts/io/module.mk b/scripts/io/module.mk --- a/scripts/io/module.mk +++ b/scripts/io/module.mk @@ -11,3 +11,5 @@ FCN_FILES += $(io_FCN_FILES) PKG_ADD_FILES += io/PKG_ADD + +DIRSTAMP_FILES += io/$(octave_dirstamp) diff --git a/scripts/linear-algebra/module.mk b/scripts/linear-algebra/module.mk --- a/scripts/linear-algebra/module.mk +++ b/scripts/linear-algebra/module.mk @@ -30,3 +30,5 @@ FCN_FILES += $(linear_algebra_FCN_FILES) PKG_ADD_FILES += linear-algebra/PKG_ADD + +DIRSTAMP_FILES += linear-algebra/$(octave_dirstamp) diff --git a/scripts/miscellaneous/module.mk b/scripts/miscellaneous/module.mk --- a/scripts/miscellaneous/module.mk +++ b/scripts/miscellaneous/module.mk @@ -74,3 +74,5 @@ FCN_FILES += $(miscellaneous_FCN_FILES) PKG_ADD_FILES += miscellaneous/PKG_ADD + +DIRSTAMP_FILES += miscellaneous/$(octave_dirstamp) diff --git a/scripts/optimization/module.mk b/scripts/optimization/module.mk --- a/scripts/optimization/module.mk +++ b/scripts/optimization/module.mk @@ -21,3 +21,5 @@ FCN_FILES += $(optimization_FCN_FILES) PKG_ADD_FILES += optimization/PKG_ADD + +DIRSTAMP_FILES += optimization/$(octave_dirstamp) diff --git a/scripts/path/module.mk b/scripts/path/module.mk --- a/scripts/path/module.mk +++ b/scripts/path/module.mk @@ -8,3 +8,5 @@ FCN_FILES += $(path_FCN_FILES) PKG_ADD_FILES += path/PKG_ADD + +DIRSTAMP_FILES += path/$(octave_dirstamp) diff --git a/scripts/pkg/module.mk b/scripts/pkg/module.mk --- a/scripts/pkg/module.mk +++ b/scripts/pkg/module.mk @@ -6,3 +6,5 @@ FCN_FILES += $(pkg_FCN_FILES) PKG_ADD_FILES += pkg/PKG_ADD + +DIRSTAMP_FILES += pkg/$(octave_dirstamp) diff --git a/scripts/plot/module.mk b/scripts/plot/module.mk --- a/scripts/plot/module.mk +++ b/scripts/plot/module.mk @@ -164,3 +164,5 @@ FCN_FILES += $(plot_FCN_FILES) PKG_ADD_FILES += plot/PKG_ADD + +DIRSTAMP_FILES += plot/$(octave_dirstamp) diff --git a/scripts/polynomial/module.mk b/scripts/polynomial/module.mk --- a/scripts/polynomial/module.mk +++ b/scripts/polynomial/module.mk @@ -28,3 +28,5 @@ FCN_FILES += $(polynomial_FCN_FILES) PKG_ADD_FILES += polynomial/PKG_ADD + +DIRSTAMP_FILES += polynomial/$(octave_dirstamp) diff --git a/scripts/set/module.mk b/scripts/set/module.mk --- a/scripts/set/module.mk +++ b/scripts/set/module.mk @@ -12,3 +12,5 @@ FCN_FILES += $(set_FCN_FILES) PKG_ADD_FILES += set/PKG_ADD + +DIRSTAMP_FILES += set/$(octave_dirstamp) diff --git a/scripts/signal/module.mk b/scripts/signal/module.mk --- a/scripts/signal/module.mk +++ b/scripts/signal/module.mk @@ -43,3 +43,5 @@ FCN_FILES += $(signal_FCN_FILES) PKG_ADD_FILES += signal/PKG_ADD + +DIRSTAMP_FILES += signal/$(octave_dirstamp) diff --git a/scripts/sparse/module.mk b/scripts/sparse/module.mk --- a/scripts/sparse/module.mk +++ b/scripts/sparse/module.mk @@ -30,3 +30,5 @@ FCN_FILES += $(sparse_FCN_FILES) PKG_ADD_FILES += sparse/PKG_ADD + +DIRSTAMP_FILES += sparse/$(octave_dirstamp) diff --git a/scripts/specfun/module.mk b/scripts/specfun/module.mk --- a/scripts/specfun/module.mk +++ b/scripts/specfun/module.mk @@ -21,3 +21,5 @@ FCN_FILES += $(specfun_FCN_FILES) PKG_ADD_FILES += specfun/PKG_ADD + +DIRSTAMP_FILES += specfun/$(octave_dirstamp) diff --git a/scripts/special-matrix/module.mk b/scripts/special-matrix/module.mk --- a/scripts/special-matrix/module.mk +++ b/scripts/special-matrix/module.mk @@ -16,3 +16,5 @@ FCN_FILES += $(special_matrix_FCN_FILES) PKG_ADD_FILES += special-matrix/PKG_ADD + +DIRSTAMP_FILES += special-matrix/$(octave_dirstamp) diff --git a/scripts/startup/module.mk b/scripts/startup/module.mk --- a/scripts/startup/module.mk +++ b/scripts/startup/module.mk @@ -23,3 +23,5 @@ $(SYSTEM_INPUTRC_FILE_SRC) PKG_ADD_FILES += startup/PKG_ADD + +DIRSTAMP_FILES += startup/$(octave_dirstamp) diff --git a/scripts/statistics/base/module.mk b/scripts/statistics/base/module.mk --- a/scripts/statistics/base/module.mk +++ b/scripts/statistics/base/module.mk @@ -40,3 +40,5 @@ FCN_FILES += $(statistics_base_FCN_FILES) PKG_ADD_FILES += statistics/base/PKG_ADD + +DIRSTAMP_FILES += statistics/base/$(octave_dirstamp) diff --git a/scripts/statistics/distributions/module.mk b/scripts/statistics/distributions/module.mk --- a/scripts/statistics/distributions/module.mk +++ b/scripts/statistics/distributions/module.mk @@ -95,3 +95,5 @@ FCN_FILES += $(statistics_distributions_FCN_FILES) PKG_ADD_FILES += statistics/distributions/PKG_ADD + +DIRSTAMP_FILES += statistics/distributions/$(octave_dirstamp) diff --git a/scripts/statistics/models/module.mk b/scripts/statistics/models/module.mk --- a/scripts/statistics/models/module.mk +++ b/scripts/statistics/models/module.mk @@ -8,3 +8,5 @@ FCN_FILES += $(statistics_models_FCN_FILES) PKG_ADD_FILES += statistics/models/PKG_ADD + +DIRSTAMP_FILES += statistics/models/$(octave_dirstamp) diff --git a/scripts/statistics/tests/module.mk b/scripts/statistics/tests/module.mk --- a/scripts/statistics/tests/module.mk +++ b/scripts/statistics/tests/module.mk @@ -30,3 +30,5 @@ FCN_FILES += $(statistics_tests_FCN_FILES) PKG_ADD_FILES += statistics/tests/PKG_ADD + +DIRSTAMP_FILES += statistics/tests/$(octave_dirstamp) diff --git a/scripts/strings/module.mk b/scripts/strings/module.mk --- a/scripts/strings/module.mk +++ b/scripts/strings/module.mk @@ -37,3 +37,5 @@ FCN_FILES += $(strings_FCN_FILES) PKG_ADD_FILES += strings/PKG_ADD + +DIRSTAMP_FILES += strings/$(octave_dirstamp) diff --git a/scripts/testfun/module.mk b/scripts/testfun/module.mk --- a/scripts/testfun/module.mk +++ b/scripts/testfun/module.mk @@ -12,3 +12,5 @@ FCN_FILES += $(testfun_FCN_FILES) PKG_ADD_FILES += testfun/PKG_ADD + +DIRSTAMP_FILES += testfun/$(octave_dirstamp) diff --git a/scripts/time/module.mk b/scripts/time/module.mk --- a/scripts/time/module.mk +++ b/scripts/time/module.mk @@ -20,3 +20,5 @@ FCN_FILES += $(time_FCN_FILES) PKG_ADD_FILES += time/PKG_ADD + +DIRSTAMP_FILES += time/$(octave_dirstamp) diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,37 @@ +2009-12-03 John W. Eaton + + * Makefile.am (CLEANFILES): Include DLD-FUNCTIONS/PKG_ADD, + doc-files, gendoc.cc, gendoc$(BUILD_EXEEXT), graphics-props.cc, + oct-parse.output, $(BUILT_NODISTFILES) in the list. Remove + $(BUILT_SOURCES) from the list. + (MAINTAINERCLEANFILES): New variable. + (BUILT_DISTFILES): Remove oct-parse.cc and lex.cc from the list. + (BUILT_NODISTFILES): Include defaults.h, graphics.h, oct-conf.h, + oct-errno.cc, ops.cc, mxarray.h, and version.h in the list. + Remove $(OPT_INC) from the list. + (BUILT_SOURCES): Include mxarray.h and version.h in the list. + (EXTRA_DIST): Include version.h.in in the list. + (.cc.df): Don't silence rules. Omit $(srcdir) from XDEFUN_FILE_NAME. + ($(DEF_FILES)): Depend on mkdefs and Makefile. + (mxarray.h, version.h): New rules. + (DLD-FUNCTIONS/PKG_ADD): Don't silence rules. + (builtins.cc, DOCSTRINGS, gendoc.cc, ops.cc, $(OPT_HANDLERS)) + oct-errno.cc, oct-gperf.h): Don't silence rules. + (doc-files, defaults.h, oct-conf.h): Don't silence rules. + + * mxarray.h.in, version.h.in: Use % to delimit substitutions, not @. + + * mkbuiltins: Operate on a list of files passed as arguments. + + * genprops.awk: Write either graphics.h or graphics-props.cc to + stdout instead of graphics.h simultaneously with graphics-props.cc + ot a file. + * Makefile.am (graphics.h, graphics-props.cc): Split into two + separate rules. + + * find-defun-files.sh: Omit directory part from .df file names. + Operate on .ll and .yy files instead of generated .cc files. + 2009-12-02 Rik * DLD-FUNCTIONS/urlwrite.cc: Correctly compile code even when libcurl is diff --git a/src/Makefile.am b/src/Makefile.am --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,14 +31,43 @@ AUTOMAKE_OPTIONS = subdir-objects -BUILT_DISTFILES = \ - DOCSTRINGS \ +## Order matters here. Leave builtins.cc last, because it depends on +## $(DEF_FILES), and building those requires all the sources +## (except builtins.cc) to be available. List only one of graphics.h +## and graphics-props.cc because if both are listed, building in +## parallel will fail. +BUILT_SOURCES = \ + defaults.h \ + graphics.h \ + lex.cc \ + mxarray.h \ + oct-conf.h \ + oct-errno.cc \ oct-gperf.h \ oct-parse.cc \ - oct-parse.h \ - lex.cc \ + ops.cc \ + version.h \ + builtins.cc + +BUILT_DISTFILES = \ + oct-gperf.h \ + oct-parse.h + +## FIXME -- These files don't need to be distributed. Some of them +## do need to be installed. So we need to add them to a list somewhere +## so that happens correctly. +BUILT_NODISTFILES = \ + defaults.h \ + graphics.h \ + oct-conf.h \ + oct-errno.cc \ + ops.cc \ + mxarray.h \ + version.h \ $(OPT_HANDLERS) \ - $(OPT_INC) + $(OPT_INC) \ + $(DEF_FILES) \ + builtins.cc EXTRA_DIST = \ ChangeLog \ @@ -57,20 +86,24 @@ oct-conf.h.in \ oct-errno.cc.in \ octave.gperf \ + version.h.in \ $(BUILT_DISTFILES) DLL_CDEFS = @OCTINTERP_DLL_DEFS@ DLL_CXXDEFS = @OCTINTERP_DLL_DEFS@ .cc.df: - @echo making $@ from $< - @(echo "// DO NOT EDIT! Generated automatically by mkdefs." ; \ - echo " XDEFUN_FILE_NAME (\"$<\")" ; \ + (echo "// DO NOT EDIT! Generated automatically by mkdefs." ; \ + case "$<" in \ + $(srcdir)/*) xsrcdir="`echo $< | sed 's,^$(srcdir),src,'`" ;; \ + *) xsrcdir="src/$<" ;; \ + esac ; \ + echo " XDEFUN_FILE_NAME (\"$$xsrcdir\")" ; \ egrep '^(///*|/\*) *PKG_ADD:' $< ; \ $(CXXCPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \ -DMAKE_BUILTINS $< | $(srcdir)/mkdefs) > $@-t - @mv $@-t $@ + mv $@-t $@ OPT_HANDLERS = \ DASPK-opts.cc \ @@ -444,6 +477,7 @@ $(DIST_SRC) \ $(DLD_STATIC_SRC) \ $(OPERATORS_SRC) \ + $(OPT_HANDLERS) \ $(TEMPLATE_INST_SRC) DLD_DYNAMIC_DEF_FILES = $(DLD_DYNAMIC_SRC:.cc=.df) @@ -453,6 +487,8 @@ DEF_FILES = $(SRC_DEF_FILES) $(DLD_DYNAMIC_DEF_FILES) $(DLD_STATIC_DEF_FILES) +$(DEF_FILES): mkdefs Makefile + if AMCOND_ENABLE_DYNAMIC_LINKING OCTAVE_LIBS = \ ./liboctinterp.la \ @@ -538,25 +574,17 @@ liboctinterp_la_LDFLAGS = -release $(version) $(NO_UNDEFINED_LDFLAG) -## Order matters here. Leave builtins.cc last, because it depends on -## $(DEF_FILES), and building those requires all the sources -## (except builtins.cc) to be available. List only one of graphics.h -## and graphics-props.cc because if both are listed, building in -## parallel will vail. -BUILT_SOURCES = \ - defaults.h \ - graphics.h \ - lex.cc \ - oct-conf.h \ - oct-errno.cc \ - oct-gperf.h \ - oct-parse.cc \ - ops.cc \ - $(OPT_HANDLERS) \ - $(OPT_INC) \ - builtins.cc +CLEANFILES = \ + DLD-FUNCTIONS/PKG_ADD \ + doc-files \ + gendoc.cc \ + gendoc$(BUILD_EXEEXT) \ + graphics-props.cc \ + oct-parse.output \ + $(BUILT_NODISTFILES) -CLEANFILES = $(BUILT_SOURCES) +MAINTAINERCLEANFILES = \ + $(BUILT_DISTFILES) octave_LDADD = $(OCTAVE_LIBS) @@ -571,46 +599,52 @@ # XERBLA = ../libcruft/blas-xtra/xerbla.o builtins.cc: $(DEF_FILES) mkbuiltins - @echo making $@ - @echo DEF_FILES = $(DEF_FILES) - @echo $(DEF_FILES) > def-files - @$(srcdir)/mkbuiltins def-files > $@-t - @mv $@-t $@ + $(srcdir)/mkbuiltins $(DEF_FILES) > $@-t + mv $@-t $@ + +mxarray.h: mxarray.h.in Makefile + $(SED) < $< \ + -e "s|%OCTAVE_IDX_TYPE%|${OCTAVE_IDX_TYPE}|" > $@-t + mv $@-t $@ -## FIXME -- maybe genprops.awk should write both output files? -## Or maybe there should be separate commands to generate each file? -graphics.h graphics-props.cc: graphics.h.in genprops.awk - @echo making graphics.h and graphics-props.cc - @$(AWK) -f $(srcdir)/genprops.awk $< > graphics.h-t - @mv graphics.h-t graphics.h +version.h: version.h.in Makefile + $(SED) < $< \ + -e "s|%OCTAVE_API_VERSION%|\"${OCTAVE_API_VERSION}\"|" \ + -e "s|%OCTAVE_COPYRIGHT%|\"${OCTAVE_COPYRIGHT}\"|" \ + -e "s|%OCTAVE_RELEASE_DATE%|\"${OCTAVE_RELEASE_DATE}\"|" \ + -e "s|%OCTAVE_VERSION%|\"${OCTAVE_VERSION}\"|" > $@-t + mv $@-t $@ -DLD-FUNCTIONS/PKG_ADD: $(DLD_DYNAMIC_DEF_FILES) +graphics.h: graphics.h.in genprops.awk Makefile + $(AWK) -f $(srcdir)/genprops.awk $< > $@-t + mv $@-t $@ + +graphics-props.cc: graphics.h.in genprops.awk Makefile + $(AWK) -v emit_graphics_props=1 -f $(srcdir)/genprops.awk $< > $@-t + mv $@-t $@ + +DLD-FUNCTIONS/PKG_ADD: $(DLD_DYNAMIC_DEF_FILES) mk-pkg-add $(srcdir)/mk-pkg-add $(DLD_DYNAMIC_DEF_FILES) > $@-t - @mv $@-t $@ + mv $@-t $@ DOCSTRINGS: gendoc$(BUILD_EXEEXT) - @echo making $@ - @./gendoc > $@-t - @mv $@-t $@ + ./gendoc > $@-t + mv $@-t $@ doc-files: $(DEF_FILES) - @echo making $@ - @echo DEF_FILES = $(DEF_FILES) - @echo $(DEF_FILES) > $@-t + echo $(DEF_FILES) > $@-t mv $@-t $@ gendoc.cc: doc-files mkgendoc - @echo making $@ - @$(srcdir)/mkgendoc doc-files > $@-t - @mv $@-t $@ + $(srcdir)/mkgendoc $(srcdidr) doc-files > $@-t + mv $@-t $@ gendoc$(BUILD_EXEEXT): gendoc.cc $(BUILD_CXX) $(BUILD_CXXFLAGS) -o $@ $^ $(BUILD_LDFLAGS) ops.cc: $(OPERATORS_SRC) mkops - @echo making $@ from $(OPERATORS_SRC) - @$(srcdir)/mkops $(OPERATORS_SRC) > $@-t - @mv $@-t $@ + $(srcdir)/mkops $(OPERATORS_SRC) > $@-t + mv $@-t $@ $(DEF_FILES): $(OPT_INC) mkdefs @@ -663,9 +697,8 @@ # Special rules -- these files need special things to be defined. $(OPT_HANDLERS) : %.cc : $(top_srcdir)/liboctave/%.in $(top_srcdir)/mk-opts.pl - @echo making $@ from $< - @$(PERL) $(top_srcdir)/mk-opts.pl --opt-handler-fcns $< > $@-t - @mv $@-t $@ + $(PERL) $(top_srcdir)/mk-opts.pl --opt-handler-fcns $< > $@-t + mv $@-t $@ ## We require Bison. #parse.cc : parse.y @@ -687,21 +720,20 @@ ## newly generated file is not different. defaults.h: defaults.h.in Makefile - @$(do_subst_default_vals) + $(do_subst_default_vals) oct-conf.h: oct-conf.h.in Makefile - @$(do_subst_config_vals) + $(do_subst_config_vals) oct-errno.cc: oct-errno.cc.in Makefile - @echo "making $@ from $<" - @if test -n "$(PERL)"; then \ + if test -n "$(PERL)"; then \ $(srcdir)/mk-errno-list --perl "$(PERL)" < $< > $@-t; \ elif test -n "$(PYTHON)"; then \ $(srcdir)/mk-errno-list --python "$(PYTHON)" < $< > $@-t; \ else \ $(SED) '/@SYSDEP_ERRNO_LIST@/D' $< > $@-t; \ fi - @mv $@-t $@ + mv $@-t $@ ## Don't use a pipeline to process gperf output since if gperf ## is missing but sed is not, the exit status of the pipeline @@ -709,8 +741,8 @@ ## oct-gperf.h file. oct-gperf.h: octave.gperf $(GPERF) -t -C -D -G -L C++ -Z octave_kw_hash $< > $@-t1 - $(SED) 's,lookup\[,gperf_lookup[,' < $@-t1 > $@-t2 - mv $@-t2 $@ + $(SED) 's,lookup\[,gperf_lookup[,' < $@-t1 > $@-t + mv $@-t $@ rm -f $@-t1 display.df display.lo: CPPFLAGS += $(X11_FLAGS) diff --git a/src/find-defun-files.sh b/src/find-defun-files.sh --- a/src/find-defun-files.sh +++ b/src/find-defun-files.sh @@ -13,11 +13,12 @@ for arg do - file=`echo "$arg" | sed 's/\.ll$/.cc/; s/\.yy$/.cc/'`; - if [ ! -f $file ]; then - file="$srcdir/$file" + if [ -f "$arg" ]; then + file="$arg" + else + file="$srcdir/$arg" fi if [ "`egrep -l "$DEFUN_PATTERN" $file`" ]; then - echo "$file" | sed 's/\.cc$/.df/'; + echo "$file" | sed 's,.*/,,; s/\.\(cc\|yy\|ll\)$/.df/'; fi done diff --git a/src/genprops.awk b/src/genprops.awk --- a/src/genprops.awk +++ b/src/genprops.awk @@ -16,7 +16,12 @@ ## along with Octave; see the file COPYING. If not, see ## . ## -## This script is used to generate the graphics.h file from graphics.h.in. +## Generate the graphics.h file from graphics.h.in and write the +## output to stdout. +## +## If the variable emit_graphics_props is set on the command line, +## generate the graphics-props.cc file from graphics.h.in and write +## the output to stdout. ## ## Lines between the BEGIN_PROPERTIES and END_PROPERTIES markers have ## one of the following formats: @@ -393,54 +398,54 @@ { if (class_name) { - printf ("// ******** %s ********\n\n", class_name) >> filename; + printf ("// ******** %s ********\n\n", class_name); ## constructor if (base) - printf ("base_properties::base_properties (const std::string& ty, const graphics_handle& mh, const graphics_handle& p)\n : ") >> filename; + printf ("base_properties::base_properties (const std::string& ty, const graphics_handle& mh, const graphics_handle& p)\n : "); else { - printf ("%s::properties::properties (const graphics_handle& mh, const graphics_handle& p)\n", class_name) >> filename; - printf (" : base_properties (go_name, mh, p),\n") >> filename; + printf ("%s::properties::properties (const graphics_handle& mh, const graphics_handle& p)\n", class_name); + printf (" : base_properties (go_name, mh, p),\n"); } for (i = 1; i <= idx; i++) { if (ptype[i]) - printf (" %s (\"%s\", mh, %s)", name[i], name[i], defval[i]) >> filename; + printf (" %s (\"%s\", mh, %s)", name[i], name[i], defval[i]); else - printf (" %s (%s)", name[i], defval[i]) >> filename; + printf (" %s (%s)", name[i], defval[i]); if (i < idx) - printf (",") >> filename; - printf ("\n") >> filename; + printf (","); + printf ("\n"); } - printf ("{\n") >> filename; + printf ("{\n"); for (i = 1; i <= idx; i++) { -## printf (" insert_static_property (\"%s\", %s);\n", name[i], name[i]) >> filename; +## printf (" insert_static_property (\"%s\", %s);\n", name[i], name[i]); if (ptype[i]) { - printf (" %s.set_id (%s);\n", name[i], toupper(name[i])) >> filename; + printf (" %s.set_id (%s);\n", name[i], toupper(name[i])); if (hidden[i]) - printf (" %s.set_hidden (true);\n", name[i]) >> filename; + printf (" %s.set_hidden (true);\n", name[i]); } } - printf (" init ();\n}\n\n") >> filename; + printf (" init ();\n}\n\n"); ## set method if (base) - printf ("void\nbase_properties::set (const caseless_str& pname, const std::string& cname, const octave_value& val)\n{\n") >> filename; + printf ("void\nbase_properties::set (const caseless_str& pname, const std::string& cname, const octave_value& val)\n{\n"); else printf ("void\n%s::properties::set (const caseless_str& pname_arg, const octave_value& val)\n{\n", - class_name) >> filename; + class_name); if (! base) - printf (" const std::set& pnames = all_property_names ();\n\n caseless_str pname = validate_property_name (\"get\", go_name, pnames, pname_arg);\n\n if (error_state)\n return;\n\n") >> filename; + printf (" const std::set& pnames = all_property_names ();\n\n caseless_str pname = validate_property_name (\"get\", go_name, pnames, pname_arg);\n\n if (error_state)\n return;\n\n"); first = 1; @@ -449,107 +454,107 @@ if (! readonly[i]) { printf (" %sif (pname.compare (\"%s\"))\n set_%s (val);\n", - (first == 0 ? "else " : ""), name[i], name[i]) >> filename; + (first == 0 ? "else " : ""), name[i], name[i]); first = 0; } } if (base) - printf (" else\n set_dynamic (pname, cname, val);\n}\n\n") >> filename; + printf (" else\n set_dynamic (pname, cname, val);\n}\n\n"); else - printf (" else\n base_properties::set (pname, \"%s\", val);\n}\n\n", class_name) >> filename; + printf (" else\n base_properties::set (pname, \"%s\", val);\n}\n\n", class_name); ## get "all" method if (base) { - printf ("octave_value\nbase_properties::get (bool all) const\n{\n") >> filename; - printf (" Octave_map m = get_dynamic (all).map_value ();\n\n") >> filename; + printf ("octave_value\nbase_properties::get (bool all) const\n{\n"); + printf (" Octave_map m = get_dynamic (all).map_value ();\n\n"); } else { - printf ("octave_value\n%s::properties::get (bool all) const\n{\n", class_name) >> filename; - printf (" Octave_map m = base_properties::get (all).map_value ();\n\n") >> filename; + printf ("octave_value\n%s::properties::get (bool all) const\n{\n", class_name); + printf (" Octave_map m = base_properties::get (all).map_value ();\n\n"); } for (i = 1; i <= idx; i++) { if (hidden[i]) printf (" if (all)\n m.assign (\"%s\", get_%s ()%s);\n", name[i], name[i], - (type[i] == "handle_property" || type[i] == "graphics_handle" ? ".as_octave_value ()" : "")) >> filename; + (type[i] == "handle_property" || type[i] == "graphics_handle" ? ".as_octave_value ()" : "")); else printf (" m.assign (\"%s\", get_%s ()%s);\n", name[i], name[i], - (type[i] == "handle_property" || type[i] == "graphics_handle" ? ".as_octave_value ()" : "")) >> filename; + (type[i] == "handle_property" || type[i] == "graphics_handle" ? ".as_octave_value ()" : "")); } - printf ("\n return m;\n}\n\n") >> filename; + printf ("\n return m;\n}\n\n"); ## get "one" method if (base) - printf ("octave_value\nbase_properties::get (const caseless_str& pname) const\n{\n") >> filename; + printf ("octave_value\nbase_properties::get (const caseless_str& pname) const\n{\n"); else printf ("octave_value\n%s::properties::get (const caseless_str& pname_arg) const\n{\n", - class_name) >> filename; - printf (" octave_value retval;\n\n") >> filename; + class_name); + printf (" octave_value retval;\n\n"); if (! base) - printf (" const std::set& pnames = all_property_names ();\n\n caseless_str pname = validate_property_name (\"get\", go_name, pnames, pname_arg);\n\n if (error_state)\n return retval;\n\n") >> filename; + printf (" const std::set& pnames = all_property_names ();\n\n caseless_str pname = validate_property_name (\"get\", go_name, pnames, pname_arg);\n\n if (error_state)\n return retval;\n\n"); for (i = 1; i<= idx; i++) { printf (" %sif (pname.compare (\"%s\"))\n", - (i > 1 ? "else " : ""), name[i]) >> filename; + (i > 1 ? "else " : ""), name[i]); printf (" retval = get_%s ()%s;\n", name[i], - (type[i] == "handle_property" || type[i] == "graphics_handle" ? ".as_octave_value ()" : "")) >> filename; + (type[i] == "handle_property" || type[i] == "graphics_handle" ? ".as_octave_value ()" : "")); } if (base) - printf (" else\n retval = get_dynamic (pname);\n\n") >> filename; + printf (" else\n retval = get_dynamic (pname);\n\n"); else - printf (" else\n retval = base_properties::get (pname);\n\n") >> filename; - printf (" return retval;\n}\n\n") >> filename; + printf (" else\n retval = base_properties::get (pname);\n\n"); + printf (" return retval;\n}\n\n"); ## get_property method if (base) - printf ("property\nbase_properties::get_property (const caseless_str& pname)\n{\n") >> filename; + printf ("property\nbase_properties::get_property (const caseless_str& pname)\n{\n"); else printf ("property\n%s::properties::get_property (const caseless_str& pname_arg)\n{\n", - class_name) >> filename; + class_name); if (! base) - printf (" const std::set& pnames = all_property_names ();\n\n caseless_str pname = validate_property_name (\"get\", go_name, pnames, pname_arg);\n\n if (error_state)\n return property ();\n\n") >> filename; + printf (" const std::set& pnames = all_property_names ();\n\n caseless_str pname = validate_property_name (\"get\", go_name, pnames, pname_arg);\n\n if (error_state)\n return property ();\n\n"); for (i = 1; i<= idx; i++) { if (ptype[i]) { printf (" %sif (pname.compare (\"%s\"))\n", - (i > 1 ? "else " : ""), name[i]) >> filename; - printf (" return property (&%s, true);\n", name[i]) >> filename; + (i > 1 ? "else " : ""), name[i]); + printf (" return property (&%s, true);\n", name[i]); } } if (base) - printf (" else\n return get_property_dynamic (pname);\n") >> filename; + printf (" else\n return get_property_dynamic (pname);\n"); else - printf (" else\n return base_properties::get_property (pname);\n") >> filename; - printf ("}\n\n") >> filename; + printf (" else\n return base_properties::get_property (pname);\n"); + printf ("}\n\n"); ## factory defaults method if (base) { - printf ("property_list::pval_map_type\nbase_properties::factory_defaults (void)\n{\n") >> filename; - printf (" property_list::pval_map_type m;\n\n") >> filename; + printf ("property_list::pval_map_type\nbase_properties::factory_defaults (void)\n{\n"); + printf (" property_list::pval_map_type m;\n\n"); } else { printf ("property_list::pval_map_type\n%s::properties::factory_defaults (void)\n{\n", - class_name) >> filename; - printf (" property_list::pval_map_type m = base_properties::factory_defaults ();\n\n") >> filename; + class_name); + printf (" property_list::pval_map_type m = base_properties::factory_defaults ();\n\n"); } for (i = 1; i <= idx; i++) @@ -569,62 +574,60 @@ } printf (" m[\"%s\"] = %s%s;\n", name[i], dval, - (type[i] == "handle_property" || type[i] == "graphics_handle" ? ".as_octave_value ()" : "")) >> filename; + (type[i] == "handle_property" || type[i] == "graphics_handle" ? ".as_octave_value ()" : "")); } } - printf ("\n return m;\n}\n\n") >> filename; + printf ("\n return m;\n}\n\n"); ## go_name static field if (! base) printf ("std::string %s::properties::go_name (\"%s\");\n\n", - class_name, object_name) >> filename; + class_name, object_name); - printf ("std::set\n") >> filename; + printf ("std::set\n"); if (base) - printf ("base_properties") >> filename; + printf ("base_properties"); else - printf ("%s::properties", class_name) >> filename; - printf ("::core_property_names (void)\n{\n static std::set all_pnames;\n\n static bool initialized = false;\n\n if (! initialized)\n {\n") >> filename; + printf ("%s::properties", class_name); + printf ("::core_property_names (void)\n{\n static std::set all_pnames;\n\n static bool initialized = false;\n\n if (! initialized)\n {\n"); for (i = 1; i <= idx; i++) - printf (" all_pnames.insert (\"%s\");\n", name[i]) >> filename; + printf (" all_pnames.insert (\"%s\");\n", name[i]); if (! base) - printf ("\n std::set base_pnames = base_properties::core_property_names ();\n all_pnames.insert (base_pnames.begin (), base_pnames.end ());\n") >> filename; - printf ("\n initialized = true;\n }\n\n return all_pnames;\n}\n\n") >> filename; + printf ("\n std::set base_pnames = base_properties::core_property_names ();\n all_pnames.insert (base_pnames.begin (), base_pnames.end ());\n"); + printf ("\n initialized = true;\n }\n\n return all_pnames;\n}\n\n"); - printf ("bool\n") >> filename; + printf ("bool\n"); if (base) - printf ("base_properties") >> filename; + printf ("base_properties"); else - printf ("%s::properties", class_name) >> filename; - printf ("::has_core_property (const caseless_str& pname)\n{\n std::set pnames = core_property_names ();\n\n return pnames.find (pname) != pnames.end ();\n}\n\n", class_name) >> filename; + printf ("%s::properties", class_name); + printf ("::has_core_property (const caseless_str& pname)\n{\n std::set pnames = core_property_names ();\n\n return pnames.find (pname) != pnames.end ();\n}\n\n", class_name); - printf ("std::set\n") >> filename; + printf ("std::set\n"); if (base) - printf ("base_properties") >> filename; + printf ("base_properties"); else - printf ("%s::properties", class_name) >> filename; - printf ("::all_property_names (") >> filename; + printf ("%s::properties", class_name); + printf ("::all_property_names ("); if (base) - printf ("const std::string& cname") >> filename; + printf ("const std::string& cname"); else - printf ("void") >> filename; - printf (") const\n{\n static std::set all_pnames = core_property_names ();\n\n") >> filename; + printf ("void"); + printf (") const\n{\n static std::set all_pnames = core_property_names ();\n\n"); if (base) - printf (" std::set retval = all_pnames;\n std::set dyn_props = dynamic_property_names (cname);\n retval.insert (dyn_props.begin (), dyn_props.end ());\n for (std::map::const_iterator p = all_props.begin ();\n p != all_props.end (); p++)\n retval.insert (p->first);\n\n return retval;\n}\n\n") >> filename; + printf (" std::set retval = all_pnames;\n std::set dyn_props = dynamic_property_names (cname);\n retval.insert (dyn_props.begin (), dyn_props.end ());\n for (std::map::const_iterator p = all_props.begin ();\n p != all_props.end (); p++)\n retval.insert (p->first);\n\n return retval;\n}\n\n"); else - printf (" std::set retval = all_pnames;\n std::set base_props = base_properties::all_property_names (\"%s\");\n retval.insert (base_props.begin (), base_props.end ());\n\n return retval;\n}\n\n", class_name) >> filename; + printf (" std::set retval = all_pnames;\n std::set base_props = base_properties::all_property_names (\"%s\");\n retval.insert (base_props.begin (), base_props.end ());\n\n return retval;\n}\n\n", class_name); if (! base) - printf ("bool\n%s::properties::has_property (const caseless_str& pname) const\n{\n std::set pnames = all_property_names ();\n\n return pnames.find (pname) != pnames.end ();\n}\n\n", class_name) >> filename; + printf ("bool\n%s::properties::has_property (const caseless_str& pname) const\n{\n std::set pnames = all_property_names ();\n\n return pnames.find (pname) != pnames.end ();\n}\n\n", class_name); } } BEGIN { - filename = "graphics-props.cc"; - printf ("// DO NOT EDIT! Generated automatically by genprops.awk.\n\n"); - printf ("// DO NOT EDIT! Generated automatically by genprops.awk.\n\n") > filename; + printf ("// DO NOT EDIT! Generated automatically by genprops.awk.\n\n") pcount = 0; } @@ -665,8 +668,10 @@ } /END_PROPERTIES/ { - emit_declarations(); - emit_source(); + if (emit_graphics_props) + emit_source(); + else + emit_declarations(); gather = 0; next; } @@ -795,6 +800,6 @@ } } - else + else if (! emit_graphics_props) print $0; } diff --git a/src/mkbuiltins b/src/mkbuiltins --- a/src/mkbuiltins +++ b/src/mkbuiltins @@ -19,20 +19,13 @@ # along with Octave; see the file COPYING. If not, see # . -if test $# -ne 1; then - echo "usage: mkbuiltins f1" 1>&2 +if test $# -eq 0; then + echo "usage: mkbuiltins f1 f2 ..." 1>&2 exit 1 fi SED=${SED:-'sed'} -DEF_FILES=`cat $1` - -if test -z "$DEF_FILES"; then - echo "mkbuiltins: DEF_FILES is empty!" 1>&2 - exit 1 -fi - cat << \EOF // DO NOT EDIT! Generated automatically by mkbuiltins. @@ -86,12 +79,13 @@ EOF -for file in $DEF_FILES; do - fcn=`echo $file | $SED 's,.*/,,; s/\.df//; s/-/_/g;'` +for arg +do + fcn=`echo "$arg" | $SED 's,.*/,,; s/\.df//; s/-/_/g;'` echo "static void" echo "install_${fcn}_fcns (void)" echo "{" - cat $file + cat "$arg" echo "}" echo "" done @@ -103,8 +97,9 @@ { EOF -for file in $DEF_FILES; do - fcn=`echo $file | $SED 's,.*/,,; s/\.df//; s/-/_/g;'` +for arg +do + fcn=`echo "$arg" | $SED 's,.*/,,; s/\.df//; s/-/_/g;'` echo " install_${fcn}_fcns ();" done diff --git a/src/mxarray.h.in b/src/mxarray.h.in --- a/src/mxarray.h.in +++ b/src/mxarray.h.in @@ -85,8 +85,8 @@ * mex is used with the -largearraydims flag, but why do that? Its better * to conform to the same indexing as the rest of Octave */ -typedef @OCTAVE_IDX_TYPE@ mwSize; -typedef @OCTAVE_IDX_TYPE@ mwIndex; +typedef %OCTAVE_IDX_TYPE% mwSize; +typedef %OCTAVE_IDX_TYPE% mwIndex; #if ! defined (MXARRAY_TYPEDEFS_ONLY) diff --git a/src/version.h.in b/src/version.h.in --- a/src/version.h.in +++ b/src/version.h.in @@ -25,13 +25,13 @@ #if !defined (octave_version_h) #define octave_version_h 1 -#define OCTAVE_VERSION "@OCTAVE_VERSION@" +#define OCTAVE_VERSION %OCTAVE_VERSION% -#define OCTAVE_API_VERSION "@OCTAVE_API_VERSION@" +#define OCTAVE_API_VERSION %OCTAVE_API_VERSION% -#define OCTAVE_RELEASE_DATE "@OCTAVE_RELEASE_DATE@" +#define OCTAVE_RELEASE_DATE %OCTAVE_RELEASE_DATE% -#define OCTAVE_COPYRIGHT "@OCTAVE_COPYRIGHT@" +#define OCTAVE_COPYRIGHT %OCTAVE_COPYRIGHT% // This is the first line printed by --version. The GNU coding // standards say that the version number should follow the last space diff --git a/test/ChangeLog b/test/ChangeLog --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,7 @@ +2009-12-03 John W. Eaton + + * Makefile.am (CLEANFILES, DISTCLEANFILES): New variables. + 2009-11-10 John W. Eaton * @Blork/module.mk, @Cork/module.mk, @Dork/module.mk, diff --git a/test/Makefile.am b/test/Makefile.am --- a/test/Makefile.am +++ b/test/Makefile.am @@ -71,6 +71,12 @@ build_sparse_tests.sh \ $(FCN_FILES) +CLEANFILES = \ + test_sparse.m + +DISTCLEANFILES = \ + fntests.log + check: test_sparse.m ../run-octave --norc --silent --no-history $(srcdir)/fntests.m $(srcdir)