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