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