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