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