152
|
1 # |
2000
|
2 # Makefile for octave's doc/interpreter directory |
152
|
3 # |
|
4 # John W. Eaton |
1452
|
5 # jwe@bevo.che.wisc.edu |
|
6 # University of Wisconsin-Madison |
152
|
7 # Department of Chemical Engineering |
|
8 |
2000
|
9 TOPDIR = ../.. |
152
|
10 |
|
11 srcdir = @srcdir@ |
411
|
12 top_srcdir = @top_srcdir@ |
152
|
13 VPATH = @srcdir@ |
|
14 |
|
15 include $(TOPDIR)/Makeconf |
|
16 |
651
|
17 INSTALL = @INSTALL@ |
|
18 INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
|
19 INSTALL_DATA = @INSTALL_DATA@ |
|
20 |
6001
|
21 SCRIPT_SOURCES = sparseimages.m |
|
22 |
6577
|
23 EXAMPLE_FILES_NODIR = \ |
|
24 addtwomatrices.cc \ |
|
25 celldemo.cc \ |
|
26 firstmexdemo.c \ |
|
27 fortdemo.cc \ |
|
28 fortsub.f \ |
|
29 funcdemo.cc \ |
|
30 globaldemo.cc \ |
|
31 helloworld.cc \ |
6595
|
32 mycell.c \ |
|
33 myfeval.c \ |
|
34 myfunc.c \ |
|
35 mypow2.c \ |
|
36 mysparse.c \ |
|
37 mystring.c \ |
|
38 mystruct.c \ |
|
39 paramdemo.cc \ |
6577
|
40 stringdemo.cc \ |
|
41 structdemo.cc \ |
|
42 unwinddemo.cc |
|
43 |
|
44 EXAMPLE_FILES = $(addprefix $(top_srcdir)/examples/, $(EXAMPLE_FILES_NODIR)) |
|
45 |
6001
|
46 SPARSEIMAGES_1 = gplot grid spmatrix spchol spcholperm |
|
47 |
|
48 SPARSEIMAGES_EPS = $(addsuffix .eps, $(SPARSEIMAGES_1)) |
|
49 SPARSEIMAGES_PDF = $(addsuffix .pdf, $(SPARSEIMAGES_1)) |
|
50 SPARSEIMAGES_PNG = $(addsuffix .png, $(SPARSEIMAGES_1)) |
|
51 SPARSEIMAGES_TXT = $(addsuffix .txt, $(SPARSEIMAGES_1)) |
|
52 |
|
53 IMAGES_EPS = $(SPARSEIMAGES_EPS) |
|
54 IMAGES_PDF = $(SPARSEIMAGES_PDF) |
|
55 IMAGES_PNG = $(SPARSEIMAGES_PNG) |
|
56 IMAGES_TXT = $(SPARSEIMAGES_TXT) |
6031
|
57 |
|
58 HTML_IMAGES_PNG = $(addprefix HTML/, $(IMAGES_PNG)) |
6366
|
59 |
6001
|
60 IMAGES = $(IMAGES_EPS) $(IMAGES_PDF) $(IMAGES_PNG) $(IMAGES_TXT) |
5648
|
61 |
6549
|
62 SUB_SOURCE := arith.txi audio.txi basics.txi bit.txi bugs.txi \ |
4167
|
63 container.txi control.txi cp-idx.txi data.txi \ |
6569
|
64 debug.txi diffeq.txi dynamic.txi emacs.txi errors.txi eval.txi \ |
6559
|
65 expr.txi finance.txi fn-idx.txi func.txi geometry.txi gpl.txi \ |
6558
|
66 grammar.txi hashing.txi image.txi install.txi interp.txi \ |
|
67 intro.txi io.txi linalg.txi matrix.txi nonlin.txi numbers.txi \ |
6537
|
68 op-idx.txi optim.txi package.txi plot.txi poly.txi preface.txi \ |
5164
|
69 quad.txi quaternion.txi set.txi signal.txi sparse.txi stats.txi \ |
6529
|
70 stmt.txi strings.txi struct.txi system.txi \ |
5582
|
71 testfun.txi tips.txi var.txi vr-idx.txi |
152
|
72 |
6572
|
73 SOURCES := $(SUB_SOURCE) $(SCRIPT_SOURCES) |
3294
|
74 |
3851
|
75 MAIN_TEXINFO := $(srcdir)/octave.texi |
3297
|
76 |
|
77 SUB_TEXINFO := $(SUB_SOURCE:.txi=.texi) |
|
78 |
6535
|
79 TEXINFO := $(MAIN_TEXINFO) $(SUB_TEXINFO) contributors.texi ../conf.texi |
152
|
80 |
5151
|
81 FORMATTED = octave.dvi octave.ps octave.pdf \ |
5706
|
82 octave.info octave.info-[0-9]* |
328
|
83 |
4339
|
84 MAN_BASE := mkoctfile octave octave-bug octave-config |
4149
|
85 MAN_SRC := $(addsuffix .1, $(MAN_BASE)) |
|
86 |
5775
|
87 # FIXME -- need to include generated figures here... |
6650
|
88 DISTFILES = Makefile.in contributors.in mkcontrib.awk dir \ |
|
89 munge-texi.cc $(MAN_SRC) $(SOURCES) $(TEXINFO) $(FORMATTED) $(IMAGES) |
299
|
90 |
5706
|
91 DISTDIRS = HTML |
|
92 |
6001
|
93 DISTSUBDIRS := |
5706
|
94 |
6001
|
95 SUBDIRS := |
5806
|
96 |
2624
|
97 # Look for version.h to get version information. |
|
98 xfiles := $(TOPDIR)/src/version.h $(srcdir)/$(TOPDIR)/src/version.h |
|
99 |
|
100 version_file := $(firstword $(foreach file, $(xfiles), $(wildcard $(file)))) |
|
101 |
2689
|
102 SPELL = $(patsubst %.texi, %.spell, $(TEXINFO)) |
152
|
103 |
|
104 %.spell : %.texi |
|
105 rm -f $@ |
4084
|
106 $(SED) -e 's/@@/ at /g' -e 's/@[a-zA-Z]*//g' $< | spell > $@.tmp |
152
|
107 mv $@.tmp $@ |
|
108 |
5422
|
109 all: octave.info octave.dvi octave.ps octave.pdf HTML/index.html |
152
|
110 .PHONY: all |
|
111 |
4098
|
112 $(TEXINFO): src-DOCSTRINGS scripts-DOCSTRINGS munge-texi$(BUILD_EXEEXT) |
3297
|
113 |
4298
|
114 munge-texi$(BUILD_EXEEXT): munge-texi.cc |
|
115 $(BUILD_CXX) $(BUILD_CXXFLAGS) -o $@ $^ $(BUILD_LDFLAGS) |
3313
|
116 |
4619
|
117 src-DOCSTRINGS: |
4093
|
118 $(MAKE) -C ../../src DOCSTRINGS |
|
119 .PHONY: src-DOCSTRINGS |
|
120 |
|
121 scripts-DOCSTRINGS: |
|
122 $(MAKE) -C ../../scripts DOCSTRINGS |
|
123 .PHONY: scripts-DOCSTRINGS |
3294
|
124 |
6535
|
125 contributors.texi: contributors.in |
|
126 $(AWK) -f $(srcdir)/mkcontrib.awk $(srcdir)/contributors.in > $@-t |
|
127 @$(simple-move-if-change-rule) |
|
128 |
|
129 $(SUB_TEXINFO) : %.texi : %.txi |
3364
|
130 @echo making $@ from $< |
|
131 @./munge-texi \ |
3294
|
132 -d $(TOPDIR)/src/DOCSTRINGS \ |
6152
|
133 -d $(TOPDIR)/scripts/DOCSTRINGS < $< > $@-t |
|
134 @$(simple-move-if-change-rule) |
3294
|
135 |
6577
|
136 octave.info: $(IMAGES_TXT) $(TEXINFO) $(EXAMPLE_FILES) |
6001
|
137 -$(MAKEINFO) -I.. -I$(srcdir) -I$(srcdir)/.. $(MAIN_TEXINFO) |
2000
|
138 |
6577
|
139 octave.dvi: $(IMAGES_EPS) $(TEXINFO) $(EXAMPLE_FILES) |
6116
|
140 -TEXINPUTS="..:$(srcdir):$(srcdir)/..:$(TEXINPUTS):" \ |
|
141 $(UNSETCOMSPEC) $(TEXI2DVI) $(MAIN_TEXINFO) |
2000
|
142 |
|
143 octave.ps: octave.dvi |
5422
|
144 -dvips -o $@ $< |
2000
|
145 |
6577
|
146 octave.pdf: $(IMAGES_PDF) $(TEXINFO) $(EXAMPLE_FILES) |
6116
|
147 -TEXINPUTS="..:$(srcdir):$(srcdir)/..:$(TEXINPUTS):" \ |
|
148 $(UNSETCOMSPEC) $(TEXI2PDF) $(MAIN_TEXINFO) |
5151
|
149 |
2627
|
150 ../../INSTALL.OCTAVE: install.texi |
3176
|
151 rm -f INSTALL |
5151
|
152 -$(MAKEINFO) -D INSTALLONLY \ |
3176
|
153 --no-validate --no-headers --no-split --output INSTALL \ |
5650
|
154 -I.. -I$(srcdir) -I$(srcdir)/.. $< |
2001
|
155 mv INSTALL ../../INSTALL.OCTAVE |
2000
|
156 |
2627
|
157 ../../BUGS: bugs.texi |
3176
|
158 rm -f BUGS |
5151
|
159 -$(MAKEINFO) -D BUGSONLY \ |
3176
|
160 --no-validate --no-headers --no-split --output BUGS \ |
5650
|
161 -I.. -I$(srcdir) -I$(srcdir)/.. $< |
2001
|
162 mv BUGS ../../BUGS |
2000
|
163 |
6577
|
164 HTML/index.html: $(HTML_IMAGES_PNG) $(TEXINFO) $(EXAMPLE_FILES) |
6001
|
165 -$(MAKEINFO) --html --ifinfo --output=HTML -I.. -I$(srcdir) -I$(srcdir)/.. $(MAIN_TEXINFO) |
5708
|
166 |
6031
|
167 $(HTML_IMAGES_PNG): HTML/%.png : %.png |
|
168 @if [ -d HTML ]; then \ |
|
169 true; \ |
|
170 else \ |
|
171 echo "creating HTML directory"; \ |
|
172 mkdir HTML; \ |
|
173 fi |
|
174 $(INSTALL_DATA) $(filter-out html-dir, $<) HTML |
3189
|
175 |
6116
|
176 ## Unset DISPLAY here to avoid problems with the -title option for |
6126
|
177 ## gnuplot (it doesn't work if we are calling pgnuplot). Sleep for |
|
178 ## a second to allow gnuplot to finish writing its output before |
|
179 ## Octave exits. |
6001
|
180 define run-octave |
6116
|
181 DISPLAY= $(TOPDIR)/run-octave -f -q -H -p $(srcdir) \ |
6126
|
182 --eval "$(notdir $(basename $<)) ('$(notdir $(basename $@))', '$(patsubst .%,%, $(suffix $@))'); sleep (1);" |
6001
|
183 endef |
|
184 |
|
185 $(SPARSEIMAGES_EPS) $(SPARSEIMAGES_PNG) $(SPARSEIMAGES_TXT): sparseimages.m |
|
186 $(run-octave) |
|
187 |
|
188 $(IMAGES_PDF) : %.pdf : %.eps |
|
189 if [ -f $< ] ; then $(GHOSTSCRIPT) -dBATCH -dEPSCrop -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$@ $< ; fi |
|
190 |
152
|
191 check: all |
|
192 .PHONY: check |
|
193 |
5866
|
194 install install-strip: all |
5806
|
195 @$(subdir-for-command) |
4413
|
196 $(top_srcdir)/mkinstalldirs $(DESTDIR)$(man1dir) $(DESTDIR)$(infodir) |
|
197 @if test -d $(DESTDIR)$(man1dir); then \ |
4149
|
198 for f in $(MAN_BASE); do \ |
4413
|
199 rm -f $(DESTDIR)$(man1dir)/$$f$(man1ext); \ |
|
200 echo "installing $(srcdir)/$$f.1 in $(DESTDIR)$(man1dir)"; \ |
|
201 $(INSTALL_DATA) $(srcdir)/$$f.1 $(DESTDIR)$(man1dir)/$$f$(man1ext); \ |
4149
|
202 done ; \ |
979
|
203 fi |
4413
|
204 @if test -d $(DESTDIR)$(infodir); then \ |
|
205 rm -f $(DESTDIR)$(infodir)/octave.info*; \ |
|
206 echo "installing info files in $(DESTDIR)$(infodir)"; \ |
3028
|
207 if test -f octave.info; then \ |
|
208 for f in octave.info*; do \ |
4413
|
209 $(INSTALL_DATA) $$f $(DESTDIR)$(infodir)/$$f; \ |
3028
|
210 done; \ |
152
|
211 else \ |
3028
|
212 for f in $(srcdir)/octave.info*; do \ |
4413
|
213 $(INSTALL_DATA) $$f $(DESTDIR)$(infodir)/`basename $$f`; \ |
3028
|
214 done; \ |
|
215 fi; \ |
4413
|
216 if test -f $(DESTDIR)$(infodir)/dir; then \ |
|
217 if grep "^\* Octave: (octave)." $(DESTDIR)$(infodir)/dir > /dev/null; then \ |
3028
|
218 true; \ |
980
|
219 else \ |
3028
|
220 echo ""; \ |
|
221 echo "You should add the following entry"; \ |
|
222 echo ""; \ |
|
223 echo "* Octave: (octave)."; \ |
|
224 echo " Interactive language for numerical computations."; \ |
|
225 echo ""; \ |
4413
|
226 echo "to $(DESTDIR)$(infodir)/dir."; \ |
3028
|
227 echo ""; \ |
|
228 fi; \ |
976
|
229 else \ |
4413
|
230 echo "installing $(srcdir)/dir in $(DESTDIR)$(infodir)"; \ |
|
231 $(INSTALL_DATA) $(srcdir)/dir $(DESTDIR)$(infodir)/dir; \ |
3028
|
232 fi; \ |
152
|
233 fi |
5866
|
234 .PHONY: install install-strip |
152
|
235 |
5866
|
236 uninstall: |
|
237 @$(subdir-for-command) |
4149
|
238 rm -f $(infodir)/octave.info* |
4413
|
239 for f in $(MAN_BASE); do rm -f $(DESTDIR)$(man1dir)/$$f$(man1ext); done |
5866
|
240 .PHONY: uninstall |
152
|
241 |
|
242 tags: $(SOURCES) |
|
243 ctags $(SOURCES) |
|
244 |
|
245 TAGS: $(SOURCES) |
|
246 etags $(SOURCES) |
|
247 |
|
248 spell: $(SPELL) |
|
249 .PHONY: spell |
|
250 |
5866
|
251 mostlyclean clean: |
|
252 @$(subdir-for-command) |
1458
|
253 rm -f octave.cp octave.fn octave.in \ |
349
|
254 octave.ky octave.op octave.pg octave.rd octave.tp octave.vr \ |
|
255 octave.cps octave.fns octave.ins octave.kys octave.ops \ |
|
256 octave.pgs octave.rds octave.tps octave.vrs octave.aux \ |
3601
|
257 octave.log octave.toc \ |
5866
|
258 munge-texi$(BUILD_EXEEXT) munge-texi.o |
|
259 .PHONY: mostlyclean clean |
152
|
260 |
5866
|
261 distclean: clean |
|
262 @$(subdir-for-command) |
3601
|
263 rm -f Makefile |
5866
|
264 .PHONY: distclean |
152
|
265 |
5866
|
266 maintainer-clean: clean-texi |
6001
|
267 rm -f Makefile tags TAGS $(FORMATTED) $(IMAGES) |
5422
|
268 rm -rf HTML |
5866
|
269 .PHONY: maintainer-clean |
152
|
270 |
3315
|
271 clean-texi: |
6535
|
272 rm -f $(SUB_TEXINFO) contributors.texi |
3315
|
273 .PHONY: clean-texi |
|
274 |
|
275 dist: clean-texi all |
6467
|
276 ln $(DISTFILES) ../../`cat ../../.fname`/doc/interpreter |
6468
|
277 for dir in $(DISTDIRS); do ln ../../doc/interpreter/$$dir ../../`cat ../../.fname`/doc/interpreter/$$dir; done |
5706
|
278 for dir in $(DISTSUBDIRS); do mkdir ../../`cat ../../.fname`/doc/interpreter/$$dir; $(MAKE) -C $$dir $@; done |
152
|
279 .PHONY: dist |