2000
|
1 # Makefile for octave's doc/interpreter directory |
152
|
2 # |
7016
|
3 # This file is part of Octave. |
|
4 # |
|
5 # Octave is free software; you can redistribute it and/or modify it |
|
6 # under the terms of the GNU General Public License as published by the |
|
7 # Free Software Foundation; either version 3 of the License, or (at |
|
8 # your option) any later version. |
|
9 # |
|
10 # Octave is distributed in the hope that it will be useful, but WITHOUT |
|
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 # for more details. |
|
14 # |
|
15 # You should have received a copy of the GNU General Public License |
|
16 # along with Octave; see the file COPYING. If not, see |
|
17 # <http://www.gnu.org/licenses/>. |
152
|
18 |
2000
|
19 TOPDIR = ../.. |
152
|
20 |
|
21 srcdir = @srcdir@ |
411
|
22 top_srcdir = @top_srcdir@ |
152
|
23 VPATH = @srcdir@ |
|
24 |
|
25 include $(TOPDIR)/Makeconf |
|
26 |
651
|
27 INSTALL = @INSTALL@ |
|
28 INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
|
29 INSTALL_DATA = @INSTALL_DATA@ |
|
30 |
6888
|
31 SCRIPT_SOURCES = sparseimages.m interpimages.m geometryimages.m plotimages.m |
6001
|
32 |
6577
|
33 EXAMPLE_FILES_NODIR = \ |
|
34 addtwomatrices.cc \ |
|
35 celldemo.cc \ |
|
36 firstmexdemo.c \ |
|
37 fortdemo.cc \ |
|
38 fortsub.f \ |
|
39 funcdemo.cc \ |
|
40 globaldemo.cc \ |
|
41 helloworld.cc \ |
6595
|
42 mycell.c \ |
|
43 myfeval.c \ |
|
44 myfunc.c \ |
|
45 mypow2.c \ |
|
46 mysparse.c \ |
|
47 mystring.c \ |
|
48 mystruct.c \ |
|
49 paramdemo.cc \ |
6577
|
50 stringdemo.cc \ |
|
51 structdemo.cc \ |
|
52 unwinddemo.cc |
|
53 |
|
54 EXAMPLE_FILES = $(addprefix $(top_srcdir)/examples/, $(EXAMPLE_FILES_NODIR)) |
|
55 |
6847
|
56 GEOMETRYIMAGES = voronoi triplot griddata convhull delaunay inpolygon |
6832
|
57 GEOMETRYIMAGES_EPS = $(addsuffix .eps, $(GEOMETRYIMAGES)) |
|
58 GEOMETRYIMAGES_PDF = $(addsuffix .pdf, $(GEOMETRYIMAGES)) |
|
59 GEOMETRYIMAGES_PNG = $(addsuffix .png, $(GEOMETRYIMAGES)) |
|
60 |
6888
|
61 PLOTIMAGES = plot hist errorbar polar mesh plot3 |
|
62 PLOTIMAGES_EPS = $(addsuffix .eps, $(PLOTIMAGES)) |
|
63 PLOTIMAGES_PDF = $(addsuffix .pdf, $(PLOTIMAGES)) |
|
64 PLOTIMAGES_PNG = $(addsuffix .png, $(PLOTIMAGES)) |
|
65 |
6743
|
66 INTERPIMAGES = interpft interpn interpderiv1 interpderiv2 |
6721
|
67 INTERPIMAGES_EPS = $(addsuffix .eps, $(INTERPIMAGES)) |
|
68 INTERPIMAGES_PDF = $(addsuffix .pdf, $(INTERPIMAGES)) |
|
69 INTERPIMAGES_PNG = $(addsuffix .png, $(INTERPIMAGES)) |
|
70 |
6001
|
71 SPARSEIMAGES_1 = gplot grid spmatrix spchol spcholperm |
|
72 SPARSEIMAGES_EPS = $(addsuffix .eps, $(SPARSEIMAGES_1)) |
|
73 SPARSEIMAGES_PDF = $(addsuffix .pdf, $(SPARSEIMAGES_1)) |
|
74 SPARSEIMAGES_PNG = $(addsuffix .png, $(SPARSEIMAGES_1)) |
|
75 SPARSEIMAGES_TXT = $(addsuffix .txt, $(SPARSEIMAGES_1)) |
|
76 |
6832
|
77 IMAGES_EPS = $(SPARSEIMAGES_EPS) $(INTERPIMAGES_EPS) \ |
6888
|
78 $(GEOMETRYIMAGES_EPS) $(PLOTIMAGES_EPS) |
6832
|
79 IMAGES_PDF = $(SPARSEIMAGES_PDF) $(INTERPIMAGES_PDF) \ |
6888
|
80 $(GEOMETRYIMAGES_PDF) $(PLOTIMAGES_PDF) |
6832
|
81 IMAGES_PNG = $(SPARSEIMAGES_PNG) $(INTERPIMAGES_PNG) \ |
6888
|
82 $(GEOMETRYIMAGES_PNG) $(PLOTIMAGES_PNG) |
6001
|
83 IMAGES_TXT = $(SPARSEIMAGES_TXT) |
6031
|
84 |
|
85 HTML_IMAGES_PNG = $(addprefix HTML/, $(IMAGES_PNG)) |
6366
|
86 |
6001
|
87 IMAGES = $(IMAGES_EPS) $(IMAGES_PDF) $(IMAGES_PNG) $(IMAGES_TXT) |
5648
|
88 |
6784
|
89 SUB_SOURCE := arith.txi audio.txi basics.txi bugs.txi \ |
4167
|
90 container.txi control.txi cp-idx.txi data.txi \ |
6569
|
91 debug.txi diffeq.txi dynamic.txi emacs.txi errors.txi eval.txi \ |
6559
|
92 expr.txi finance.txi fn-idx.txi func.txi geometry.txi gpl.txi \ |
6706
|
93 grammar.txi image.txi install.txi interp.txi \ |
6558
|
94 intro.txi io.txi linalg.txi matrix.txi nonlin.txi numbers.txi \ |
6537
|
95 op-idx.txi optim.txi package.txi plot.txi poly.txi preface.txi \ |
5164
|
96 quad.txi quaternion.txi set.txi signal.txi sparse.txi stats.txi \ |
6838
|
97 stmt.txi strings.txi system.txi testfun.txi tips.txi var.txi \ |
|
98 vr-idx.txi |
152
|
99 |
6572
|
100 SOURCES := $(SUB_SOURCE) $(SCRIPT_SOURCES) |
3294
|
101 |
3851
|
102 MAIN_TEXINFO := $(srcdir)/octave.texi |
3297
|
103 |
|
104 SUB_TEXINFO := $(SUB_SOURCE:.txi=.texi) |
|
105 |
6654
|
106 # Don't list ../conf.texi here. |
|
107 TEXINFO_SOURCE := $(MAIN_TEXINFO) $(SUB_TEXINFO) contributors.texi |
|
108 |
|
109 TEXINFO := $(TEXINFO_SOURCE) ../conf.texi |
152
|
110 |
6673
|
111 TEXI2DVICOMMAND = TEXINPUTS="..:$(srcdir):$(srcdir)/..:$(TEXINPUTS):" \ |
|
112 $(UNSETCOMSPEC) $(TEXI2DVI) $(MAIN_TEXINFO) --output $@ |
|
113 |
|
114 TEXI2PDFCOMMAND = TEXINPUTS="..:$(srcdir):$(srcdir)/..:$(TEXINPUTS):" \ |
|
115 $(UNSETCOMSPEC) $(TEXI2PDF) $(MAIN_TEXINFO) --output $@ |
|
116 |
|
117 FORMATTED = octave.info octave.pdf octave-a4.pdf octave.info-[0-9]* |
328
|
118 |
4339
|
119 MAN_BASE := mkoctfile octave octave-bug octave-config |
4149
|
120 MAN_SRC := $(addsuffix .1, $(MAN_BASE)) |
|
121 |
5775
|
122 # FIXME -- need to include generated figures here... |
6798
|
123 DISTFILES = $(addprefix $(srcdir)/, Makefile.in contributors.in \ |
|
124 mkcontrib.awk dir munge-texi.cc $(MAN_SRC) $(SOURCES) $(MAIN_TEXINFO)) \ |
|
125 $(SUB_TEXINFO) contributors.texi $(FORMATTED) $(IMAGES) |
299
|
126 |
5706
|
127 DISTDIRS = HTML |
|
128 |
6001
|
129 DISTSUBDIRS := |
5706
|
130 |
6001
|
131 SUBDIRS := |
5806
|
132 |
2624
|
133 # Look for version.h to get version information. |
|
134 xfiles := $(TOPDIR)/src/version.h $(srcdir)/$(TOPDIR)/src/version.h |
|
135 |
|
136 version_file := $(firstword $(foreach file, $(xfiles), $(wildcard $(file)))) |
|
137 |
2689
|
138 SPELL = $(patsubst %.texi, %.spell, $(TEXINFO)) |
152
|
139 |
|
140 %.spell : %.texi |
|
141 rm -f $@ |
4084
|
142 $(SED) -e 's/@@/ at /g' -e 's/@[a-zA-Z]*//g' $< | spell > $@.tmp |
152
|
143 mv $@.tmp $@ |
|
144 |
6673
|
145 all: octave.info octave.pdf octave-a4.pdf HTML/index.html |
152
|
146 .PHONY: all |
|
147 |
4098
|
148 $(TEXINFO): src-DOCSTRINGS scripts-DOCSTRINGS munge-texi$(BUILD_EXEEXT) |
3297
|
149 |
4298
|
150 munge-texi$(BUILD_EXEEXT): munge-texi.cc |
|
151 $(BUILD_CXX) $(BUILD_CXXFLAGS) -o $@ $^ $(BUILD_LDFLAGS) |
3313
|
152 |
4619
|
153 src-DOCSTRINGS: |
4093
|
154 $(MAKE) -C ../../src DOCSTRINGS |
|
155 .PHONY: src-DOCSTRINGS |
|
156 |
|
157 scripts-DOCSTRINGS: |
|
158 $(MAKE) -C ../../scripts DOCSTRINGS |
|
159 .PHONY: scripts-DOCSTRINGS |
3294
|
160 |
6535
|
161 contributors.texi: contributors.in |
|
162 $(AWK) -f $(srcdir)/mkcontrib.awk $(srcdir)/contributors.in > $@-t |
|
163 @$(simple-move-if-change-rule) |
|
164 |
|
165 $(SUB_TEXINFO) : %.texi : %.txi |
3364
|
166 @echo making $@ from $< |
|
167 @./munge-texi \ |
3294
|
168 -d $(TOPDIR)/src/DOCSTRINGS \ |
6152
|
169 -d $(TOPDIR)/scripts/DOCSTRINGS < $< > $@-t |
|
170 @$(simple-move-if-change-rule) |
3294
|
171 |
6577
|
172 octave.info: $(IMAGES_TXT) $(TEXINFO) $(EXAMPLE_FILES) |
6001
|
173 -$(MAKEINFO) -I.. -I$(srcdir) -I$(srcdir)/.. $(MAIN_TEXINFO) |
2000
|
174 |
6577
|
175 octave.dvi: $(IMAGES_EPS) $(TEXINFO) $(EXAMPLE_FILES) |
6116
|
176 -TEXINPUTS="..:$(srcdir):$(srcdir)/..:$(TEXINPUTS):" \ |
|
177 $(UNSETCOMSPEC) $(TEXI2DVI) $(MAIN_TEXINFO) |
2000
|
178 |
6673
|
179 octave-a4.dvi: $(IMAGES_EPS) $(TEXINFO) $(EXAMPLE_FILES) |
|
180 -$(TEXI2DVICOMMAND) -t @afourpaper |
|
181 |
|
182 octave-smallbook.dvi: $(IMAGES_EPS) $(TEXINFO) $(EXAMPLE_FILES) |
|
183 -$(TEXI2DVICOMMAND) -t @smallbook |
|
184 |
2000
|
185 octave.ps: octave.dvi |
5422
|
186 -dvips -o $@ $< |
2000
|
187 |
6673
|
188 octave-a4.ps: octave-a4.dvi |
|
189 -dvips -o $@ $< |
|
190 |
|
191 octave-smallbook.ps: octave-smallbook.dvi |
|
192 -dvips -o $@ $< |
|
193 |
6577
|
194 octave.pdf: $(IMAGES_PDF) $(TEXINFO) $(EXAMPLE_FILES) |
6673
|
195 -$(TEXI2PDFCOMMAND) |
|
196 |
|
197 octave-a4.pdf: $(IMAGES_PDF) $(TEXINFO) $(EXAMPLE_FILES) |
|
198 -$(TEXI2PDFCOMMAND) -t @afourpaper |
|
199 |
|
200 octave-smallbook.pdf: $(IMAGES_PDF) $(TEXINFO) $(EXAMPLE_FILES) |
|
201 -$(TEXI2PDFCOMMAND) -t @smallbook |
5151
|
202 |
2627
|
203 ../../INSTALL.OCTAVE: install.texi |
3176
|
204 rm -f INSTALL |
5151
|
205 -$(MAKEINFO) -D INSTALLONLY \ |
3176
|
206 --no-validate --no-headers --no-split --output INSTALL \ |
5650
|
207 -I.. -I$(srcdir) -I$(srcdir)/.. $< |
2001
|
208 mv INSTALL ../../INSTALL.OCTAVE |
2000
|
209 |
2627
|
210 ../../BUGS: bugs.texi |
3176
|
211 rm -f BUGS |
5151
|
212 -$(MAKEINFO) -D BUGSONLY \ |
3176
|
213 --no-validate --no-headers --no-split --output BUGS \ |
5650
|
214 -I.. -I$(srcdir) -I$(srcdir)/.. $< |
2001
|
215 mv BUGS ../../BUGS |
2000
|
216 |
6577
|
217 HTML/index.html: $(HTML_IMAGES_PNG) $(TEXINFO) $(EXAMPLE_FILES) |
6001
|
218 -$(MAKEINFO) --html --ifinfo --output=HTML -I.. -I$(srcdir) -I$(srcdir)/.. $(MAIN_TEXINFO) |
5708
|
219 |
6031
|
220 $(HTML_IMAGES_PNG): HTML/%.png : %.png |
|
221 @if [ -d HTML ]; then \ |
|
222 true; \ |
|
223 else \ |
|
224 echo "creating HTML directory"; \ |
|
225 mkdir HTML; \ |
|
226 fi |
6669
|
227 cp $(filter-out html-dir, $<) HTML |
3189
|
228 |
6798
|
229 ## Sleep for a second after plotting to allow gnuplot to finish |
|
230 ## writing its output before Octave exits. |
6001
|
231 define run-octave |
6798
|
232 $(TOPDIR)/run-octave -f -q -H -p $(srcdir) \ |
6126
|
233 --eval "$(notdir $(basename $<)) ('$(notdir $(basename $@))', '$(patsubst .%,%, $(suffix $@))'); sleep (1);" |
6001
|
234 endef |
|
235 |
6832
|
236 $(GEOMETRYIMAGES_EPS) $(GEOMETRYIMAGES_PNG) $(GEOMETRYIMAGES_TXT): geometryimages.m |
|
237 $(run-octave) |
|
238 |
6888
|
239 $(PLOTIMAGES_EPS) $(PLOTIMAGES_PNG) $(PLOTIMAGES_TXT): plotimages.m |
|
240 $(run-octave) |
|
241 |
6858
|
242 $(INTERPIMAGES_EPS) $(INTERPIMAGES_PNG) $(INTERPIMAGES_TXT): interpimages.m |
6721
|
243 $(run-octave) |
|
244 |
6001
|
245 $(SPARSEIMAGES_EPS) $(SPARSEIMAGES_PNG) $(SPARSEIMAGES_TXT): sparseimages.m |
|
246 $(run-octave) |
|
247 |
|
248 $(IMAGES_PDF) : %.pdf : %.eps |
|
249 if [ -f $< ] ; then $(GHOSTSCRIPT) -dBATCH -dEPSCrop -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$@ $< ; fi |
|
250 |
152
|
251 check: all |
|
252 .PHONY: check |
|
253 |
5866
|
254 install install-strip: all |
5806
|
255 @$(subdir-for-command) |
4413
|
256 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(man1dir) $(DESTDIR)$(infodir) |
|
257 @if test -d $(DESTDIR)$(man1dir); then \ |
4149
|
258 for f in $(MAN_BASE); do \ |
4413
|
259 rm -f $(DESTDIR)$(man1dir)/$$f$(man1ext); \ |
|
260 echo "installing $(srcdir)/$$f.1 in $(DESTDIR)$(man1dir)"; \ |
|
261 $(INSTALL_DATA) $(srcdir)/$$f.1 $(DESTDIR)$(man1dir)/$$f$(man1ext); \ |
4149
|
262 done ; \ |
979
|
263 fi |
4413
|
264 @if test -d $(DESTDIR)$(infodir); then \ |
|
265 rm -f $(DESTDIR)$(infodir)/octave.info*; \ |
|
266 echo "installing info files in $(DESTDIR)$(infodir)"; \ |
3028
|
267 if test -f octave.info; then \ |
|
268 for f in octave.info*; do \ |
4413
|
269 $(INSTALL_DATA) $$f $(DESTDIR)$(infodir)/$$f; \ |
3028
|
270 done; \ |
152
|
271 else \ |
3028
|
272 for f in $(srcdir)/octave.info*; do \ |
4413
|
273 $(INSTALL_DATA) $$f $(DESTDIR)$(infodir)/`basename $$f`; \ |
3028
|
274 done; \ |
|
275 fi; \ |
4413
|
276 if test -f $(DESTDIR)$(infodir)/dir; then \ |
|
277 if grep "^\* Octave: (octave)." $(DESTDIR)$(infodir)/dir > /dev/null; then \ |
3028
|
278 true; \ |
980
|
279 else \ |
3028
|
280 echo ""; \ |
|
281 echo "You should add the following entry"; \ |
|
282 echo ""; \ |
|
283 echo "* Octave: (octave)."; \ |
|
284 echo " Interactive language for numerical computations."; \ |
|
285 echo ""; \ |
4413
|
286 echo "to $(DESTDIR)$(infodir)/dir."; \ |
3028
|
287 echo ""; \ |
|
288 fi; \ |
976
|
289 else \ |
4413
|
290 echo "installing $(srcdir)/dir in $(DESTDIR)$(infodir)"; \ |
|
291 $(INSTALL_DATA) $(srcdir)/dir $(DESTDIR)$(infodir)/dir; \ |
3028
|
292 fi; \ |
152
|
293 fi |
5866
|
294 .PHONY: install install-strip |
152
|
295 |
5866
|
296 uninstall: |
|
297 @$(subdir-for-command) |
4149
|
298 rm -f $(infodir)/octave.info* |
4413
|
299 for f in $(MAN_BASE); do rm -f $(DESTDIR)$(man1dir)/$$f$(man1ext); done |
5866
|
300 .PHONY: uninstall |
152
|
301 |
|
302 tags: $(SOURCES) |
|
303 ctags $(SOURCES) |
|
304 |
|
305 TAGS: $(SOURCES) |
|
306 etags $(SOURCES) |
|
307 |
|
308 spell: $(SPELL) |
|
309 .PHONY: spell |
|
310 |
5866
|
311 mostlyclean clean: |
|
312 @$(subdir-for-command) |
1458
|
313 rm -f octave.cp octave.fn octave.in \ |
349
|
314 octave.ky octave.op octave.pg octave.rd octave.tp octave.vr \ |
|
315 octave.cps octave.fns octave.ins octave.kys octave.ops \ |
|
316 octave.pgs octave.rds octave.tps octave.vrs octave.aux \ |
3601
|
317 octave.log octave.toc \ |
5866
|
318 munge-texi$(BUILD_EXEEXT) munge-texi.o |
|
319 .PHONY: mostlyclean clean |
152
|
320 |
5866
|
321 distclean: clean |
|
322 @$(subdir-for-command) |
3601
|
323 rm -f Makefile |
5866
|
324 .PHONY: distclean |
152
|
325 |
6673
|
326 maintainer-clean: clean clean-texi |
6001
|
327 rm -f Makefile tags TAGS $(FORMATTED) $(IMAGES) |
5422
|
328 rm -rf HTML |
5866
|
329 .PHONY: maintainer-clean |
152
|
330 |
3315
|
331 clean-texi: |
6535
|
332 rm -f $(SUB_TEXINFO) contributors.texi |
3315
|
333 .PHONY: clean-texi |
|
334 |
|
335 dist: clean-texi all |
6467
|
336 ln $(DISTFILES) ../../`cat ../../.fname`/doc/interpreter |
6798
|
337 for dir in $(DISTDIRS); do \ |
|
338 mkdir ../../`cat ../../.fname`/doc/interpreter/$$dir; \ |
|
339 ln ../../doc/interpreter/$$dir/* ../../`cat ../../.fname`/doc/interpreter/$$dir; \ |
|
340 done |
5706
|
341 for dir in $(DISTSUBDIRS); do mkdir ../../`cat ../../.fname`/doc/interpreter/$$dir; $(MAKE) -C $$dir $@; done |
152
|
342 .PHONY: dist |