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 |
|
12 #### Start of system configuration section. #### |
|
13 |
|
14 LEX = @LEX@ |
|
15 LFLAGS = @LFLAGS@ |
|
16 LEXLIB = @LEXLIB@ |
|
17 |
|
18 YACC = @YACC@ |
|
19 YFLAGS = -dv |
|
20 |
1462
|
21 AR = @AR@ |
|
22 ARFLAGS = @ARFLAGS@ |
|
23 |
5
|
24 RANLIB = @RANLIB@ |
|
25 |
1722
|
26 LN_S = @LN_S@ |
|
27 |
5
|
28 RUNTEST = @RUNTEST@ |
|
29 |
2518
|
30 TEXI2DVI = $(top_srcdir)/texi2dvi |
|
31 |
5
|
32 DEFAULT_PAGER = @DEFAULT_PAGER@ |
|
33 |
1679
|
34 WITH_DL = @WITH_DL@ |
|
35 WITH_SHL = @WITH_SHL@ |
|
36 |
|
37 WITH_DYNAMIC_LINKING = @WITH_DYNAMIC_LINKING@ |
702
|
38 |
1679
|
39 OCTAVE_LITE = @OCTAVE_LITE@ |
702
|
40 |
1679
|
41 SHARED_LIBS = @SHARED_LIBS@ |
|
42 SHLEXT = @SHLEXT@ |
1667
|
43 |
5
|
44 # Fortran to C translator and associated flags. |
|
45 |
|
46 F2C = @F2C@ |
|
47 F2CFLAGS = @F2CFLAGS@ |
|
48 |
|
49 # Fortran compiler flags. |
|
50 |
1163
|
51 FC = @FC@ |
798
|
52 F77 = @F77@ |
5
|
53 FFLAGS = @FFLAGS@ |
1832
|
54 FPICFLAG = @FPICFLAG@ |
1177
|
55 FUGLY = @FUGLY@ |
|
56 ALL_FFLAGS = $(FUGLY) $(FFLAGS) |
5
|
57 |
|
58 # cc and associated flags. |
|
59 |
2064
|
60 DLFCN_INCFLAGS = @DLFCN_INCFLAGS@ |
|
61 |
236
|
62 # Clean up INCFLAGS a bit if we are not compiling in a separate |
|
63 # directory. |
|
64 ifeq ($(srcdir),.) |
2546
|
65 TMP_IF_1 = -I. |
236
|
66 else |
2546
|
67 TMP_IF_1 = -I. -I$(srcdir) |
236
|
68 endif |
404
|
69 ifeq ($(TOPDIR),$(top_srcdir)) |
1832
|
70 TMP_IF_2 = -I$(TOPDIR) -I$(TOPDIR)/liboctave -I$(TOPDIR)/src \ |
2546
|
71 -I$(TOPDIR)/glob -I$(TOPDIR)/libcruft/misc |
236
|
72 else |
507
|
73 TMP_IF_2 = -I$(TOPDIR) -I$(TOPDIR)/liboctave -I$(TOPDIR)/src \ |
2546
|
74 -I$(TOPDIR)/glob -I$(TOPDIR)/libcruft/misc -I$(top_srcdir) \ |
|
75 -I$(top_srcdir)/liboctave -I$(top_srcdir)/src \ |
|
76 -I$(top_srcdir)/glob -I$(top_srcdir)/libcruft/misc |
236
|
77 endif |
2386
|
78 INCFLAGS = $(TMP_IF_1) $(TMP_IF_2) $(DLFCN_INCFLAGS) |
236
|
79 |
5
|
80 LIBFLAGS = -L$(TOPDIR) |
236
|
81 |
5
|
82 DEFS = @DEFS@ |
|
83 |
2032
|
84 UGLY_DEFS = @UGLY_DEFS@ |
|
85 |
5
|
86 CC = @CC@ |
1891
|
87 CC_VERSION = @CC_VERSION@ |
5
|
88 CFLAGS = @CFLAGS@ |
1832
|
89 CPICFLAG = @CPICFLAG@ |
325
|
90 GCC_IEEE_FP_FLAG = @GCC_IEEE_FP_FLAG@ |
|
91 ALL_CFLAGS = $(INCFLAGS) $(DEFS) $(GCC_IEEE_FP_FLAG) $(CFLAGS) |
798
|
92 BUG_CFLAGS = $(DEFS) $(GCC_IEEE_FP_FLAG) $(CFLAGS) |
|
93 |
198
|
94 CXX = @CXX@ |
1891
|
95 CXX_VERSION = @CXX_VERSION@ |
518
|
96 CXXCPP = @CXXCPP@ |
198
|
97 CXXFLAGS = @CXXFLAGS@ |
1832
|
98 CXXPICFLAG = @CXXPICFLAG@ |
759
|
99 NO_IMPLICIT_TEMPLATES = @NO_IMPLICIT_TEMPLATES@ |
1018
|
100 HOST_CXXFLAGS = @HOST_CXXFLAGS@ |
|
101 ALL_CXXFLAGS = $(INCFLAGS) $(DEFS) $(HOST_CXXFLAGS) \ |
|
102 $(NO_IMPLICIT_TEMPLATES) $(GCC_IEEE_FP_FLAG) $(CXXFLAGS) |
|
103 UGLY_ALL_CXXFLAGS = $(INCFLAGS) $(UGLY_DEFS) $(HOST_CXXFLAGS) \ |
|
104 $(NO_IMPLICIT_TEMPLATES) $(GCC_IEEE_FP_FLAG) $(CXXFLAGS) |
|
105 BUG_CXXFLAGS = $(DEFS) $(HOST_CXXFLAGS) $(NO_IMPLICIT_TEMPLATES) \ |
325
|
106 $(GCC_IEEE_FP_FLAG) $(CXXFLAGS) |
5
|
107 |
858
|
108 CPPFLAGS = @CPPFLAGS@ |
|
109 |
5
|
110 LDFLAGS = @LDFLAGS@ |
708
|
111 LD_STATIC_FLAG = @LD_STATIC_FLAG@ |
|
112 ALL_LDFLAGS = $(LIBFLAGS) $(GCC_IEEE_FP_FLAG) $(LD_STATIC_FLAG) $(LDFLAGS) |
5
|
113 |
1679
|
114 RLD_FLAG = @RLD_FLAG@ |
|
115 |
5
|
116 FLIBS = @FLIBS@ |
708
|
117 |
|
118 CXXLIBS = @CXXLIBS@ |
|
119 |
2147
|
120 TERMLIBS = @TERMLIBS@ |
|
121 LIBPLPLOT = @LIBPLPLOT@ |
|
122 LIBDLFCN = @LIBDLFCN@ |
5
|
123 |
2257
|
124 SH_FLIBS = @SH_FLIBS@ |
|
125 SH_TERMLIBS = @SH_TERMLIBS@ |
|
126 SH_LIBS = @SH_LIBS@ |
|
127 |
2155
|
128 # The arguments passed to configure. |
2156
|
129 config_opts = @config_opts@ |
2155
|
130 |
5
|
131 # A shell command to extract the version number from version.h. |
1105
|
132 getversion = sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*$$/\1/' -e q |
5
|
133 |
2488
|
134 # Look for version.h to get version information. |
|
135 xfiles := $(TOPDIR)/src/version.h $(srcdir)/$(TOPDIR)/src/version.h |
|
136 version_file := $(firstword $(foreach file, $(xfiles), $(wildcard $(file)))) |
|
137 version := $(shell $(getversion) $(version_file)) |
5
|
138 |
666
|
139 # ==================== Where To Install Things ==================== |
5
|
140 |
666
|
141 # The default location for installation. Everything is placed in |
|
142 # subdirectories of this directory. The default values for many of |
|
143 # the variables below are expressed in terms of this one, so you may |
|
144 # not need to change them. This defaults to /usr/local. |
|
145 prefix = @prefix@ |
5
|
146 |
666
|
147 # Like `prefix', but used for architecture-specific files. |
|
148 exec_prefix = @exec_prefix@ |
|
149 |
|
150 # Where to install Octave and other binaries that people will want to |
|
151 # run directly. |
|
152 bindir = @bindir@ |
5
|
153 |
666
|
154 # Where to install architecture-independent data files. ${fcnfiledir} |
|
155 # and ${localfcnfiledir} are subdirectories of this. |
|
156 datadir = @datadir@ |
5
|
157 |
666
|
158 # Where to install and expect libraries like libcruft.a, liboctave.a, |
1720
|
159 # and libreadline.a and other architecture-dependent data. The |
|
160 # directory ${archlibdir} is a subdirectory of this. |
666
|
161 libdir = @libdir@ |
5
|
162 |
1720
|
163 # Where to install and expect executable programs to be run by Octave |
|
164 # rather than directly by users. |
|
165 libexecdir = @libexecdir@ |
|
166 |
2141
|
167 # The prefix for Octave's include file directory. The default is |
|
168 # ${prefix}/include |
2223
|
169 includedir = @includedir@ |
2141
|
170 |
666
|
171 # Where to install Octave's include files. The default is |
2223
|
172 # ${includedir}/octave-${version} |
|
173 octincludedir = @octincludedir@ |
666
|
174 |
|
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 |
|
189 # These variables hold the values Octave will actually use. They are |
|
190 # based on the values of the standard Make variables above. |
|
191 |
|
192 # Where to install the function file distributed with |
|
193 # Octave. This includes the Octave version, so that the |
|
194 # function files for different versions of Octave will install |
|
195 # themselves in separate directories. |
|
196 fcnfiledir = @fcnfiledir@ |
|
197 |
|
198 # Directories Octave should search for function files specific |
|
199 # to this site (i.e. customizations), before consulting |
|
200 # ${fcnfiledir}. This should be a colon-separated list of |
|
201 # directories. |
827
|
202 localfcnfiledir = @localfcnfiledir@ |
666
|
203 localfcnfilepath = @localfcnfilepath@ |
5
|
204 |
666
|
205 # Where to put executables to be run by Octave rather than |
|
206 # the user. This path usually includes the Octave version |
|
207 # and configuration name, so that multiple configurations |
|
208 # for multiple versions of Octave may be installed at once. |
|
209 archlibdir = @archlibdir@ |
|
210 |
2439
|
211 # Where to put executables to be run by Octave rather than by the |
|
212 # user that are specific to this site. |
|
213 localarchlibdir = @localarchlibdir@ |
|
214 |
666
|
215 # Where to put object files that will by dynamically loaded. |
|
216 # This path usually includes the Octave version and configuration |
|
217 # name, so that multiple configurations for multiple versions of |
|
218 # Octave may be installed at once. |
|
219 octfiledir = @octfiledir@ |
5
|
220 |
666
|
221 # Directories Octave should search for object files that will be |
|
222 # dynamically loaded and that are specific to this site |
|
223 # (i.e. customizations), before consulting ${octfiledir}. This should |
|
224 # be a colon-separated list of directories. |
827
|
225 localoctfiledir = @localoctfiledir@ |
666
|
226 localoctfilepath = @localoctfilepath@ |
|
227 |
|
228 # Where Octave will search to find its function files. Before |
|
229 # changing this, check to see if your purpose wouldn't |
|
230 # better be served by changing localfcnfilepath. This |
|
231 # should be a colon-separated list of directories. |
|
232 fcnfilepath = @fcnfilepath@ |
5
|
233 |
685
|
234 # Where Octave will search to find image files.es. |
827
|
235 imagedir = @imagedir@ |
685
|
236 imagepath = @imagepath@ |
|
237 |
5
|
238 # The type of computer we are running on. |
|
239 target_host_type = @target_host_type@ |
|
240 |
|
241 # The following pattern rules and the substitution functions require |
|
242 # GNU make. If you don't have it, get it! |
|
243 |
1679
|
244 # Rules for making object files from Fortran source. |
994
|
245 # |
|
246 # If we are using f2c there will be a command for the `%.c : %.f' |
|
247 # pattern and no command for the `%.o : %.f' pattern, so that make |
|
248 # will not invoke the fortran compiler by mistake. |
|
249 # |
|
250 # If we are not using f2c, it should be ok to have an empty rule for |
|
251 # the pattern `%.c : %.f', but we don't want to replace make's default |
|
252 # rule for making object from Fortran source files, so there should be |
|
253 # no pattern or command for that. |
5
|
254 |
1679
|
255 @f77_rules_frag@ |
994
|
256 |
1668
|
257 # How to make .o files: |
5
|
258 |
1984
|
259 %.o : %.c |
5
|
260 $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< |
|
261 |
1984
|
262 %.o : %.cc |
5
|
263 $(CXX) -c $(CPPFLAGS) $(ALL_CXXFLAGS) $< |
308
|
264 |
1984
|
265 pic/%.o : %.c |
|
266 $(CC) -c $(CPPFLAGS) $(CPICFLAG) $(ALL_CFLAGS) $< -o $@ |
|
267 |
|
268 pic/%.o : %.cc |
|
269 $(CXX) -c $(CPPFLAGS) $(CXXPICFLAG) $(ALL_CXXFLAGS) $< -o $@ |
|
270 |
308
|
271 # Here is a rule for generating dependencies for .cc files: |
|
272 |
1984
|
273 %.d : %.cc |
518
|
274 @echo making $@ from $< |
|
275 @rm -f $@ |
|
276 @-if test "$(srcdir)" = "." ; then \ |
308
|
277 $(CXX) -MM $(CPPFLAGS) $(ALL_CXXFLAGS) $< | \ |
2054
|
278 sed -e 's,$*\.o,pic/& & $@,g' > $@.tmp ; \ |
308
|
279 else \ |
|
280 $(CXX) -MM $(CPPFLAGS) $(ALL_CXXFLAGS) $< | \ |
2054
|
281 sed -e 's,$*\.o,pic/& & $@,g' -e 's,$(srcdir)/,,g' > $@.tmp ; \ |
308
|
282 fi |
518
|
283 @mv $@.tmp $@ |
308
|
284 |
|
285 # And one for .c files.too: |
|
286 |
1984
|
287 %.d : %.c |
518
|
288 @echo making $@ from $< |
|
289 @rm -f $@ |
|
290 @-if test "$(srcdir)" = "." ; then \ |
308
|
291 $(CC) -MM $(CPPFLAGS) $(ALL_CFLAGS) $< | \ |
2054
|
292 sed -e 's,$*\.o,pic/& & $@,g' > $@.tmp ; \ |
308
|
293 else \ |
|
294 $(CC) -MM $(CPPFLAGS) $(ALL_CFLAGS) $< | \ |
2054
|
295 sed -e 's,$*\.o,pic/& & $@,g' -e 's,$(srcdir)/,,g' > $@.tmp ; \ |
308
|
296 fi |
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 |
|
307 define do-subst-config-vals |
2223
|
308 echo "making $@ from $<" |
2439
|
309 sed < $< \ |
2159
|
310 -e "s;%VERSION%;\"${version}\";" \ |
|
311 -e "s;%config_opts%;\"${config_opts}\";" \ |
|
312 -e "s;%TARGET_HOST_TYPE%;\"${target_host_type}\";" \ |
|
313 -e "s;%F77%;\"${F77}\";" \ |
|
314 -e "s;%FFLAGS%;\"${FFLAGS}\";" \ |
|
315 -e "s;%FPICFLAG%;\"${FPICFLAG}\";" \ |
|
316 -e "s;%F2C%;\"${F2C}\";" \ |
|
317 -e "s;%F2CFLAGS%;\"${F2CFLAGS}\";" \ |
|
318 -e "s;%FLIBS%;\"${FLIBS}\";" \ |
|
319 -e "s;%CPPFLAGS%;\"${CPPFLAGS}\";" \ |
2223
|
320 -e "s;%INCFLAGS%;\"-I${includedir} -I${octincludedir}\";" \ |
2159
|
321 -e "s;%CC%;\"${CC}\";" \ |
|
322 -e "s;%CC_VERSION%;\"${CC_VERSION}\";" \ |
|
323 -e "s;%CFLAGS%;\"${BUG_CFLAGS}\";" \ |
|
324 -e "s;%CPICFLAG%;\"${CPICFLAG}\";" \ |
|
325 -e "s;%CXX%;\"${CXX}\";" \ |
|
326 -e "s;%CXX_VERSION%;\"${CXX_VERSION}\";" \ |
|
327 -e "s;%CXXFLAGS%;\"${CXXFLAGS}\";" \ |
|
328 -e "s;%CXXPICFLAG%;\"${CXXPICFLAG}\";" \ |
|
329 -e "s;%BUG_CXXFLAGS%;\"${BUG_CXXFLAGS}\";" \ |
|
330 -e "s;%HOST_CXXFLAGS%;\"${HOST_CXXFLAGS}\";" \ |
|
331 -e "s;%NO_IMPLICIT_TEMPLATES%;\"${NO_IMPLICIT_TEMPLATES}\";" \ |
|
332 -e "s;%GCC_IEEE_FP_FLAG%;\"${GCC_IEEE_FP_FLAG}\";" \ |
|
333 -e "s;%LDFLAGS%;\"${LDFLAGS}\";" \ |
2160
|
334 -e "s;%LIBFLAGS%;\"-L${libdir}\";" \ |
2159
|
335 -e "s;%RLD_FLAG%;\"${RLD_FLAG}\";" \ |
|
336 -e "s;%CXXLIBS%;\"${CXXLIBS}\";" \ |
|
337 -e "s;%TERMLIBS%;\"${TERMLIBS}\";" \ |
|
338 -e "s;%LIBS%;\"${LIBS}\";" \ |
|
339 -e "s;%LEXLIB%;\"${LEXLIB}\";" \ |
|
340 -e "s;%LIBPLPLOT%;\"${LIBPLPLOT}\";" \ |
2439
|
341 -e "s;%LIBDLFCN%;\"${LIBDLFCN}\";" | sed \ |
|
342 -e "s;%DEFS%;\"${UGLY_DEFS}\";" > $@.tmp |
2157
|
343 $(top_srcdir)/move-if-change $@.tmp $@ |
|
344 endef |
|
345 |
|
346 define do-subst-default-vals |
2223
|
347 echo "making $@ from $<" |
|
348 sed < $< > $@.tmp \ |
2157
|
349 -e "s;%DEFAULT_PAGER%;\"${DEFAULT_PAGER}\";" \ |
|
350 -e "s;%OCTAVE_PREFIX%;\"${prefix}\";" \ |
|
351 -e "s;%OCTAVE_EXEC_PREFIX%;\"${exec_prefix}\";" \ |
|
352 -e "s;%OCTAVE_DATADIR%;\"${datadir}\";" \ |
|
353 -e "s;%OCTAVE_BINDIR%;\"${bindir}\";" \ |
|
354 -e "s;%OCTAVE_LIBDIR%;\"${libdir}\";" \ |
|
355 -e "s;%OCTAVE_INFODIR%;\"${infodir}\";" \ |
2512
|
356 -e "s;%OCTAVE_INFOFILE%;\"${infofile}\";" \ |
2157
|
357 -e "s;%OCTAVE_FCNFILEDIR%;\"${fcnfiledir}\";" \ |
|
358 -e "s;%OCTAVE_LOCALFCNFILEDIR%;\"${localfcnfiledir}\";" \ |
|
359 -e "s;%OCTAVE_LOCALFCNFILEPATH%;\"${localfcnfilepath}\";" \ |
|
360 -e "s;%OCTAVE_ARCHLIBDIR%;\"${archlibdir}\";" \ |
2439
|
361 -e "s;%OCTAVE_LOCALARCHLIBDIR%;\"${localarchlibdir}\";" \ |
2157
|
362 -e "s;%OCTAVE_OCTFILEDIR%;\"${octfiledir}\";" \ |
|
363 -e "s;%OCTAVE_LOCALOCTFILEPATH%;\"${localoctfilepath}\";" \ |
|
364 -e "s;%OCTAVE_FCNFILEPATH%;\"${fcnfilepath}\";" \ |
|
365 -e "s;%OCTAVE_IMAGEPATH%;\"${imagepath}\";" \ |
2488
|
366 -e "s;%TARGET_HOST_TYPE%;\"${target_host_type}\";" |
2157
|
367 $(top_srcdir)/move-if-change $@.tmp $@ |
|
368 endef |