]>
Commit | Line | Data |
---|---|---|
28f540f4 RM |
1 | # Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. |
2 | # This file is part of the GNU C Library. | |
3 | ||
4 | # The GNU C Library is free software; you can redistribute it and/or | |
5 | # modify it under the terms of the GNU Library General Public License as | |
6 | # published by the Free Software Foundation; either version 2 of the | |
7 | # License, or (at your option) any later version. | |
8 | ||
9 | # The GNU C Library is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
12 | # Library General Public License for more details. | |
13 | ||
14 | # You should have received a copy of the GNU Library General Public | |
15 | # License along with the GNU C Library; see the file COPYING.LIB. If | |
16 | # not, write to the Free Software Foundation, Inc., 675 Mass Ave, | |
17 | # Cambridge, MA 02139, USA. | |
18 | ||
19 | # | |
20 | # Makefile configuration options for the GNU C library. | |
21 | # | |
22 | ifneq (,) | |
23 | This makefile requires GNU Make. | |
24 | endif | |
25 | ||
26 | ifneq "$(origin +included-Makeconfig)" "file" | |
27 | ||
28 | +included-Makeconfig := yes | |
29 | ||
30 | ifdef subdir | |
31 | .. := ../ | |
32 | endif | |
33 | ||
34 | # If config.make exists, the source directory was configured, | |
35 | # so don't try to be clever and find another directory to build in. | |
36 | ifneq (,$(wildcard $(..)config.make)) | |
37 | ARCH = | |
38 | machine = | |
39 | else # Not configured. | |
40 | ifndef ARCH | |
41 | ifdef machine | |
42 | ARCH = $(machine) | |
43 | endif # machine | |
44 | endif # ARCH | |
45 | endif # config.make | |
46 | ||
47 | # Directory for object files and libc.a. If this is not defined, the | |
48 | # object files live in the subdirectories where their sources live, and | |
49 | # libc.a lives in the parent directory (this probably doesn't work any | |
50 | # more). | |
51 | ifdef ARCH | |
52 | ifeq ($(filter /%,$(ARCH)),) | |
53 | objdir := $(..)$(ARCH) | |
54 | else | |
55 | objdir = $(ARCH) | |
56 | endif | |
57 | endif | |
58 | ||
59 | # $(common-objdir) is the place to put objects and | |
60 | # such that are not specific to a single subdir. | |
61 | ifdef objdir | |
62 | objpfx = $(objdir)/ | |
63 | common-objpfx = $(objpfx) | |
64 | common-objdir = $(objdir) | |
65 | else | |
66 | objpfx := | |
67 | ifdef .. | |
68 | common-objpfx = $(..) | |
69 | common-objdir = .. | |
70 | else | |
71 | # This is a kludge. make wizards might grok. | |
72 | common-objpfx = sysdeps/../ | |
73 | common-objdir = . | |
74 | endif | |
75 | endif | |
76 | ||
77 | libc.a = $(common-objpfx)libc.a | |
78 | ||
79 | ||
80 | # Get the values defined by options to `configure'. | |
81 | include $(common-objpfx)config.make | |
82 | ||
83 | # Force the user to configure before making. | |
84 | $(common-objpfx)config.make: | |
85 | @echo The GNU C library has not been configured. >&2 | |
86 | @echo Run \`configure\' to configure it before building. >&2 | |
87 | @exit 1 | |
88 | ||
89 | # Get the user's configuration parameters. | |
90 | ifneq ($(wildcard $(..)configparms),) | |
91 | include $(..)configparms | |
92 | endif | |
93 | ifneq ($(objpfx),) | |
94 | ifneq ($(wildcard $(objpfx)configparms),) | |
95 | include $(objpfx)configparms | |
96 | endif | |
97 | endif | |
98 | ||
99 | sysdep_dir := $(..)sysdeps | |
100 | export sysdep_dir := $(sysdep_dir) | |
101 | \f | |
102 | #### | |
103 | #### These are the configuration variables. You can define values for | |
104 | #### the variables below in the file `configparms'. | |
105 | #### Do NOT edit this file. | |
106 | #### | |
107 | ||
108 | ||
109 | # Common prefix for machine-independent installation directories. | |
110 | ifndef prefix | |
111 | prefix = /usr/local | |
112 | endif | |
113 | ||
114 | # Common prefix for machine-dependent installation directories. | |
115 | ifndef exec_prefix | |
116 | exec_prefix = $(prefix) | |
117 | endif | |
118 | ||
119 | # Where to install the library and object files. | |
120 | ifndef libdir | |
121 | libdir = $(exec_prefix)/lib | |
122 | endif | |
123 | ||
124 | # Prefix to put on files installed in $(libdir). For libraries `libNAME.a', | |
125 | # the prefix is spliced between `lib' and the name, so the linker switch | |
126 | # `-l$(libprefix)NAME' finds the library; for other files the prefix is | |
127 | # just prepended to the whole file name. | |
128 | ifndef libprefix | |
129 | libprefix = | |
130 | endif | |
131 | ||
132 | # Where to install the header files. | |
133 | ifndef includedir | |
134 | includedir = $(exec_prefix)/include | |
135 | endif | |
136 | ||
28f540f4 RM |
137 | # Where to install machine-independent data files. |
138 | # These are the timezone database, and eventually the locale database. | |
139 | ifndef datadir | |
140 | datadir = $(prefix)/share | |
141 | endif | |
142 | ||
143 | # Where to install the timezone data files (which are machine-independent). | |
144 | ifndef zonedir | |
145 | zonedir = $(datadir)/zoneinfo | |
146 | endif | |
147 | ||
148 | # Where to install programs. | |
149 | ifndef bindir | |
150 | bindir = $(exec_prefix)/bin | |
151 | endif | |
152 | ||
153 | # Where to install administrative programs. | |
154 | ifndef sbindir | |
155 | sbindir = $(exec_prefix)/sbin | |
156 | endif | |
157 | ||
158 | # Where to install the Info files. | |
159 | ifndef infodir | |
160 | infodir = $(prefix)/info | |
161 | endif | |
162 | ||
163 | # Where to install default configuration files. These include the local | |
164 | # timezone specification and network data base files. | |
165 | ifndef sysconfdir | |
166 | sysconfdir = $(prefix)/etc | |
167 | endif | |
168 | ||
169 | # What timezone should be the installed default (e.g., US/Eastern). | |
170 | # Run `make -C time echo-zonenames' to see a list of available zone names. | |
171 | # The local timezone can be changed with `zic -l TIMEZONE' at any time. | |
172 | ifndef localtime | |
173 | localtime = Factory | |
174 | endif | |
175 | ||
176 | # Where to install the "localtime" timezone file; this is the file whose | |
177 | # contents $(localtime) specifies. If this is a relative pathname, it is | |
178 | # relative to $(zonedir). It is a good idea to put this somewhere | |
179 | # other than there, so the zoneinfo directory contains only universal data, | |
180 | # localizing the configuration data elsewhere. | |
181 | ifndef localtime-file | |
182 | localtime-file = $(sysconfdir)/localtime | |
183 | endif | |
184 | ||
185 | # What timezone's DST rules should be used when a POSIX-style TZ | |
186 | # environment variable doesn't specify any rules. For 1003.1 compliance | |
187 | # this timezone must use rules that are as U.S. federal law defines DST. | |
188 | # Run `make -C time echo-zonenames' to see a list of available zone names. | |
189 | # This setting can be changed with `zic -p TIMEZONE' at any time. | |
190 | # If you want POSIX.1 compatibility, use `America/New_York'. | |
191 | ifndef posixrules | |
192 | posixrules = America/New_York | |
193 | endif | |
194 | ||
195 | # Where to install the "posixrules" timezone file; this is file | |
196 | # whose contents $(posixrules) specifies. If this is a relative | |
197 | # pathname, it is relative to $(zonedir). | |
198 | ifndef posixrules-file | |
199 | posixrules-file = posixrules | |
200 | endif | |
201 | ||
202 | ||
203 | # Directory where your system's native header files live. | |
204 | # This is used on Unix systems to generate some GNU libc header files. | |
205 | ifndef sysincludedir | |
206 | sysincludedir = /usr/include | |
207 | endif | |
208 | ||
209 | ||
210 | # Commands to install files. | |
211 | ifndef INSTALL_DATA | |
212 | INSTALL_DATA = $(INSTALL) -m 644 | |
213 | endif | |
214 | ifndef INSTALL_PROGRAM | |
215 | INSTALL_PROGRAM = $(INSTALL) | |
216 | endif | |
217 | ifndef INSTALL | |
218 | INSTALL = install | |
219 | endif | |
220 | ||
221 | ||
222 | # The name of the C compiler. | |
223 | # If you've got GCC, and it works, use it. | |
224 | ifeq ($(origin CC),default) | |
225 | CC := gcc | |
226 | endif | |
227 | ||
228 | # The name of the C compiler to use for compilations of programs to run on | |
229 | # the host that is building the library. If you set CC to a | |
230 | # cross-compiler, you must set this to the normal compiler. | |
231 | ifndef BUILD_CC | |
232 | BUILD_CC = $(CC) | |
233 | endif | |
234 | ||
235 | # Default flags to pass the C compiler. | |
236 | ifndef default_cflags | |
237 | default_cflags := -g | |
238 | endif | |
239 | ||
240 | # Flags to pass the C compiler when assembling preprocessed assembly code | |
241 | # (`.S' files). On some systems the assembler doesn't understand the `#' line | |
242 | # directives the preprocessor produces. If you have troubling compiling | |
243 | # assembly code, try using -P here to suppress these directives. | |
244 | ifndef asm-CPPFLAGS | |
245 | asm-CPPFLAGS = | |
246 | endif | |
247 | ||
248 | # Command for linking programs with the C library. | |
249 | ifndef +link | |
250 | +link = $(CC) -nostdlib $(LDFLAGS) -o $@ \ | |
96f873b9 RM |
251 | $(addprefix $(csu-objpfx),start.o $(+preinit)) \ |
252 | $(^:lib=$(libc.a)) $(gnulib) $(libc.a) \ | |
253 | $(addprefix $(csu-objpfx),$(+postinit)) | |
28f540f4 RM |
254 | endif |
255 | ifndef gnulib | |
256 | gnulib := -lgcc | |
257 | endif | |
96f873b9 RM |
258 | ifeq ($(elf),yes) |
259 | +preinit = crti.o | |
260 | +postinit = crtn.o | |
261 | endif | |
262 | ifdef objpfx | |
263 | csu-objpfx = $(objpfx) | |
264 | else | |
265 | csu-objpfx = $(..)csu | |
266 | endif | |
28f540f4 RM |
267 | |
268 | ifndef LD | |
269 | LD := ld -X | |
270 | endif | |
271 | ||
272 | ifndef RANLIB | |
273 | RANLIB = ranlib | |
274 | endif | |
275 | ||
276 | # Extra flags to pass to GCC. | |
277 | +gccwarn := -Wall -Wwrite-strings -Wno-parentheses | |
278 | ||
279 | # This is the program that generates makefile | |
280 | # dependencies from C source files. | |
281 | ifndef +mkdep | |
282 | +mkdep = $(CC) -M | |
283 | endif | |
284 | ||
285 | # The program that makes Emacs-style TAGS files. | |
286 | ETAGS := etags -T | |
287 | ||
288 | # The `m4' macro processor; this is used by sysdeps/sparc/Makefile (and | |
289 | # perhaps others) to preprocess assembly code in some cases. | |
290 | M4 = m4 | |
291 | ||
292 | #### | |
293 | #### End of configuration variables. | |
294 | #### | |
295 | \f | |
296 | # This tells some versions of GNU make before 3.63 not to export all variables. | |
297 | .NOEXPORT: | |
298 | ||
299 | # We want to echo the commands we're running without | |
300 | # umpteem zillion filenames along with it (we use `...' instead) | |
301 | # but we don't want this echoing done when the user has said | |
302 | # he doesn't want to see commands echoed by using -s. | |
303 | ifneq "$(findstring s,$(MAKEFLAGS))" "" # if -s | |
304 | +cmdecho := echo >/dev/null | |
305 | else # not -s | |
306 | +cmdecho := echo | |
307 | endif # -s | |
308 | ||
309 | # These are the flags given to the compiler to tell | |
310 | # it what sort of optimization and/or debugging output to do. | |
311 | ifndef +cflags | |
312 | # If `CFLAGS' was defined, use that. | |
313 | ifdef CFLAGS | |
314 | +cflags := $(filter-out -I%,$(CFLAGS)) | |
315 | endif # CFLAGS | |
316 | endif # +cflags | |
317 | ||
318 | # If none of the above worked, default to "-g". | |
319 | ifeq "$(strip $(+cflags))" "" | |
320 | +cflags := $(default_cflags) | |
321 | endif # $(+cflags) == "" | |
322 | ||
323 | # If using gcc, add flags that only it will grok. | |
324 | ifneq "$(findstring gcc,$(CC))" "" | |
325 | +cflags := $(+cflags) $(+gccwarn) | |
326 | +gcc-nowarn := -w | |
327 | else | |
328 | +gcc-nowarn := | |
329 | endif # gcc | |
330 | ||
331 | # Don't duplicate options if we inherited variables from the parent. | |
332 | +cflags := $(sort $(+cflags)) | |
333 | ||
334 | ||
335 | # These are flags given to the C compiler to tell it to look for include | |
336 | # files (including ones given in angle brackets) in the current directory | |
337 | # and in the parent library source directory. | |
338 | # `+sysdep-includes' will be defined by Makerules. | |
339 | +includes = -I. $(filter-out -I,-I$(patsubst %/,%,$(..))) \ | |
340 | $(includes) $(+sysdep-includes) $(last-includes) | |
341 | ||
342 | ||
343 | # These are the variables that the implicit compilation rules use. | |
344 | CPPFLAGS = $(+includes) $(defines) -include $(..)libc-symbols.h \ | |
345 | $(sysdep-CPPFLAGS) | |
346 | override CFLAGS = $(+cflags) $(sysdep-CFLAGS) | |
347 | ||
348 | ||
349 | # This is the macro that the implicit linking rules use. | |
350 | ifneq "$(filter -g,$(+cflags))" "" # -g is in $(+cflags) | |
351 | LDFLAGS := -g | |
352 | endif | |
353 | ||
354 | +gnu-stabs = $(shell echo>&2 '*** BARF ON ME') | |
355 | ||
356 | ifneq ($(BUILD_CC),$(CC)) | |
357 | cross-compiling := yes | |
358 | else | |
359 | cross-compiling := no | |
360 | endif | |
361 | ||
362 | ||
363 | endif # Makeconfig not yet included |