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