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