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 |
|
30 DEFAULT_PAGER = @DEFAULT_PAGER@ |
|
31 |
1679
|
32 WITH_DL = @WITH_DL@ |
|
33 WITH_SHL = @WITH_SHL@ |
|
34 |
|
35 WITH_DYNAMIC_LINKING = @WITH_DYNAMIC_LINKING@ |
702
|
36 |
1679
|
37 OCTAVE_LITE = @OCTAVE_LITE@ |
702
|
38 |
1679
|
39 SHARED_LIBS = @SHARED_LIBS@ |
|
40 SHLEXT = @SHLEXT@ |
1667
|
41 |
5
|
42 # Fortran to C translator and associated flags. |
|
43 |
|
44 F2C = @F2C@ |
|
45 F2CFLAGS = @F2CFLAGS@ |
|
46 |
|
47 # Fortran compiler flags. |
|
48 |
1163
|
49 FC = @FC@ |
798
|
50 F77 = @F77@ |
5
|
51 FFLAGS = @FFLAGS@ |
1832
|
52 FPICFLAG = @FPICFLAG@ |
1177
|
53 FUGLY = @FUGLY@ |
|
54 ALL_FFLAGS = $(FUGLY) $(FFLAGS) |
5
|
55 |
|
56 # cc and associated flags. |
|
57 |
2064
|
58 DLFCN_INCFLAGS = @DLFCN_INCFLAGS@ |
|
59 |
2259
|
60 UCB_INCFLAGS = @UCB_INCFLAGS@ |
|
61 |
236
|
62 # Clean up INCFLAGS a bit if we are not compiling in a separate |
|
63 # directory. |
|
64 ifeq ($(srcdir),.) |
507
|
65 TMP_IF_1 = -I. -I../src |
236
|
66 else |
507
|
67 TMP_IF_1 = -I. -I$(srcdir) -I../src |
236
|
68 endif |
404
|
69 ifeq ($(TOPDIR),$(top_srcdir)) |
1832
|
70 TMP_IF_2 = -I$(TOPDIR) -I$(TOPDIR)/liboctave -I$(TOPDIR)/src \ |
|
71 -I$(TOPDIR)/glob |
236
|
72 else |
507
|
73 TMP_IF_2 = -I$(TOPDIR) -I$(TOPDIR)/liboctave -I$(TOPDIR)/src \ |
1832
|
74 -I$(TOPDIR)/glob -I$(top_srcdir) -I$(top_srcdir)/liboctave \ |
|
75 -I$(top_srcdir)/src -I$(top_srcdir)/glob |
236
|
76 endif |
2259
|
77 INCFLAGS = $(TMP_IF_1) $(TMP_IF_2) $(DLFCN_INCFLAGS) $(UCB_INCFLAGS) |
236
|
78 |
5
|
79 LIBFLAGS = -L$(TOPDIR) |
236
|
80 |
5
|
81 DEFS = @DEFS@ |
|
82 |
2032
|
83 UGLY_DEFS = @UGLY_DEFS@ |
|
84 |
5
|
85 CC = @CC@ |
1891
|
86 CC_VERSION = @CC_VERSION@ |
5
|
87 CFLAGS = @CFLAGS@ |
1832
|
88 CPICFLAG = @CPICFLAG@ |
325
|
89 GCC_IEEE_FP_FLAG = @GCC_IEEE_FP_FLAG@ |
|
90 ALL_CFLAGS = $(INCFLAGS) $(DEFS) $(GCC_IEEE_FP_FLAG) $(CFLAGS) |
798
|
91 BUG_CFLAGS = $(DEFS) $(GCC_IEEE_FP_FLAG) $(CFLAGS) |
|
92 |
5
|
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 FLIB_LIST = @FLIB_LIST@ |
|
118 FLIB_PATH = @FLIB_PATH@ |
|
119 |
|
120 CXXLIBS = @CXXLIBS@ |
|
121 CXXLIB_LIST = @CXXLIB_LIST@ |
|
122 CXXLIB_PATH = @CXXLIB_PATH@ |
|
123 |
2147
|
124 TERMLIBS = @TERMLIBS@ |
|
125 LIBPLPLOT = @LIBPLPLOT@ |
|
126 LIBDLFCN = @LIBDLFCN@ |
5
|
127 |
2257
|
128 SH_FLIBS = @SH_FLIBS@ |
|
129 SH_TERMLIBS = @SH_TERMLIBS@ |
|
130 SH_LIBS = @SH_LIBS@ |
|
131 |
2155
|
132 # The arguments passed to configure. |
2156
|
133 config_opts = @config_opts@ |
2155
|
134 |
5
|
135 # A shell command to extract the version number from version.h. |
1105
|
136 getversion = sed -e '/VERSION/!d' -e 's/.*"\(.*\)".*$$/\1/' -e q |
5
|
137 |
|
138 # The version number. TOPDIR is something like `.' or `..' or `../..' |
|
139 # and gets us back up to the top level of the source tree. |
727
|
140 version := $(shell $(getversion) $(srcdir)/$(TOPDIR)/src/version.h) |
5
|
141 |
666
|
142 # ==================== Where To Install Things ==================== |
5
|
143 |
666
|
144 # The default location for installation. Everything is placed in |
|
145 # subdirectories of this directory. The default values for many of |
|
146 # the variables below are expressed in terms of this one, so you may |
|
147 # not need to change them. This defaults to /usr/local. |
|
148 prefix = @prefix@ |
5
|
149 |
666
|
150 # Like `prefix', but used for architecture-specific files. |
|
151 exec_prefix = @exec_prefix@ |
|
152 |
|
153 # Where to install Octave and other binaries that people will want to |
|
154 # run directly. |
|
155 bindir = @bindir@ |
5
|
156 |
666
|
157 # Where to install architecture-independent data files. ${fcnfiledir} |
|
158 # and ${localfcnfiledir} are subdirectories of this. |
|
159 datadir = @datadir@ |
5
|
160 |
666
|
161 # Where to install and expect libraries like libcruft.a, liboctave.a, |
1720
|
162 # and libreadline.a and other architecture-dependent data. The |
|
163 # directory ${archlibdir} is a subdirectory of this. |
666
|
164 libdir = @libdir@ |
5
|
165 |
1720
|
166 # Where to install and expect executable programs to be run by Octave |
|
167 # rather than directly by users. |
|
168 libexecdir = @libexecdir@ |
|
169 |
2141
|
170 # The prefix for Octave's include file directory. The default is |
|
171 # ${prefix}/include |
2223
|
172 includedir = @includedir@ |
2141
|
173 |
666
|
174 # Where to install Octave's include files. The default is |
2223
|
175 # ${includedir}/octave-${version} |
|
176 octincludedir = @octincludedir@ |
666
|
177 |
|
178 # Where to install Octave's man pages, and what extension they should |
|
179 # have. The default is ${prefix}/man/man1 |
|
180 mandir = @mandir@ |
2223
|
181 man1dir = @man1dir@ |
|
182 man1ext = @man1ext@ |
5
|
183 |
666
|
184 # Where to install and expect the info files describing Octave.. |
|
185 infodir = @infodir@ |
|
186 |
|
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 |
|
211 # Where to put object files that will by dynamically loaded. |
|
212 # This path usually includes the Octave version and configuration |
|
213 # name, so that multiple configurations for multiple versions of |
|
214 # Octave may be installed at once. |
|
215 octfiledir = @octfiledir@ |
5
|
216 |
666
|
217 # Directories Octave should search for object files that will be |
|
218 # dynamically loaded and that are specific to this site |
|
219 # (i.e. customizations), before consulting ${octfiledir}. This should |
|
220 # be a colon-separated list of directories. |
827
|
221 localoctfiledir = @localoctfiledir@ |
666
|
222 localoctfilepath = @localoctfilepath@ |
|
223 |
|
224 # Where Octave will search to find its function files. Before |
|
225 # changing this, check to see if your purpose wouldn't |
|
226 # better be served by changing localfcnfilepath. This |
|
227 # should be a colon-separated list of directories. |
|
228 fcnfilepath = @fcnfilepath@ |
5
|
229 |
685
|
230 # Where Octave will search to find image files.es. |
827
|
231 imagedir = @imagedir@ |
685
|
232 imagepath = @imagepath@ |
|
233 |
5
|
234 # The type of computer we are running on. |
|
235 target_host_type = @target_host_type@ |
|
236 |
|
237 # The following pattern rules and the substitution functions require |
|
238 # GNU make. If you don't have it, get it! |
|
239 |
1679
|
240 # Rules for making object files from Fortran source. |
994
|
241 # |
|
242 # If we are using f2c there will be a command for the `%.c : %.f' |
|
243 # pattern and no command for the `%.o : %.f' pattern, so that make |
|
244 # will not invoke the fortran compiler by mistake. |
|
245 # |
|
246 # If we are not using f2c, it should be ok to have an empty rule for |
|
247 # the pattern `%.c : %.f', but we don't want to replace make's default |
|
248 # rule for making object from Fortran source files, so there should be |
|
249 # no pattern or command for that. |
5
|
250 |
1679
|
251 @f77_rules_frag@ |
994
|
252 |
1668
|
253 # How to make .o files: |
5
|
254 |
1984
|
255 %.o : %.c |
5
|
256 $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $< |
|
257 |
1984
|
258 %.o : %.cc |
5
|
259 $(CXX) -c $(CPPFLAGS) $(ALL_CXXFLAGS) $< |
308
|
260 |
1984
|
261 pic/%.o : %.c |
|
262 $(CC) -c $(CPPFLAGS) $(CPICFLAG) $(ALL_CFLAGS) $< -o $@ |
|
263 |
|
264 pic/%.o : %.cc |
|
265 $(CXX) -c $(CPPFLAGS) $(CXXPICFLAG) $(ALL_CXXFLAGS) $< -o $@ |
|
266 |
308
|
267 # Here is a rule for generating dependencies for .cc files: |
|
268 |
1984
|
269 %.d : %.cc |
518
|
270 @echo making $@ from $< |
|
271 @rm -f $@ |
|
272 @-if test "$(srcdir)" = "." ; then \ |
308
|
273 $(CXX) -MM $(CPPFLAGS) $(ALL_CXXFLAGS) $< | \ |
2054
|
274 sed -e 's,$*\.o,pic/& & $@,g' > $@.tmp ; \ |
308
|
275 else \ |
|
276 $(CXX) -MM $(CPPFLAGS) $(ALL_CXXFLAGS) $< | \ |
2054
|
277 sed -e 's,$*\.o,pic/& & $@,g' -e 's,$(srcdir)/,,g' > $@.tmp ; \ |
308
|
278 fi |
518
|
279 @mv $@.tmp $@ |
308
|
280 |
|
281 # And one for .c files.too: |
|
282 |
1984
|
283 %.d : %.c |
518
|
284 @echo making $@ from $< |
|
285 @rm -f $@ |
|
286 @-if test "$(srcdir)" = "." ; then \ |
308
|
287 $(CC) -MM $(CPPFLAGS) $(ALL_CFLAGS) $< | \ |
2054
|
288 sed -e 's,$*\.o,pic/& & $@,g' > $@.tmp ; \ |
308
|
289 else \ |
|
290 $(CC) -MM $(CPPFLAGS) $(ALL_CFLAGS) $< | \ |
2054
|
291 sed -e 's,$*\.o,pic/& & $@,g' -e 's,$(srcdir)/,,g' > $@.tmp ; \ |
308
|
292 fi |
518
|
293 @mv $@.tmp $@ |
1166
|
294 |
1685
|
295 define do-subdir-for-command |
|
296 echo making $@ in $d; cd $d; $(MAKE) $@; cd ..; |
1166
|
297 endef |
1685
|
298 |
|
299 define subdir-for-command |
|
300 $(foreach d, $(SUBDIRS), $(do-subdir-for-command)) |
|
301 endef |
2157
|
302 |
|
303 define do-subst-config-vals |
2223
|
304 echo "making $@ from $<" |
|
305 sed < $< > $@.tmp \ |
2159
|
306 -e "s;%VERSION%;\"${version}\";" \ |
|
307 -e "s;%config_opts%;\"${config_opts}\";" \ |
|
308 -e "s;%TARGET_HOST_TYPE%;\"${target_host_type}\";" \ |
|
309 -e "s;%F77%;\"${F77}\";" \ |
|
310 -e "s;%FFLAGS%;\"${FFLAGS}\";" \ |
|
311 -e "s;%FPICFLAG%;\"${FPICFLAG}\";" \ |
|
312 -e "s;%F2C%;\"${F2C}\";" \ |
|
313 -e "s;%F2CFLAGS%;\"${F2CFLAGS}\";" \ |
|
314 -e "s;%FLIBS%;\"${FLIBS}\";" \ |
|
315 -e "s;%CPPFLAGS%;\"${CPPFLAGS}\";" \ |
2223
|
316 -e "s;%INCFLAGS%;\"-I${includedir} -I${octincludedir}\";" \ |
2159
|
317 -e "s;%CC%;\"${CC}\";" \ |
|
318 -e "s;%CC_VERSION%;\"${CC_VERSION}\";" \ |
|
319 -e "s;%CFLAGS%;\"${BUG_CFLAGS}\";" \ |
|
320 -e "s;%CPICFLAG%;\"${CPICFLAG}\";" \ |
|
321 -e "s;%CXX%;\"${CXX}\";" \ |
|
322 -e "s;%CXX_VERSION%;\"${CXX_VERSION}\";" \ |
|
323 -e "s;%CXXFLAGS%;\"${CXXFLAGS}\";" \ |
|
324 -e "s;%CXXPICFLAG%;\"${CXXPICFLAG}\";" \ |
|
325 -e "s;%BUG_CXXFLAGS%;\"${BUG_CXXFLAGS}\";" \ |
|
326 -e "s;%HOST_CXXFLAGS%;\"${HOST_CXXFLAGS}\";" \ |
|
327 -e "s;%NO_IMPLICIT_TEMPLATES%;\"${NO_IMPLICIT_TEMPLATES}\";" \ |
|
328 -e "s;%GCC_IEEE_FP_FLAG%;\"${GCC_IEEE_FP_FLAG}\";" \ |
|
329 -e "s;%LDFLAGS%;\"${LDFLAGS}\";" \ |
2160
|
330 -e "s;%LIBFLAGS%;\"-L${libdir}\";" \ |
2159
|
331 -e "s;%RLD_FLAG%;\"${RLD_FLAG}\";" \ |
|
332 -e "s;%CXXLIBS%;\"${CXXLIBS}\";" \ |
|
333 -e "s;%TERMLIBS%;\"${TERMLIBS}\";" \ |
|
334 -e "s;%LIBS%;\"${LIBS}\";" \ |
|
335 -e "s;%LEXLIB%;\"${LEXLIB}\";" \ |
|
336 -e "s;%LIBPLPLOT%;\"${LIBPLPLOT}\";" \ |
|
337 -e "s;%LIBDLFCN%;\"${LIBDLFCN}\";" \ |
|
338 -e "s;%DEFS%;\"${UGLY_DEFS}\";" |
2157
|
339 $(top_srcdir)/move-if-change $@.tmp $@ |
|
340 endef |
|
341 |
|
342 define do-subst-default-vals |
2223
|
343 echo "making $@ from $<" |
|
344 sed < $< > $@.tmp \ |
2157
|
345 -e "s;%DEFAULT_PAGER%;\"${DEFAULT_PAGER}\";" \ |
|
346 -e "s;%OCTAVE_PREFIX%;\"${prefix}\";" \ |
|
347 -e "s;%OCTAVE_EXEC_PREFIX%;\"${exec_prefix}\";" \ |
|
348 -e "s;%OCTAVE_DATADIR%;\"${datadir}\";" \ |
|
349 -e "s;%OCTAVE_BINDIR%;\"${bindir}\";" \ |
|
350 -e "s;%OCTAVE_LIBDIR%;\"${libdir}\";" \ |
|
351 -e "s;%OCTAVE_INFODIR%;\"${infodir}\";" \ |
|
352 -e "s;%OCTAVE_FCNFILEDIR%;\"${fcnfiledir}\";" \ |
|
353 -e "s;%OCTAVE_LOCALFCNFILEDIR%;\"${localfcnfiledir}\";" \ |
|
354 -e "s;%OCTAVE_LOCALFCNFILEPATH%;\"${localfcnfilepath}\";" \ |
|
355 -e "s;%OCTAVE_ARCHLIBDIR%;\"${archlibdir}\";" \ |
|
356 -e "s;%OCTAVE_OCTFILEDIR%;\"${octfiledir}\";" \ |
|
357 -e "s;%OCTAVE_LOCALOCTFILEPATH%;\"${localoctfilepath}\";" \ |
|
358 -e "s;%OCTAVE_FCNFILEPATH%;\"${fcnfilepath}\";" \ |
|
359 -e "s;%OCTAVE_IMAGEPATH%;\"${imagepath}\";" \ |
|
360 -e "s;%TARGET_HOST_TYPE%;\"${target_host_type}\";" \ |
|
361 -e "s;%FLIB_LIST%;\"${FLIB_LIST}\";" \ |
|
362 -e "s;%FLIB_PATH%;\"${FLIB_PATH}\";" \ |
|
363 -e "s;%CXXLIB_LIST%;\"${CXXLIB_LIST}\";" \ |
|
364 -e "s;%CXXLIB_PATH%;\"${CXXLIB_PATH}\";" |
|
365 $(top_srcdir)/move-if-change $@.tmp $@ |
|
366 endef |