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