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