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