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 |
3439
|
21 SUB_SOURCE := arith.txi audio.txi basics.txi bugs.txi \ |
4167
|
22 container.txi control.txi cp-idx.txi data.txi \ |
|
23 debug.txi diffeq.txi emacs.txi errors.txi eval.txi \ |
|
24 expr.txi finance.txi fn-idx.txi func.txi gpl.txi \ |
|
25 grammar.txi image.txi install.txi intro.txi io.txi \ |
|
26 linalg.txi matrix.txi nonlin.txi numbers.txi \ |
|
27 op-idx.txi optim.txi plot.txi poly.txi preface.txi \ |
|
28 quad.txi quaternion.txi set.txi signal.txi stats.txi \ |
|
29 stmt.txi stream.txi strings.txi struct.txi system.txi \ |
|
30 tips.txi var.txi vr-idx.txi |
152
|
31 |
3404
|
32 SOURCES := $(SUB_SOURCE) |
3294
|
33 |
3851
|
34 MAIN_TEXINFO := $(srcdir)/octave.texi |
3297
|
35 |
|
36 SUB_TEXINFO := $(SUB_SOURCE:.txi=.texi) |
|
37 |
|
38 TEXINFO := $(MAIN_TEXINFO) $(SUB_TEXINFO) |
152
|
39 |
3189
|
40 FORMATTED = octave.dvi octave.ps octave.info octave.info-[0-9]* octave_*.html |
328
|
41 |
4339
|
42 MAN_BASE := mkoctfile octave octave-bug octave-config |
4149
|
43 MAN_SRC := $(addsuffix .1, $(MAN_BASE)) |
|
44 |
4215
|
45 DISTFILES = Makefile.in dir munge-texi.cc $(MAN_SRC) \ |
3312
|
46 $(SOURCES) $(TEXINFO) $(FORMATTED) |
299
|
47 |
2624
|
48 ifeq ($(wildcard octave.info), ) |
4149
|
49 BINDISTFILES = $(addprefix $(srcdir)/, $(MAN_SRC) $(FORMATTED)) |
2624
|
50 else |
4149
|
51 BINDISTFILES = $(addprefix $(srcdir)/, $(MAN_SRC)) $(FORMATTED) |
2624
|
52 endif |
|
53 |
|
54 # Look for version.h to get version information. |
|
55 xfiles := $(TOPDIR)/src/version.h $(srcdir)/$(TOPDIR)/src/version.h |
|
56 |
|
57 version_file := $(firstword $(foreach file, $(xfiles), $(wildcard $(file)))) |
|
58 |
2689
|
59 SPELL = $(patsubst %.texi, %.spell, $(TEXINFO)) |
152
|
60 |
|
61 %.spell : %.texi |
|
62 rm -f $@ |
4084
|
63 $(SED) -e 's/@@/ at /g' -e 's/@[a-zA-Z]*//g' $< | spell > $@.tmp |
152
|
64 mv $@.tmp $@ |
|
65 |
3189
|
66 all: octave.info octave.dvi octave.ps octave_toc.html |
152
|
67 .PHONY: all |
|
68 |
4098
|
69 $(TEXINFO): src-DOCSTRINGS scripts-DOCSTRINGS munge-texi$(BUILD_EXEEXT) |
3297
|
70 |
4298
|
71 munge-texi$(BUILD_EXEEXT): munge-texi.cc |
|
72 $(BUILD_CXX) $(BUILD_CXXFLAGS) -o $@ $^ $(BUILD_LDFLAGS) |
3313
|
73 |
4093
|
74 src-DOCSTRINGS: |
|
75 $(MAKE) -C ../../src DOCSTRINGS |
|
76 .PHONY: src-DOCSTRINGS |
|
77 |
|
78 scripts-DOCSTRINGS: |
|
79 $(MAKE) -C ../../scripts DOCSTRINGS |
|
80 .PHONY: scripts-DOCSTRINGS |
3294
|
81 |
|
82 %.texi : %.txi |
3364
|
83 @echo making $@ from $< |
|
84 @./munge-texi \ |
3294
|
85 -d $(TOPDIR)/src/DOCSTRINGS \ |
|
86 -d $(TOPDIR)/scripts/DOCSTRINGS < $< > $@.t |
4098
|
87 @$(top_srcdir)/move-if-change $@.t $@ |
3294
|
88 |
3297
|
89 octave.info: $(MAIN_TEXINFO) $(SUB_TEXINFO) ../conf.texi |
|
90 -makeinfo -I$(srcdir) -I$(srcdir)/.. $< |
2000
|
91 |
3297
|
92 octave.dvi: $(MAIN_TEXINFO) $(SUB_TEXINFO) ../conf.texi |
3028
|
93 -TEXINPUTS="$(srcdir):$(srcdir)/..:$(TEXINPUTS):"; \ |
|
94 export TEXINPUTS; \ |
3297
|
95 $(TEXI2DVI) $< |
2000
|
96 |
|
97 octave.ps: octave.dvi |
|
98 -dvips -o octave.ps octave.dvi |
|
99 |
2627
|
100 ../../INSTALL.OCTAVE: install.texi |
3176
|
101 rm -f INSTALL |
|
102 -makeinfo -D INSTALLONLY \ |
|
103 --no-validate --no-headers --no-split --output INSTALL \ |
3297
|
104 -I$(srcdir) -I$(srcdir)/.. $< |
2001
|
105 mv INSTALL ../../INSTALL.OCTAVE |
2000
|
106 |
2627
|
107 ../../BUGS: bugs.texi |
3176
|
108 rm -f BUGS |
|
109 -makeinfo -D BUGSONLY \ |
|
110 --no-validate --no-headers --no-split --output BUGS \ |
3297
|
111 -I$(srcdir) -I$(srcdir)/.. $< |
2001
|
112 mv BUGS ../../BUGS |
2000
|
113 |
3863
|
114 # These option forms are supported by texi2html 1.65 and probably also |
|
115 # more recent versions. |
3297
|
116 octave_toc.html: $(MAIN_TEXINFO) $(SUB_TEXINFO) |
4125
|
117 -texi2html -expandinfo -split_chapter -I $(srcdir)/.. $< |
3189
|
118 |
152
|
119 check: all |
|
120 .PHONY: check |
|
121 |
2811
|
122 install install-strip: all |
2222
|
123 $(top_srcdir)/mkinstalldirs $(man1dir) $(infodir) |
3028
|
124 @if test -d $(man1dir); then \ |
4149
|
125 for f in $(MAN_BASE); do \ |
|
126 rm -f $(man1dir)/$$f$(man1ext); \ |
|
127 echo "installing $(srcdir)/$$f.1 in $(man1dir)"; \ |
|
128 $(INSTALL_DATA) $(srcdir)/$$f.1 $(man1dir)/$$f$(man1ext); \ |
|
129 done ; \ |
979
|
130 fi |
3028
|
131 @if test -d $(infodir); then \ |
|
132 rm -f $(infodir)/octave.info*; \ |
|
133 echo "installing info files in $(infodir)"; \ |
|
134 if test -f octave.info; then \ |
|
135 for f in octave.info*; do \ |
|
136 $(INSTALL_DATA) $$f $(infodir)/$$f; \ |
|
137 done; \ |
152
|
138 else \ |
3028
|
139 for f in $(srcdir)/octave.info*; do \ |
|
140 $(INSTALL_DATA) $$f $(infodir)/`basename $$f`; \ |
|
141 done; \ |
|
142 fi; \ |
|
143 if test -f $(infodir)/dir; then \ |
|
144 if grep "^\* Octave: (octave)." $(infodir)/dir > /dev/null; then \ |
|
145 true; \ |
980
|
146 else \ |
3028
|
147 echo ""; \ |
|
148 echo "You should add the following entry"; \ |
|
149 echo ""; \ |
|
150 echo "* Octave: (octave)."; \ |
|
151 echo " Interactive language for numerical computations."; \ |
|
152 echo ""; \ |
|
153 echo "to $(infodir)/dir."; \ |
|
154 echo ""; \ |
|
155 fi; \ |
976
|
156 else \ |
3028
|
157 echo "installing $(srcdir)/dir in $(infodir)"; \ |
|
158 $(INSTALL_DATA) $(srcdir)/dir $(infodir)/dir; \ |
|
159 fi; \ |
152
|
160 fi |
2811
|
161 .PHONY: install install-strip |
152
|
162 |
|
163 uninstall: |
4149
|
164 rm -f $(infodir)/octave.info* |
|
165 for f in $(MAN_BASE); do rm -f $(man1dir)/$$f$(man1ext); done |
152
|
166 .PHONY: uninstall |
|
167 |
|
168 tags: $(SOURCES) |
|
169 ctags $(SOURCES) |
|
170 |
|
171 TAGS: $(SOURCES) |
|
172 etags $(SOURCES) |
|
173 |
|
174 spell: $(SPELL) |
|
175 .PHONY: spell |
|
176 |
1458
|
177 mostlyclean clean: |
|
178 rm -f octave.cp octave.fn octave.in \ |
349
|
179 octave.ky octave.op octave.pg octave.rd octave.tp octave.vr \ |
|
180 octave.cps octave.fns octave.ins octave.kys octave.ops \ |
|
181 octave.pgs octave.rds octave.tps octave.vrs octave.aux \ |
3601
|
182 octave.log octave.toc \ |
4215
|
183 munge-texi$(BUILD_EXEEXT) munge-texi.o |
1458
|
184 .PHONY: mostlyclean clean |
152
|
185 |
|
186 distclean: clean |
3601
|
187 rm -f Makefile |
152
|
188 .PHONY: distclean |
|
189 |
4203
|
190 maintainer-clean: distclean clean-texi |
3189
|
191 rm -f tags TAGS octave.info octave.info-* octave.dvi octave.ps |
4203
|
192 rm -f octave_*.html |
1391
|
193 .PHONY: maintainer-clean |
152
|
194 |
3315
|
195 clean-texi: |
3494
|
196 rm -f $(SUB_TEXINFO) |
3315
|
197 .PHONY: clean-texi |
|
198 |
|
199 dist: clean-texi all |
2028
|
200 ln $(DISTFILES) ../../`cat ../../.fname`/doc/interpreter |
152
|
201 .PHONY: dist |
2624
|
202 |
|
203 bin-dist: |
|
204 if [ -n "$(BINDISTFILES)" ]; then \ |
3028
|
205 ln $(BINDISTFILES) ../../`cat ../../.fname`/doc/interpreter; \ |
2624
|
206 fi |
|
207 .PHONY: bin-dist |