5
|
1 # |
|
2 # Makefile for octave |
|
3 # |
|
4 # John W. Eaton |
1451
|
5 # jwe@bevo.che.wisc.edu |
|
6 # University of Wisconsin-Madison |
5
|
7 # Department of Chemical Engineering |
|
8 |
|
9 TOPDIR = . |
|
10 |
|
11 srcdir = @srcdir@ |
411
|
12 top_srcdir = @top_srcdir@ |
5
|
13 VPATH = @srcdir@ |
|
14 |
411
|
15 include $(TOPDIR)/Makeconf |
5
|
16 |
989
|
17 INSTALL = @INSTALL@ |
|
18 INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
2642
|
19 INSTALL_SCRIPT = @INSTALL_SCRIPT@ |
989
|
20 INSTALL_DATA = @INSTALL_DATA@ |
|
21 |
2682
|
22 CONF_DISTFILES = Makefile Makefile.in octMakefile.in Makeconf.in configure \ |
1895
|
23 configure.in config.guess config.sub aclocal.m4 config.h.in \ |
1897
|
24 acconfig.h config.h.bot install-sh |
1895
|
25 |
|
26 DISTFILES = $(CONF_DISTFILES) \ |
3261
|
27 BUGS COPYING FLEX.patch INSTALL INSTALL.OCTAVE NEWS NEWS.[0-9] \ |
|
28 PROJECTS README README.Linux README.Windows README.MachTen ROADMAP \ |
3176
|
29 SENDING-PATCHES THANKS move-if-change octave-sh octave-bug.in \ |
3160
|
30 install-octave.in mkinstalldirs mkoctfile.in texi2dvi \ |
3044
|
31 ChangeLog ChangeLog.[0-9] |
5
|
32 |
|
33 # Complete directory trees to distribute. |
3071
|
34 DISTDIRS = glob kpathsea readline # plplot |
5
|
35 |
1134
|
36 # Subdirectories in which to run `make all'. |
3156
|
37 SUBDIRS = @PLPLOT_DIR@ @READLINE_DIR@ @DLFCN_DIR@ @GLOB_DIR@ \ |
3646
|
38 kpathsea libcruft liboctave scripts doc examples |
1680
|
39 |
3646
|
40 ALL_SUBDIRS = $(SUBDIRS) src |
3004
|
41 |
|
42 # Subdirectories in which to run `make all'. |
3154
|
43 INSTALL_SUBDIRS = libcruft liboctave src scripts doc examples |
3004
|
44 |
2394
|
45 # Subdirectories in which to run `make conf-dist'. |
1895
|
46 CONF_DISTSUBDIRS = src |
|
47 |
1134
|
48 # Subdirectories in which to run `make dist'. |
3077
|
49 DISTSUBDIRS = libcruft liboctave dlfcn src scripts \ |
2635
|
50 test doc emacs examples |
5
|
51 |
2624
|
52 XBINDISTFILES = BUGS COPYING INSTALL INSTALL.OCTAVE NEWS NEWS.[0-9] \ |
3176
|
53 PROJECTS README README.Linux README.Windows README.MachTen \ |
2629
|
54 SENDING-PATCHES THANKS octave-sh install-octave mkinstalldirs \ |
2624
|
55 ChangeLog ChangeLog.[0-9] |
5
|
56 |
2624
|
57 BINDISTFILES = $(addprefix $(srcdir)/, $(XBINDISTFILES)) \ |
2682
|
58 octave-bug config.status config.h VERSION ARCH |
2624
|
59 |
|
60 # Subdirectories in which to run `make bin-dist'. |
3077
|
61 BINDISTSUBDIRS = libcruft liboctave src scripts doc emacs examples |
2624
|
62 |
2394
|
63 # Subdirectories in which to run clean targets. |
3156
|
64 CLEANSUBDIRS = $(DISTSUBDIRS) @READLINE_DIR@ @GLOB_DIR@ kpathsea |
2394
|
65 |
2224
|
66 DIRS_TO_MAKE = $(bindir) $(libdir) $(octincludedir) $(fcnfiledir) \ |
2439
|
67 $(octfiledir) $(archlibdir) $(localarchlibdir) \ |
666
|
68 `echo $(localfcnfilepath) | awk -F: '{for (i=1; i<=NF; i++) print $i}'` \ |
|
69 `echo $(localoctfilepath) | awk -F: '{for (i=1; i<=NF; i++) print $i}'` |
|
70 |
3646
|
71 all: octave-bug mkoctfile src |
5
|
72 .PHONY: all |
|
73 |
3646
|
74 src: $(SUBDIRS) |
|
75 echo making all in $@ |
|
76 $(MAKE) -C $@ all |
|
77 .PHONY: src |
|
78 |
2221
|
79 octave-bug: octave-bug.in Makeconf octMakefile |
2147
|
80 @$(do-subst-config-vals) |
2454
|
81 chmod a+rx $@ |
2147
|
82 |
2221
|
83 mkoctfile: mkoctfile.in Makeconf octMakefile |
2147
|
84 @$(do-subst-config-vals) |
2454
|
85 chmod a+rx $@ |
798
|
86 |
1134
|
87 $(SUBDIRS): |
|
88 echo making all in $@ |
3297
|
89 $(MAKE) -C $@ all |
1134
|
90 .PHONY: $(SUBDIRS) |
5
|
91 |
|
92 check: |
3297
|
93 $(MAKE) -C test check |
5
|
94 .PHONY: check |
|
95 |
2405
|
96 kpathsea.info: |
3297
|
97 $(MAKE) -C kpathsea kpathsea.info |
2405
|
98 .PHONY: kpathsea.info |
|
99 |
5
|
100 octave.info: |
3297
|
101 $(MAKE) -C doc/interpreter octave.info |
5
|
102 .PHONY: octave.info |
|
103 |
3297
|
104 BUGS INSTALL.OCTAVE: |
|
105 $(MAKE) -C doc ../$@ |
|
106 .PHONY: BUGS INSTALL.OCTAVE |
5
|
107 |
2811
|
108 install install-strip :: |
810
|
109 $(top_srcdir)/mkinstalldirs $(DIRS_TO_MAKE) |
3004
|
110 rm -f $(bindir)/octave-bug |
2993
|
111 $(INSTALL_SCRIPT) octave-bug $(bindir)/octave-bug-$(version) |
3029
|
112 cd $(bindir); $(LN_S) octave-bug-$(version) octave-bug |
3004
|
113 rm -f $(bindir)/mkoctfile |
2993
|
114 $(INSTALL_SCRIPT) mkoctfile $(bindir)/mkoctfile-$(version) |
3029
|
115 cd $(bindir); $(LN_S) mkoctfile-$(version) mkoctfile |
2279
|
116 $(INSTALL_DATA) config.h $(octincludedir)/config.h |
3004
|
117 $(mk-includedir-link) |
5
|
118 |
1391
|
119 maintainer-clean:: |
1392
|
120 @echo "" |
|
121 @echo "************************************************************" |
|
122 @echo "* *" |
|
123 @echo "* This command is intended for maintainers to use; it *" |
|
124 @echo "* deletes files that may require special tools to rebuild. *" |
|
125 @echo "* *" |
|
126 @echo "************************************************************" |
|
127 @echo "" |
1391
|
128 |
2811
|
129 install install-strip uninstall tags TAGS:: |
3004
|
130 $(foreach d, $(INSTALL_SUBDIRS), $(do-subdir-for-command)) |
2811
|
131 .PHONY: install install-strip uninstall tags |
2046
|
132 |
|
133 clean mostlyclean distclean maintainer-clean:: |
2394
|
134 $(foreach d, $(CLEANSUBDIRS), $(do-subdir-for-command)) |
2046
|
135 .PHONY: clean mostlyclean distclean maintainer-clean |
5
|
136 |
3287
|
137 maintainer-clean distclean:: |
3601
|
138 rm -f octMakefile octave-bug Makeconf config.cache \ |
2812
|
139 config.h config.log config.status Makerules.f77 mk-oct-links \ |
|
140 mkoctfile Makefrag.f77 |
|
141 |
3287
|
142 maintainer-clean:: |
|
143 rm -f configure config.h.in BUGS INSTALL.OCTAVE install-octave |
5
|
144 |
692
|
145 # Rules for making a source distribution. |
5
|
146 |
2624
|
147 dist-info-files: INSTALL.OCTAVE BUGS |
2405
|
148 .PHONY: dist-info-files |
|
149 |
2629
|
150 dist: dist-info-files |
5
|
151 echo octave-$(version) > .fname |
|
152 rm -rf `cat .fname` |
|
153 mkdir `cat .fname` |
|
154 ln $(DISTFILES) `cat .fname` |
|
155 for dir in $(DISTDIRS); do ln -s ../$$dir `cat .fname`; done |
2629
|
156 for dir in $(DISTSUBDIRS); do \ |
3029
|
157 mkdir `cat .fname`/$$dir; \ |
3297
|
158 $(MAKE) -C $$dir dist; \ |
2629
|
159 done |
692
|
160 tar chf `cat .fname`.tar `cat .fname` |
|
161 rm -rf `cat .fname` |
2624
|
162 tar xf `cat .fname`.tar |
|
163 find `cat .fname` \( \( -name RCS -a -type d \) \ |
2782
|
164 -o \( -name CVS -a -type d \) -o \( -name OLD -a -type d \) \ |
|
165 -o -name "=*" -o -name '*~' -o -name '#*#' -o -name config.log \ |
3151
|
166 -o -name config.status -o -name config.cache -o -name stamp-h \ |
3601
|
167 -o -name klibtool.config -o -name stamp-auto \ |
|
168 -o -name c-auto.h \) -print | xargs rm -rf |
3158
|
169 find `cat .fname`/readline `cat .fname`/kpathsea `cat .fname`/glob \ |
|
170 -name Makefile | xargs rm -f |
3151
|
171 find `cat .fname`/readline `cat .fname`/info `cat .fname`/glob \ |
|
172 -name config.h | xargs rm -f |
2624
|
173 rm -f `cat .fname`/test/octave.test/*.m |
|
174 chmod -R a+rwX `cat .fname` |
|
175 tar cf `cat .fname`.tar `cat .fname` |
2629
|
176 rm -rf `cat .fname` |
|
177 gzip --best `cat .fname`.tar |
|
178 rm -f .fname |
692
|
179 .PHONY: dist |
|
180 |
2629
|
181 # Rules for making a snapshot. |
|
182 |
|
183 snapshot-version: |
|
184 @echo "creating src/version.h" |
|
185 @gawk '/#define OCTAVE_VERSION[ \t]*/ { \ |
|
186 datestring = strftime("%y%m%d", systime()); \ |
|
187 printf("#define OCTAVE_VERSION \"ss-%s\"\n", datestring); \ |
|
188 next; \ |
|
189 } { print $$0 }' src/version.h > src/version.h.new |
|
190 @$(top_srcdir)/move-if-change src/version.h.new src/version.h |
|
191 .PHONY: snapshot-version |
|
192 |
|
193 snapshot: snapshot-version |
|
194 $(MAKE) dist |
|
195 .PHONY: snapshot |
|
196 |
|
197 # Rules for making a dist of just the stuff needed to run configure. |
|
198 |
|
199 conf-dist: |
|
200 echo config-dist-$(version) > .fname |
|
201 rm -rf `cat .fname` |
|
202 mkdir `cat .fname` |
|
203 ln $(CONF_DISTFILES) `cat .fname` |
|
204 for dir in $(CONF_DISTSUBDIRS); do \ |
3029
|
205 mkdir `cat .fname`/$$dir; \ |
3297
|
206 $(MAKE) -C $$dir conf-dist; \ |
2629
|
207 done |
|
208 tar chf `cat .fname`.tar `cat .fname` |
|
209 rm -rf `cat .fname` |
|
210 gzip --best `cat .fname`.tar |
|
211 rm -f .fname |
|
212 .PHONY: conf-dist |
|
213 |
692
|
214 # Rules for making a binary distribution. |
|
215 |
2624
|
216 VERSION: |
|
217 echo $(version) > VERSION |
|
218 .PHONY: VERSION |
|
219 |
|
220 ARCH: |
3136
|
221 echo $(canonical_host_type) > ARCH |
2624
|
222 .PHONY: ARCH |
|
223 |
2682
|
224 binary-dist: VERSION ARCH octave-bug dist-info-files |
3136
|
225 echo octave-$(version)-$(canonical_host_type) > .fname |
5
|
226 rm -rf `cat .fname` |
|
227 mkdir `cat .fname` |
|
228 ln $(BINDISTFILES) `cat .fname` |
2629
|
229 for dir in $(BINDISTSUBDIRS); do \ |
3029
|
230 mkdir `cat .fname`/$$dir; \ |
3297
|
231 $(MAKE) -C $$dir bin-dist; \ |
2629
|
232 done |
5
|
233 tar chf `cat .fname`.tar `cat .fname` |
128
|
234 rm -rf `cat .fname` |
2624
|
235 tar xf `cat .fname`.tar |
|
236 find `cat .fname` \( \( -name RCS -a -type d \) \ |
2782
|
237 -o \( -name CVS -a -type d \) -o \( -name OLD -a -type d \) \ |
|
238 -o -name "=*" -o -name '*~' -o -name '#*#' -o -name Makefile \ |
2624
|
239 -o -name c-auto.h \) -print | xargs rm -rf |
|
240 rm -f `cat .fname`/test/octave.test/*.m |
2662
|
241 chmod -R a+rw `cat .fname` |
|
242 find `cat .fname` \( -perm 766 -o -perm 676 -o -perm 667 \ |
2685
|
243 -o -perm 776 -o -perm 677 -o -perm 767 \) -print | \ |
|
244 xargs chmod a+x scripts |
3077
|
245 strip src/octave |
2624
|
246 tar cf `cat .fname`.tar `cat .fname` |
1896
|
247 rm -rf `cat .fname` |
|
248 gzip --best `cat .fname`.tar |
|
249 rm -f .fname |
2629
|
250 .PHONY: binary-dist |