annotate scripts/miscellaneous/mkoctfile.m @ 23084:ef4d915df748

maint: Merge stable to default.
author John W. Eaton <jwe@octave.org>
date Mon, 23 Jan 2017 14:27:48 -0500
parents 3a2b891d0b33 e9a0469dedd9
children 092078913d54
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22323
bac0d6f07a3e maint: Update copyright notices for 2016.
John W. Eaton <jwe@octave.org>
parents: 21634
diff changeset
1 ## Copyright (C) 2006-2016 Keith Goodman
5671
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
2 ##
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
3 ## This file is part of Octave.
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
4 ##
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22463
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22463
diff changeset
8 ## (at your option) any later version.
5671
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
9 ##
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22463
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22463
diff changeset
13 ## GNU General Public License for more details.
5671
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
14 ##
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6717
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6717
diff changeset
17 ## <http://www.gnu.org/licenses/>.
5671
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
18
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
19 ## -*- texinfo -*-
20852
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 20727
diff changeset
20 ## @deftypefn {} {} mkoctfile [-options] file @dots{}
516bb87ea72e 2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents: 20727
diff changeset
21 ## @deftypefnx {} {[@var{output}, @var{status}] =} mkoctfile (@dots{})
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11575
diff changeset
22 ##
20164
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
23 ## The @code{mkoctfile} function compiles source code written in C, C++, or
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
24 ## Fortran. Depending on the options used with @code{mkoctfile}, the
5695
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
25 ## compiled code can be called within Octave or can be used as a stand-alone
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
26 ## application.
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
27 ##
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
28 ## @code{mkoctfile} can be called from the shell prompt or from the Octave
20164
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
29 ## prompt. Calling it from the Octave prompt simply delegates the call to
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
30 ## the shell prompt. The output is stored in the @var{output} variable and
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
31 ## the exit status in the @var{status} variable.
5695
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
32 ##
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
33 ## @code{mkoctfile} accepts the following options, all of which are optional
20713
2469d78a1d8b Consistently use 'filename' rather than 'file name' throughout code base.
Rik <rik@octave.org>
parents: 20164
diff changeset
34 ## except for the filename of the code you wish to compile:
5695
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
35 ##
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
36 ## @table @samp
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
37 ## @item -I DIR
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
38 ## Add the include directory DIR to compile commands.
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
39 ##
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
40 ## @item -D DEF
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
41 ## Add the definition DEF to the compiler call.
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
42 ##
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
43 ## @item -l LIB
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
44 ## Add the library LIB to the link command.
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11575
diff changeset
45 ##
5695
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
46 ## @item -L DIR
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
47 ## Add the library directory DIR to the link command.
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
48 ##
17170
d6499c14021c doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents: 16994
diff changeset
49 ## @item -M
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11575
diff changeset
50 ## @itemx --depend
5695
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
51 ## Generate dependency files (.d) for C and C++ source files.
10996
72640afb02b9 mkoctfile.m: Change help text to be consistent with the shell version.
Ben Abbott <bpabbott@mac.com>
parents: 10793
diff changeset
52 ##
72640afb02b9 mkoctfile.m: Change help text to be consistent with the shell version.
Ben Abbott <bpabbott@mac.com>
parents: 10793
diff changeset
53 ## @item -R DIR
11575
d6619410e79c Spellcheck documentation before 3.4 release.
Rik <octave@nomad.inbox5.com>
parents: 11563
diff changeset
54 ## Add the run-time path to the link command.
10996
72640afb02b9 mkoctfile.m: Change help text to be consistent with the shell version.
Ben Abbott <bpabbott@mac.com>
parents: 10793
diff changeset
55 ##
16826
a4969508008e doc: Periodic spellcheck of the documentation.
Rik <rik@octave.org>
parents: 15467
diff changeset
56 ## @item @nospell{-Wl,@dots{}}
a4969508008e doc: Periodic spellcheck of the documentation.
Rik <rik@octave.org>
parents: 15467
diff changeset
57 ## Pass flags though the linker like @nospell{"-Wl,-rpath=@dots{}"}.
10996
72640afb02b9 mkoctfile.m: Change help text to be consistent with the shell version.
Ben Abbott <bpabbott@mac.com>
parents: 10793
diff changeset
58 ## The quotes are needed since commas are interpreted as command
72640afb02b9 mkoctfile.m: Change help text to be consistent with the shell version.
Ben Abbott <bpabbott@mac.com>
parents: 10793
diff changeset
59 ## separators.
72640afb02b9 mkoctfile.m: Change help text to be consistent with the shell version.
Ben Abbott <bpabbott@mac.com>
parents: 10793
diff changeset
60 ##
12753
00fbb05f099c Backout 2c54fde0f397 on stable; broke Octave-Forge packages
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents: 12662
diff changeset
61 ## @item -W@dots{}
16826
a4969508008e doc: Periodic spellcheck of the documentation.
Rik <rik@octave.org>
parents: 15467
diff changeset
62 ## Pass flags though the compiler like @nospell{"-Wa,OPTION"}.
10996
72640afb02b9 mkoctfile.m: Change help text to be consistent with the shell version.
Ben Abbott <bpabbott@mac.com>
parents: 10793
diff changeset
63 ##
5695
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
64 ## @item -c
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
65 ## Compile but do not link.
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
66 ##
5904
80d3933fb8b6 [project @ 2006-07-26 17:19:10 by jwe]
jwe
parents: 5745
diff changeset
67 ## @item -g
80d3933fb8b6 [project @ 2006-07-26 17:19:10 by jwe]
jwe
parents: 5745
diff changeset
68 ## Enable debugging options for compilers.
80d3933fb8b6 [project @ 2006-07-26 17:19:10 by jwe]
jwe
parents: 5745
diff changeset
69 ##
17170
d6499c14021c doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents: 16994
diff changeset
70 ## @item -o FILE
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11575
diff changeset
71 ## @itemx --output FILE
20713
2469d78a1d8b Consistently use 'filename' rather than 'file name' throughout code base.
Rik <rik@octave.org>
parents: 20164
diff changeset
72 ## Output filename. Default extension is .oct (or .mex if @samp{--mex} is
20164
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
73 ## specified) unless linking a stand-alone executable.
5695
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
74 ##
17170
d6499c14021c doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents: 16994
diff changeset
75 ## @item -p VAR
6573
9180be9d3d08 [project @ 2007-04-25 04:27:16 by jwe]
jwe
parents: 6547
diff changeset
76 ## @itemx --print VAR
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11575
diff changeset
77 ## Print the configuration variable VAR@. Recognized variables are:
5671
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
78 ##
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11575
diff changeset
79 ## @example
18359
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
80 ## ALL_CFLAGS INCFLAGS
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
81 ## ALL_CXXFLAGS INCLUDEDIR
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
82 ## ALL_FFLAGS LAPACK_LIBS
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
83 ## ALL_LDFLAGS LD_CXX
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
84 ## AR LDFLAGS
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
85 ## BLAS_LIBS LD_STATIC_FLAG
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
86 ## CC LFLAGS
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
87 ## CFLAGS LIBDIR
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
88 ## CPICFLAG LIBOCTAVE
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
89 ## CPPFLAGS LIBOCTINTERP
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
90 ## CXX LIBS
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
91 ## CXXFLAGS OCTAVE_HOME
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
92 ## CXXPICFLAG OCTAVE_LIBS
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
93 ## DEPEND_EXTRA_SED_PATTERN OCTAVE_LINK_DEPS
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
94 ## DEPEND_FLAGS OCTAVE_LINK_OPTS
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
95 ## DL_LD OCTAVE_PREFIX
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
96 ## DL_LDFLAGS OCTINCLUDEDIR
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
97 ## F77 OCTLIBDIR
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
98 ## F77_INTEGER8_FLAG OCT_LINK_DEPS
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
99 ## FFLAGS OCT_LINK_OPTS
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
100 ## FFTW3F_LDFLAGS RANLIB
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
101 ## FFTW3F_LIBS RDYNAMIC_FLAG
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
102 ## FFTW3_LDFLAGS READLINE_LIBS
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
103 ## FFTW3_LIBS SED
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
104 ## FFTW_LIBS SPECIAL_MATH_LIB
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
105 ## FLIBS XTRA_CFLAGS
d9f706dd78df make mkoctfile.m list of variables consistent with mkoctfile.cc (bug #41296)
John W. Eaton <jwe@octave.org>
parents: 18356
diff changeset
106 ## FPICFLAG XTRA_CXXFLAGS
5695
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
107 ## @end example
5671
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
108 ##
5745
0559ebb94bf0 [project @ 2006-04-06 20:33:40 by jwe]
jwe
parents: 5696
diff changeset
109 ## @item --link-stand-alone
0559ebb94bf0 [project @ 2006-04-06 20:33:40 by jwe]
jwe
parents: 5696
diff changeset
110 ## Link a stand-alone executable file.
0559ebb94bf0 [project @ 2006-04-06 20:33:40 by jwe]
jwe
parents: 5696
diff changeset
111 ##
5904
80d3933fb8b6 [project @ 2006-07-26 17:19:10 by jwe]
jwe
parents: 5745
diff changeset
112 ## @item --mex
20164
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
113 ## Assume we are creating a MEX file. Set the default output extension to
df437a52bcaf doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19833
diff changeset
114 ## ".mex".
5904
80d3933fb8b6 [project @ 2006-07-26 17:19:10 by jwe]
jwe
parents: 5745
diff changeset
115 ##
17170
d6499c14021c doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents: 16994
diff changeset
116 ## @item -s
6573
9180be9d3d08 [project @ 2007-04-25 04:27:16 by jwe]
jwe
parents: 6547
diff changeset
117 ## @itemx --strip
5695
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
118 ## Strip the output file.
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
119 ##
17170
d6499c14021c doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents: 16994
diff changeset
120 ## @item -v
6573
9180be9d3d08 [project @ 2007-04-25 04:27:16 by jwe]
jwe
parents: 6547
diff changeset
121 ## @itemx --verbose
5695
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
122 ## Echo commands as they are executed.
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
123 ##
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
124 ## @item file
9080
ec41eabf4499 Cleanup documentation files dynamic.texi, testfun.texi, tips.texi
Rik <rdrider0-list@yahoo.com>
parents: 9051
diff changeset
125 ## The file to compile or link. Recognized file types are
5695
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
126 ##
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
127 ## @example
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
128 ## @group
14327
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
129 ## .c C source
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
130 ## .cc C++ source
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
131 ## .C C++ source
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
132 ## .cpp C++ source
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
133 ## .f Fortran source (fixed form)
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
134 ## .F Fortran source (fixed form)
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
135 ## .f90 Fortran source (free form)
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
136 ## .F90 Fortran source (free form)
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
137 ## .o object file
4d917a6a858b doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
138 ## .a library file
9051
1bf0ce0930be Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents: 8920
diff changeset
139 ## @end group
5695
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
140 ## @end example
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
141 ##
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
142 ## @end table
5671
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
143 ## @end deftypefn
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
144
14121
6a59b271cd91 mkoctfile.m: Return the output and exit status from the mkoctfile shell command
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13025
diff changeset
145 function [output, status] = mkoctfile (varargin)
5671
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
146
21434
1da428cbf401 deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents: 20852
diff changeset
147 bindir = __octave_config_info__ ("bindir");
1da428cbf401 deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents: 20852
diff changeset
148 ext = __octave_config_info__ ("EXEEXT");
5696
70cc04f9af41 [project @ 2006-03-20 18:52:45 by jwe]
jwe
parents: 5695
diff changeset
149
19833
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
150 shell_script = fullfile (bindir,
9fc020886ae9 maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents: 19697
diff changeset
151 sprintf ("mkoctfile-%s%s", OCTAVE_VERSION, ext));
5696
70cc04f9af41 [project @ 2006-03-20 18:52:45 by jwe]
jwe
parents: 5695
diff changeset
152
17516
21656a949661 Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents: 17338
diff changeset
153 if (! exist (shell_script, "file"))
21656a949661 Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents: 17338
diff changeset
154 __gripe_missing_component__ ("mkoctfile", "mkoctfile");
21656a949661 Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents: 17338
diff changeset
155 endif
21656a949661 Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents: 17338
diff changeset
156
16994
333243133364 Use matrix concatenation for strings, rather than cstrcat(), for clarity and performance.
Rik <rik@octave.org>
parents: 16826
diff changeset
157 cmd = ['"' shell_script '"'];
5695
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
158 for i = 1:nargin
16994
333243133364 Use matrix concatenation for strings, rather than cstrcat(), for clarity and performance.
Rik <rik@octave.org>
parents: 16826
diff changeset
159 cmd = [cmd ' "' varargin{i} '"'];
5695
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
160 endfor
11587
c792872f8942 all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents: 11575
diff changeset
161
14121
6a59b271cd91 mkoctfile.m: Return the output and exit status from the mkoctfile shell command
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13025
diff changeset
162 [sys, out] = system (cmd);
5695
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
163
14121
6a59b271cd91 mkoctfile.m: Return the output and exit status from the mkoctfile shell command
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13025
diff changeset
164 if (nargout > 0)
6a59b271cd91 mkoctfile.m: Return the output and exit status from the mkoctfile shell command
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13025
diff changeset
165 [output, status] = deal (out, sys);
6a59b271cd91 mkoctfile.m: Return the output and exit status from the mkoctfile shell command
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13025
diff changeset
166 else
21634
96518f623c91 Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents: 21633
diff changeset
167 printf ("%s", out);
14121
6a59b271cd91 mkoctfile.m: Return the output and exit status from the mkoctfile shell command
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13025
diff changeset
168 endif
6a59b271cd91 mkoctfile.m: Return the output and exit status from the mkoctfile shell command
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 13025
diff changeset
169
17516
21656a949661 Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents: 17338
diff changeset
170 if (sys != 0)
22463
913e812ef11d mkoctfile.m: Suppress Octave side of backtrace if external compilation failed.
Rik <rik@octave.org>
parents: 22323
diff changeset
171 warning ("mkoctfile: building exited with failure status\n");
5695
f6ddb906e30f [project @ 2006-03-20 18:34:13 by jwe]
jwe
parents: 5671
diff changeset
172 endif
5671
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
173
387dd5b34757 [project @ 2006-03-15 20:10:45 by jwe]
jwe
parents:
diff changeset
174 endfunction