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