Mercurial > octave
annotate scripts/miscellaneous/mkoctfile.m @ 28020:eb46a9f47164 stable release-5-2-0
Avoid color changes in MS Windows GUI terminal (bug #57658).
* scripts/miscellaneous/mkoctfile.m: Add the gcc compiler flag
"-fdiagnostics-color=never" in case of MS Windows and the GUI is running.
For the MS Windows CLI version the output looks very nice. Update year.
author | Kai T. Ohlhus <k.ohlhus@gmail.com> |
---|---|
date | Tue, 28 Jan 2020 10:57:35 +0900 |
parents | 86bcab2e371e |
children | 8933b2985dd5 |
rev | line source |
---|---|
28020
eb46a9f47164
Avoid color changes in MS Windows GUI terminal (bug #57658).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26472
diff
changeset
|
1 ## Copyright (C) 2006-2020 Keith Goodman |
5671 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23492
diff
changeset
|
5 ## Octave is free software: you can redistribute it and/or modify it |
5671 | 6 ## under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23492
diff
changeset
|
7 ## the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22463
diff
changeset
|
8 ## (at your option) any later version. |
5671 | 9 ## |
10 ## Octave is distributed in the hope that it will be useful, but | |
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 | 14 ## |
15 ## You should have received a copy of the GNU General Public License | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23492
diff
changeset
|
17 ## <https://www.gnu.org/licenses/>. |
5671 | 18 |
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 | 25 ## compiled code can be called within Octave or can be used as a stand-alone |
26 ## application. | |
27 ## | |
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 | 32 ## |
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 | 35 ## |
36 ## @table @samp | |
37 ## @item -I DIR | |
38 ## Add the include directory DIR to compile commands. | |
39 ## | |
40 ## @item -D DEF | |
41 ## Add the definition DEF to the compiler call. | |
42 ## | |
43 ## @item -l LIB | |
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 | 46 ## @item -L DIR |
47 ## Add the library directory DIR to the link command. | |
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 | 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{}} |
23491
16d77dc05af6
doc: fix typo 'to the linker' not 'though the linker'
Carnë Draug <carandraug@octave.org>
parents:
23220
diff
changeset
|
57 ## Pass options to 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{} |
23492
cc5e92e3182b
doc: fix typos 'to the assembler' not 'though the compiler'
Carnë Draug <carandraug@octave.org>
parents:
23491
diff
changeset
|
62 ## Pass options to the assembler 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 | 64 ## @item -c |
65 ## Compile but do not link. | |
66 ## | |
5904 | 67 ## @item -g |
68 ## Enable debugging options for compilers. | |
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 | 74 ## |
17170
d6499c14021c
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
16994
diff
changeset
|
75 ## @item -p VAR |
6573 | 76 ## @itemx --print VAR |
26232
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
77 ## Print configuration variable VAR@. There are three categories of |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
78 ## variables: |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
79 ## |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
80 ## Octave configuration variables that users may override with environment |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
81 ## variables. These are used in commands that @code{mkoctfile} executes. |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
82 ## |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
83 ## @example |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
84 ## ALL_CFLAGS LAPACK_LIBS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
85 ## ALL_CXXFLAGS LDFLAGS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
86 ## ALL_FFLAGS LD_CXX |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
87 ## ALL_LDFLAGS LD_STATIC_FLAG |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
88 ## BLAS_LIBS LFLAGS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
89 ## CC LIBDIR |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
90 ## CFLAGS LIBOCTAVE |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
91 ## CPICFLAG LIBOCTINTERP |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
92 ## CPPFLAGS OCTAVE_LINK_OPTS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
93 ## CXX OCTINCLUDEDIR |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
94 ## CXXFLAGS OCTAVE_LIBS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
95 ## CXXPICFLAG OCTAVE_LINK_DEPS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
96 ## DL_LD OCTLIBDIR |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
97 ## DL_LDFLAGS OCT_LINK_DEPS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
98 ## F77 OCT_LINK_OPTS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
99 ## F77_INTEGER8_FLAG RDYNAMIC_FLAG |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
100 ## FFLAGS SPECIAL_MATH_LIB |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
101 ## FPICFLAG XTRA_CFLAGS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
102 ## INCFLAGS XTRA_CXXFLAGS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
103 ## INCLUDEDIR |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
104 ## @end example |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
105 ## |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
106 ## Octave configuration variables as above, but currently unused by |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
107 ## @code{mkoctfile}. |
5671 | 108 ## |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11575
diff
changeset
|
109 ## @example |
26293
095eb3a04f43
doc: grammarcheck m-file scripts ahead of 5.0 release.
Rik <rik@octave.org>
parents:
26232
diff
changeset
|
110 ## @group |
26232
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
111 ## AR |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
112 ## DEPEND_EXTRA_SED_PATTERN |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
113 ## DEPEND_FLAGS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
114 ## FFTW3F_LDFLAGS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
115 ## FFTW3F_LIBS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
116 ## FFTW3_LDFLAGS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
117 ## FFTW3_LIBS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
118 ## FFTW_LIBS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
119 ## FLIBS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
120 ## LIBS |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
121 ## RANLIB |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
122 ## READLINE_LIBS |
26293
095eb3a04f43
doc: grammarcheck m-file scripts ahead of 5.0 release.
Rik <rik@octave.org>
parents:
26232
diff
changeset
|
123 ## @end group |
26232
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
124 ## @end example |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
125 ## |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
126 ## Octave configuration variables that are provided for informational |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
127 ## purposes only. Except for @samp{OCTAVE_HOME} and @samp{OCTAVE_EXEC_HOME}, |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
128 ## users may not override these variables. |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
129 ## |
26293
095eb3a04f43
doc: grammarcheck m-file scripts ahead of 5.0 release.
Rik <rik@octave.org>
parents:
26232
diff
changeset
|
130 ## If @w{@env{OCTAVE_HOME}} or @w{@env{OCTAVE_EXEC_HOME}} are set in the |
095eb3a04f43
doc: grammarcheck m-file scripts ahead of 5.0 release.
Rik <rik@octave.org>
parents:
26232
diff
changeset
|
131 ## environment, then other variables are adjusted accordingly with |
095eb3a04f43
doc: grammarcheck m-file scripts ahead of 5.0 release.
Rik <rik@octave.org>
parents:
26232
diff
changeset
|
132 ## @w{@env{OCTAVE_HOME}} or @w{@env{OCTAVE_EXEC_HOME}} substituted for the |
095eb3a04f43
doc: grammarcheck m-file scripts ahead of 5.0 release.
Rik <rik@octave.org>
parents:
26232
diff
changeset
|
133 ## original value of the directory specified by the @option{--prefix} or |
095eb3a04f43
doc: grammarcheck m-file scripts ahead of 5.0 release.
Rik <rik@octave.org>
parents:
26232
diff
changeset
|
134 ## @option{--exec-prefix} options that were used when Octave was configured. |
26232
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
135 ## |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
136 ## @example |
26293
095eb3a04f43
doc: grammarcheck m-file scripts ahead of 5.0 release.
Rik <rik@octave.org>
parents:
26232
diff
changeset
|
137 ## @group |
26232
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
138 ## API_VERSION LOCALFCNFILEDIR |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
139 ## ARCHLIBDIR LOCALOCTFILEDIR |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
140 ## BINDIR LOCALSTARTUPFILEDIR |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
141 ## CANONICAL_HOST_TYPE LOCALVERARCHLIBDIR |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
142 ## DATADIR LOCALVERFCNFILEDIR |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
143 ## DATAROOTDIR LOCALVEROCTFILEDIR |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
144 ## DEFAULT_PAGER MAN1DIR |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
145 ## EXEC_PREFIX MAN1EXT |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
146 ## EXEEXT MANDIR |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
147 ## FCNFILEDIR OCTAVE_EXEC_HOME |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
148 ## IMAGEDIR OCTAVE_HOME |
26472
86bcab2e371e
mkoctfile: use OCTAVE_VERSION instead of VERSION for API consistency
Mike Miller <mtmiller@octave.org>
parents:
26376
diff
changeset
|
149 ## INFODIR OCTAVE_VERSION |
86bcab2e371e
mkoctfile: use OCTAVE_VERSION instead of VERSION for API consistency
Mike Miller <mtmiller@octave.org>
parents:
26376
diff
changeset
|
150 ## INFOFILE OCTDATADIR |
86bcab2e371e
mkoctfile: use OCTAVE_VERSION instead of VERSION for API consistency
Mike Miller <mtmiller@octave.org>
parents:
26376
diff
changeset
|
151 ## LIBEXECDIR OCTDOCDIR |
86bcab2e371e
mkoctfile: use OCTAVE_VERSION instead of VERSION for API consistency
Mike Miller <mtmiller@octave.org>
parents:
26376
diff
changeset
|
152 ## LOCALAPIARCHLIBDIR OCTFILEDIR |
86bcab2e371e
mkoctfile: use OCTAVE_VERSION instead of VERSION for API consistency
Mike Miller <mtmiller@octave.org>
parents:
26376
diff
changeset
|
153 ## LOCALAPIFCNFILEDIR OCTFONTSDIR |
86bcab2e371e
mkoctfile: use OCTAVE_VERSION instead of VERSION for API consistency
Mike Miller <mtmiller@octave.org>
parents:
26376
diff
changeset
|
154 ## LOCALAPIOCTFILEDIR STARTUPFILEDIR |
26232
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
155 ## LOCALARCHLIBDIR |
26293
095eb3a04f43
doc: grammarcheck m-file scripts ahead of 5.0 release.
Rik <rik@octave.org>
parents:
26232
diff
changeset
|
156 ## @end group |
5695 | 157 ## @end example |
5671 | 158 ## |
5745 | 159 ## @item --link-stand-alone |
160 ## Link a stand-alone executable file. | |
161 ## | |
5904 | 162 ## @item --mex |
20164
df437a52bcaf
doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents:
19833
diff
changeset
|
163 ## 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
|
164 ## ".mex". |
5904 | 165 ## |
17170
d6499c14021c
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
16994
diff
changeset
|
166 ## @item -s |
6573 | 167 ## @itemx --strip |
5695 | 168 ## Strip the output file. |
169 ## | |
17170
d6499c14021c
doc: Periodic grammarcheck of documentation.
Rik <rik@octave.org>
parents:
16994
diff
changeset
|
170 ## @item -v |
6573 | 171 ## @itemx --verbose |
5695 | 172 ## Echo commands as they are executed. |
173 ## | |
174 ## @item file | |
26232
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
175 ## The file to compile or link. Recognized file types are: |
5695 | 176 ## |
177 ## @example | |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
178 ## @group |
14327
4d917a6a858b
doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
179 ## .c C source |
4d917a6a858b
doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
180 ## .cc C++ source |
26232
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
181 ## .cp C++ source |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
182 ## .cpp C++ source |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
183 ## .CPP C++ source |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
184 ## .cxx C++ source |
90487d5431cc
doc: bring mkoctfile command doc strings into agreement
Mike Miller <mtmiller@octave.org>
parents:
26229
diff
changeset
|
185 ## .c++ C++ source |
14327
4d917a6a858b
doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
186 ## .C C++ source |
4d917a6a858b
doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
187 ## .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
|
188 ## .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
|
189 ## .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
|
190 ## .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
|
191 ## .o object file |
4d917a6a858b
doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
192 ## .a library file |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
8920
diff
changeset
|
193 ## @end group |
5695 | 194 ## @end example |
195 ## | |
196 ## @end table | |
5671 | 197 ## @end deftypefn |
198 | |
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
|
199 function [output, status] = mkoctfile (varargin) |
5671 | 200 |
21434
1da428cbf401
deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents:
20852
diff
changeset
|
201 bindir = __octave_config_info__ ("bindir"); |
1da428cbf401
deprecate octave_config_info
John W. Eaton <jwe@octave.org>
parents:
20852
diff
changeset
|
202 ext = __octave_config_info__ ("EXEEXT"); |
5696 | 203 |
19833
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
204 shell_script = fullfile (bindir, |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
205 sprintf ("mkoctfile-%s%s", OCTAVE_VERSION, ext)); |
5696 | 206 |
17516
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
17338
diff
changeset
|
207 if (! exist (shell_script, "file")) |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
17338
diff
changeset
|
208 __gripe_missing_component__ ("mkoctfile", "mkoctfile"); |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
17338
diff
changeset
|
209 endif |
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
17338
diff
changeset
|
210 |
16994
333243133364
Use matrix concatenation for strings, rather than cstrcat(), for clarity and performance.
Rik <rik@octave.org>
parents:
16826
diff
changeset
|
211 cmd = ['"' shell_script '"']; |
28020
eb46a9f47164
Avoid color changes in MS Windows GUI terminal (bug #57658).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26472
diff
changeset
|
212 if (ispc () && isguirunning ()) |
eb46a9f47164
Avoid color changes in MS Windows GUI terminal (bug #57658).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26472
diff
changeset
|
213 ## FIXME: Remove this branch when the MS Windows GUI terminal widget can |
eb46a9f47164
Avoid color changes in MS Windows GUI terminal (bug #57658).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26472
diff
changeset
|
214 ## properly handle colors (bug #57658). |
eb46a9f47164
Avoid color changes in MS Windows GUI terminal (bug #57658).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26472
diff
changeset
|
215 cmd = [cmd ' "-fdiagnostics-color=never"']; |
eb46a9f47164
Avoid color changes in MS Windows GUI terminal (bug #57658).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents:
26472
diff
changeset
|
216 endif |
5695 | 217 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
|
218 cmd = [cmd ' "' varargin{i} '"']; |
5695 | 219 endfor |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11575
diff
changeset
|
220 |
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
|
221 [sys, out] = system (cmd); |
5695 | 222 |
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
|
223 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
|
224 [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
|
225 else |
21634
96518f623c91
Backed out changeset dcf8922b724b
Mike Miller <mtmiller@octave.org>
parents:
21633
diff
changeset
|
226 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
|
227 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
|
228 |
17516
21656a949661
Add hook function to handle missing Octave components
Mike Miller <mtmiller@ieee.org>
parents:
17338
diff
changeset
|
229 if (sys != 0) |
22463
913e812ef11d
mkoctfile.m: Suppress Octave side of backtrace if external compilation failed.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
230 warning ("mkoctfile: building exited with failure status\n"); |
5695 | 231 endif |
5671 | 232 |
233 endfunction |