860
|
1 # @configure_input@ |
5
|
2 # |
|
3 # Common configuration rules for all of octave's Makefiles. |
|
4 # |
|
5 # John W. Eaton |
1450
|
6 # jwe@bevo.che.wisc.edu |
|
7 # University of Wisconsin-Madison |
5
|
8 # Department of Chemical Engineering |
1450
|
9 |
5
|
10 SHELL = /bin/sh |
|
11 |
3029
|
12 # A shell command to extract the version number from version.h. |
|
13 getversion = sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*$$/\1/' -e q |
|
14 |
|
15 # Look for version.h to get version information. |
|
16 xfiles := $(TOPDIR)/src/version.h $(srcdir)/$(TOPDIR)/src/version.h |
|
17 version_file := $(firstword $(foreach file, $(xfiles), $(wildcard $(file)))) |
|
18 version := $(shell $(getversion) $(version_file)) |
|
19 |
5
|
20 #### Start of system configuration section. #### |
|
21 |
2577
|
22 EXE = @EXE@ |
|
23 |
5
|
24 LEX = @LEX@ |
|
25 LFLAGS = @LFLAGS@ |
|
26 LEXLIB = @LEXLIB@ |
|
27 |
|
28 YACC = @YACC@ |
|
29 YFLAGS = -dv |
|
30 |
1462
|
31 AR = @AR@ |
|
32 ARFLAGS = @ARFLAGS@ |
|
33 |
5
|
34 RANLIB = @RANLIB@ |
|
35 |
1722
|
36 LN_S = @LN_S@ |
|
37 |
5
|
38 RUNTEST = @RUNTEST@ |
|
39 |
2518
|
40 TEXI2DVI = $(top_srcdir)/texi2dvi |
|
41 |
5
|
42 DEFAULT_PAGER = @DEFAULT_PAGER@ |
|
43 |
1679
|
44 WITH_DL = @WITH_DL@ |
|
45 WITH_SHL = @WITH_SHL@ |
|
46 |
|
47 WITH_DYNAMIC_LINKING = @WITH_DYNAMIC_LINKING@ |
702
|
48 |
1679
|
49 OCTAVE_LITE = @OCTAVE_LITE@ |
702
|
50 |
3034
|
51 STATIC_LIBS = @STATIC_LIBS@ |
|
52 |
1679
|
53 SHARED_LIBS = @SHARED_LIBS@ |
|
54 SHLEXT = @SHLEXT@ |
3029
|
55 SHLEXT_VER = $(SHLEXT).$(version) |
|
56 |
|
57 LIBEXT = a |
1667
|
58 |
5
|
59 # Fortran to C translator and associated flags. |
|
60 |
|
61 F2C = @F2C@ |
|
62 F2CFLAGS = @F2CFLAGS@ |
|
63 |
|
64 # Fortran compiler flags. |
|
65 |
1163
|
66 FC = @FC@ |
798
|
67 F77 = @F77@ |
5
|
68 FFLAGS = @FFLAGS@ |
1832
|
69 FPICFLAG = @FPICFLAG@ |
2566
|
70 FORTRAN_MAIN_FLAG = @FORTRAN_MAIN_FLAG@ |
2610
|
71 ALL_FFLAGS = $(FFLAGS) |
5
|
72 |
|
73 # cc and associated flags. |
|
74 |
2064
|
75 DLFCN_INCFLAGS = @DLFCN_INCFLAGS@ |
|
76 |
236
|
77 # Clean up INCFLAGS a bit if we are not compiling in a separate |
|
78 # directory. |
|
79 ifeq ($(srcdir),.) |
2546
|
80 TMP_IF_1 = -I. |
236
|
81 else |
2546
|
82 TMP_IF_1 = -I. -I$(srcdir) |
236
|
83 endif |
404
|
84 ifeq ($(TOPDIR),$(top_srcdir)) |
1832
|
85 TMP_IF_2 = -I$(TOPDIR) -I$(TOPDIR)/liboctave -I$(TOPDIR)/src \ |
3156
|
86 -I$(TOPDIR)/libcruft/misc |
236
|
87 else |
507
|
88 TMP_IF_2 = -I$(TOPDIR) -I$(TOPDIR)/liboctave -I$(TOPDIR)/src \ |
3156
|
89 -I$(TOPDIR)/libcruft/misc -I$(top_srcdir) \ |
2546
|
90 -I$(top_srcdir)/liboctave -I$(top_srcdir)/src \ |
3156
|
91 -I$(top_srcdir)/libcruft/misc |
236
|
92 endif |
3156
|
93 INCFLAGS = $(TMP_IF_1) $(TMP_IF_2) $(DLFCN_INCFLAGS) $(GLOB_INCFLAGS) |
236
|
94 |
5
|
95 LIBFLAGS = -L$(TOPDIR) |
236
|
96 |
5
|
97 DEFS = @DEFS@ |
|
98 |
2032
|
99 UGLY_DEFS = @UGLY_DEFS@ |
|
100 |
5
|
101 CC = @CC@ |
1891
|
102 CC_VERSION = @CC_VERSION@ |
5
|
103 CFLAGS = @CFLAGS@ |
1832
|
104 CPICFLAG = @CPICFLAG@ |
3126
|
105 XTRA_CFLAGS = @XTRA_CFLAGS@ |
|
106 ALL_CFLAGS = $(INCFLAGS) $(DEFS) $(XTRA_CFLAGS) $(CFLAGS) |
|
107 BUG_CFLAGS = $(DEFS) $(XTRA_CFLAGS) $(CFLAGS) |
798
|
108 |
198
|
109 CXX = @CXX@ |
1891
|
110 CXX_VERSION = @CXX_VERSION@ |
518
|
111 CXXCPP = @CXXCPP@ |
198
|
112 CXXFLAGS = @CXXFLAGS@ |
1832
|
113 CXXPICFLAG = @CXXPICFLAG@ |
3126
|
114 XTRA_CXXFLAGS = @XTRA_CXXFLAGS@ |
|
115 ALL_CXXFLAGS = $(INCFLAGS) $(DEFS) $(XTRA_CXXFLAGS) $(CXXFLAGS) |
|
116 UGLY_ALL_CXXFLAGS = $(INCFLAGS) $(UGLY_DEFS) $(XTRA_CXXFLAGS) $(CXXFLAGS) |
|
117 BUG_CXXFLAGS = $(DEFS) $(XTRA_CXXFLAGS) $(CXXFLAGS) |
5
|
118 |
858
|
119 CPPFLAGS = @CPPFLAGS@ |
|
120 |
5
|
121 LDFLAGS = @LDFLAGS@ |
708
|
122 LD_STATIC_FLAG = @LD_STATIC_FLAG@ |
3126
|
123 ALL_LDFLAGS = $(LIBFLAGS) $(FORTRAN_MAIN_FLAG) \ |
2592
|
124 $(LD_STATIC_FLAG) $(CPICFLAG) $(LDFLAGS) |
5
|
125 |
2676
|
126 SH_LD = @SH_LD@ |
|
127 SH_LDFLAGS = @SH_LDFLAGS@ |
|
128 |
3036
|
129 SONAME_FLAGS = @SONAME_FLAGS@ |
|
130 |
2674
|
131 RLD_FLAG = @RLD_FLAG@ |
|
132 |
5
|
133 FLIBS = @FLIBS@ |
708
|
134 |
2147
|
135 TERMLIBS = @TERMLIBS@ |
2930
|
136 LIBDLFCN = @LIBDLFCN@ |
2147
|
137 LIBPLPLOT = @LIBPLPLOT@ |
2930
|
138 LIBREADLINE = @LIBREADLINE@ |
3156
|
139 LIBKPATHSEA = @LIBKPATHSEA@ |
|
140 LIBOCTINTERP = @LIBOCTINTERP@ |
|
141 LIBOCTAVE = @LIBOCTAVE@ |
|
142 LIBCRUFT = @LIBCRUFT@ |
3111
|
143 SPECIAL_MATH_LIB = @SPECIAL_MATH_LIB@ |
5
|
144 |
2155
|
145 # The arguments passed to configure. |
2156
|
146 config_opts = @config_opts@ |
2155
|
147 |
666
|
148 # ==================== Where To Install Things ==================== |
5
|
149 |
666
|
150 # The default location for installation. Everything is placed in |
|
151 # subdirectories of this directory. The default values for many of |
|
152 # the variables below are expressed in terms of this one, so you may |
|
153 # not need to change them. This defaults to /usr/local. |
|
154 prefix = @prefix@ |
5
|
155 |
666
|
156 # Like `prefix', but used for architecture-specific files. |
|
157 exec_prefix = @exec_prefix@ |
|
158 |
|
159 # Where to install Octave and other binaries that people will want to |
|
160 # run directly. |
|
161 bindir = @bindir@ |
5
|
162 |
666
|
163 # Where to install architecture-independent data files. ${fcnfiledir} |
|
164 # and ${localfcnfiledir} are subdirectories of this. |
|
165 datadir = @datadir@ |
5
|
166 |
3141
|
167 libdir = @libdir@ |
|
168 |
666
|
169 # Where to install and expect libraries like libcruft.a, liboctave.a, |
3141
|
170 # and other architecture-dependent data. |
|
171 octlibdir = @octlibdir@ |
5
|
172 |
1720
|
173 # Where to install and expect executable programs to be run by Octave |
|
174 # rather than directly by users. |
|
175 libexecdir = @libexecdir@ |
|
176 |
2141
|
177 # The prefix for Octave's include file directory. The default is |
|
178 # ${prefix}/include |
2223
|
179 includedir = @includedir@ |
2141
|
180 |
666
|
181 # Where to install Octave's man pages, and what extension they should |
|
182 # have. The default is ${prefix}/man/man1 |
|
183 mandir = @mandir@ |
2223
|
184 man1dir = @man1dir@ |
|
185 man1ext = @man1ext@ |
5
|
186 |
666
|
187 # Where to install and expect the info files describing Octave.. |
|
188 infodir = @infodir@ |
|
189 |
2512
|
190 # The fill path to the default info file. |
|
191 infofile = @infofile@ |
|
192 |
666
|
193 # ==================== Octave-specific directories ==================== |
|
194 |
2993
|
195 # These variables hold the values specific to Octave. They are |
666
|
196 # based on the values of the standard Make variables above. |
|
197 |
2993
|
198 # Where to install Octave's include files. The default is |
|
199 # ${includedir}/octave-${version} |
|
200 octincludedir = @octincludedir@ |
|
201 |
666
|
202 # Where to install the function file distributed with |
|
203 # Octave. This includes the Octave version, so that the |
|
204 # function files for different versions of Octave will install |
|
205 # themselves in separate directories. |
|
206 fcnfiledir = @fcnfiledir@ |
|
207 |
|
208 # Directories Octave should search for function files specific |
|
209 # to this site (i.e. customizations), before consulting |
|
210 # ${fcnfiledir}. This should be a colon-separated list of |
|
211 # directories. |
827
|
212 localfcnfiledir = @localfcnfiledir@ |
666
|
213 localfcnfilepath = @localfcnfilepath@ |
5
|
214 |
666
|
215 # Where to put executables to be run by Octave rather than |
|
216 # the user. This path usually includes the Octave version |
|
217 # and configuration name, so that multiple configurations |
|
218 # for multiple versions of Octave may be installed at once. |
|
219 archlibdir = @archlibdir@ |
|
220 |
2439
|
221 # Where to put executables to be run by Octave rather than by the |
|
222 # user that are specific to this site. |
|
223 localarchlibdir = @localarchlibdir@ |
|
224 |
666
|
225 # Where to put object files that will by dynamically loaded. |
|
226 # This path usually includes the Octave version and configuration |
|
227 # name, so that multiple configurations for multiple versions of |
|
228 # Octave may be installed at once. |
|
229 octfiledir = @octfiledir@ |
5
|
230 |
666
|
231 # Directories Octave should search for object files that will be |
|
232 # dynamically loaded and that are specific to this site |
|
233 # (i.e. customizations), before consulting ${octfiledir}. This should |
|
234 # be a colon-separated list of directories. |
827
|
235 localoctfiledir = @localoctfiledir@ |
666
|
236 localoctfilepath = @localoctfilepath@ |
|
237 |
|
238 # Where Octave will search to find its function files. Before |
|
239 # changing this, check to see if your purpose wouldn't |
|
240 # better be served by changing localfcnfilepath. This |
|
241 # should be a colon-separated list of directories. |
|
242 fcnfilepath = @fcnfilepath@ |
5
|
243 |
685
|
244 # Where Octave will search to find image files.es. |
827
|
245 imagedir = @imagedir@ |
685
|
246 imagepath = @imagepath@ |
|
247 |
5
|
248 # The type of computer we are running on. |
3136
|
249 canonical_host_type = @canonical_host_type@ |
5
|
250 |
|
251 # The following pattern rules and the substitution functions require |
|
252 # GNU make. If you don't have it, get it! |
|
253 |
1679
|
254 # Rules for making object files from Fortran source. |
994
|
255 # |
|
256 # If we are using f2c there will be a command for the `%.c : %.f' |
|
257 # pattern and no command for the `%.o : %.f' pattern, so that make |
|
258 # will not invoke the fortran compiler by mistake. |
|
259 # |
|
260 # If we are not using f2c, it should be ok to have an empty rule for |
|
261 # the pattern `%.c : %.f', but we don't want to replace make's default |
|
262 # rule for making object from Fortran source files, so there should be |
|
263 # no pattern or command for that. |
5
|
264 |
1679
|
265 @f77_rules_frag@ |
994
|
266 |
1668
|
267 # How to make .o files: |
5
|
268 |
1984
|
269 %.o : %.c |
5
|
270 $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< |
|
271 |
1984
|
272 %.o : %.cc |
5
|
273 $(CXX) -c $(CPPFLAGS) $(ALL_CXXFLAGS) $< |
308
|
274 |
1984
|
275 pic/%.o : %.c |
|
276 $(CC) -c $(CPPFLAGS) $(CPICFLAG) $(ALL_CFLAGS) $< -o $@ |
|
277 |
|
278 pic/%.o : %.cc |
|
279 $(CXX) -c $(CPPFLAGS) $(CXXPICFLAG) $(ALL_CXXFLAGS) $< -o $@ |
|
280 |
308
|
281 # Here is a rule for generating dependencies for .cc files: |
|
282 |
1984
|
283 %.d : %.cc |
518
|
284 @echo making $@ from $< |
|
285 @rm -f $@ |
2647
|
286 @$(CXX) -M $(CPPFLAGS) $(ALL_CXXFLAGS) $< | \ |
|
287 sed -e 's,$*\.o,pic/& & $@,g' > $@.tmp |
518
|
288 @mv $@.tmp $@ |
308
|
289 |
|
290 # And one for .c files.too: |
|
291 |
1984
|
292 %.d : %.c |
518
|
293 @echo making $@ from $< |
|
294 @rm -f $@ |
2647
|
295 @$(CC) -M $(CPPFLAGS) $(ALL_CFLAGS) $< | \ |
|
296 sed -e 's,$*\.o,pic/& & $@,g' > $@.tmp |
518
|
297 @mv $@.tmp $@ |
1166
|
298 |
1685
|
299 define do-subdir-for-command |
|
300 echo making $@ in $d; cd $d; $(MAKE) $@; cd ..; |
1166
|
301 endef |
1685
|
302 |
|
303 define subdir-for-command |
|
304 $(foreach d, $(SUBDIRS), $(do-subdir-for-command)) |
|
305 endef |
2157
|
306 |
2862
|
307 # Yes, the second sed command near the end is needed, to avoid limits |
|
308 # in command lengths for some versions of sed. UGLY_DEFS is often |
|
309 # quite large, so it makes sense to split this command there. |
|
310 |
2157
|
311 define do-subst-config-vals |
2223
|
312 echo "making $@ from $<" |
2439
|
313 sed < $< \ |
2862
|
314 -e "s;%BUG_CXXFLAGS%;\"${BUG_CXXFLAGS}\";" \ |
2159
|
315 -e "s;%CC%;\"${CC}\";" \ |
|
316 -e "s;%CC_VERSION%;\"${CC_VERSION}\";" \ |
|
317 -e "s;%CFLAGS%;\"${BUG_CFLAGS}\";" \ |
|
318 -e "s;%CPICFLAG%;\"${CPICFLAG}\";" \ |
2862
|
319 -e "s;%CPPFLAGS%;\"${CPPFLAGS}\";" \ |
2159
|
320 -e "s;%CXX%;\"${CXX}\";" \ |
|
321 -e "s;%CXXFLAGS%;\"${CXXFLAGS}\";" \ |
|
322 -e "s;%CXXPICFLAG%;\"${CXXPICFLAG}\";" \ |
2862
|
323 -e "s;%CXX_VERSION%;\"${CXX_VERSION}\";" \ |
|
324 -e "s;%F2C%;\"${F2C}\";" \ |
|
325 -e "s;%F2CFLAGS%;\"${F2CFLAGS}\";" \ |
|
326 -e "s;%F77%;\"${F77}\";" \ |
|
327 -e "s;%FFLAGS%;\"${FFLAGS}\";" \ |
|
328 -e "s;%FLIBS%;\"${FLIBS}\";" \ |
|
329 -e "s;%FPICFLAG%;\"${FPICFLAG}\";" \ |
2993
|
330 -e "s;%INCFLAGS%;\"-I${octincludedir} -I${includedir}\";" \ |
2862
|
331 -e "s;%LDFLAGS%;\"${LDFLAGS}\";" \ |
|
332 -e "s;%LEXLIB%;\"${LEXLIB}\";" \ |
|
333 -e "s;%LIBDLFCN%;\"${LIBDLFCN}\";" \ |
3141
|
334 -e "s;%LIBFLAGS%;\"-L${octlibdir}\";" \ |
2862
|
335 -e "s;%LIBPLPLOT%;\"${LIBPLPLOT}\";" \ |
|
336 -e "s;%LIBS%;\"${LIBS}\";" \ |
2715
|
337 -e "s;%RLD_FLAG%;\"${RLD_FLAG}\";" \ |
2862
|
338 -e "s;%SH_LD%;\"${SH_LD}\";" \ |
|
339 -e "s;%SH_LDFLAGS%;\"${SH_LDFLAGS}\";" \ |
3136
|
340 -e "s;%TARGET_HOST_TYPE%;\"${canonical_host_type}\";" \ |
2159
|
341 -e "s;%TERMLIBS%;\"${TERMLIBS}\";" \ |
2862
|
342 -e "s;%VERSION%;\"${version}\";" \ |
3131
|
343 -e "s;%XTRA_CFLAGS%;\"${XTRA_CFLAGS}\";" \ |
|
344 -e "s;%XTRA_CXXFLAGS%;\"${XTRA_CXXFLAGS}\";" \ |
2862
|
345 -e "s;%config_opts%;\"${config_opts}\";" | \ |
|
346 sed -e "s;%DEFS%;\"${UGLY_DEFS}\";" > $@.tmp |
2157
|
347 $(top_srcdir)/move-if-change $@.tmp $@ |
|
348 endef |
|
349 |
|
350 define do-subst-default-vals |
2223
|
351 echo "making $@ from $<" |
|
352 sed < $< > $@.tmp \ |
2157
|
353 -e "s;%DEFAULT_PAGER%;\"${DEFAULT_PAGER}\";" \ |
2862
|
354 -e "s;%OCTAVE_ARCHLIBDIR%;\"${archlibdir}\";" \ |
|
355 -e "s;%OCTAVE_BINDIR%;\"${bindir}\";" \ |
2157
|
356 -e "s;%OCTAVE_DATADIR%;\"${datadir}\";" \ |
3141
|
357 -e "s;%OCTAVE_LIBEXECDIR%;\"${libexecdir}\";" \ |
2862
|
358 -e "s;%OCTAVE_EXEC_PREFIX%;\"${exec_prefix}\";" \ |
|
359 -e "s;%OCTAVE_FCNFILEDIR%;\"${fcnfiledir}\";" \ |
|
360 -e "s;%OCTAVE_FCNFILEPATH%;\"${fcnfilepath}\";" \ |
|
361 -e "s;%OCTAVE_IMAGEPATH%;\"${imagepath}\";" \ |
2157
|
362 -e "s;%OCTAVE_INFODIR%;\"${infodir}\";" \ |
2512
|
363 -e "s;%OCTAVE_INFOFILE%;\"${infofile}\";" \ |
2862
|
364 -e "s;%OCTAVE_LIBDIR%;\"${libdir}\";" \ |
3141
|
365 -e "s;%OCTAVE_OCTLIBDIR%;\"${octlibdir}\";" \ |
2862
|
366 -e "s;%OCTAVE_LOCALARCHLIBDIR%;\"${localarchlibdir}\";" \ |
2157
|
367 -e "s;%OCTAVE_LOCALFCNFILEDIR%;\"${localfcnfiledir}\";" \ |
|
368 -e "s;%OCTAVE_LOCALFCNFILEPATH%;\"${localfcnfilepath}\";" \ |
2862
|
369 -e "s;%OCTAVE_LOCALOCTFILEPATH%;\"${localoctfilepath}\";" \ |
2157
|
370 -e "s;%OCTAVE_OCTFILEDIR%;\"${octfiledir}\";" \ |
2862
|
371 -e "s;%OCTAVE_PREFIX%;\"${prefix}\";" \ |
3136
|
372 -e "s;%TARGET_HOST_TYPE%;\"${canonical_host_type}\";" |
2157
|
373 $(top_srcdir)/move-if-change $@.tmp $@ |
|
374 endef |
2993
|
375 |
|
376 # Make a relative symbolic link from $includedir/octave to $octincludedir. |
|
377 |
|
378 # XXX FIXME XXX -- this assumes that $octincludedir is a subdirectory |
|
379 # of $includedir. |
|
380 |
|
381 define mk-includedir-link |
3029
|
382 src=`echo $(octincludedir) | sed 's|^$(includedir)/*||'`; \ |
|
383 echo $$src; \ |
|
384 if [ "$$src" = "octave" ]; then \ |
|
385 true; \ |
2993
|
386 else \ |
3029
|
387 cd $(includedir); \ |
|
388 rm -f octave; \ |
|
389 $(LN_S) $$src octave; \ |
2993
|
390 fi |
|
391 endef |
3141
|
392 |
|
393 # Make a relative symbolic link from $libdir/octave to $octlibdir. |
|
394 |
|
395 # XXX FIXME XXX -- this assumes that $octlibdir is a subdirectory |
|
396 # of $libdir. |
|
397 |
|
398 define mk-libdir-link |
|
399 src=`echo $(octlibdir) | sed 's|^$(libdir)/*||'` ; \ |
|
400 echo $$src ; \ |
|
401 if [ "$$src" = "octave" ] ; then \ |
|
402 true ; \ |
|
403 else \ |
3152
|
404 if [ -d "$(libdir)/octave" ] ; then \ |
|
405 true ; \ |
|
406 else \ |
|
407 cd $(libdir) ; \ |
|
408 rm -f octave ; \ |
|
409 $(LN_S) $$src octave ; \ |
|
410 fi ; \ |
3141
|
411 fi |
|
412 endef |