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