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