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