]>
Commit | Line | Data |
---|---|---|
fa958513 DJ |
1 | # Makefile.in |
2 | ||
3 | # Copyright (C) 2005, 2006 Free Software Foundation | |
4 | # | |
5 | # This file is part of GCC. | |
6 | # | |
7 | # GCC is free software; you can redistribute it and/or modify it under the | |
8 | # terms of the GNU Library General Public License as published by the Free | |
9 | # Software Foundation; either version 2 of the License, or (at your option) | |
10 | # any later version. | |
11 | # | |
12 | # GCC is distributed in the hope that it will be useful, but WITHOUT ANY | |
13 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | |
14 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
15 | # more details. | |
16 | # | |
17 | # You should have received a copy of the GNU General Public License along | |
18 | # with GCC; see the file COPYING. If not, write to the Free Software | |
19 | # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, | |
20 | # USA. | |
21 | # | |
22 | ||
23 | libgcc_topdir = @libgcc_topdir@ | |
14e8fc8b PB |
24 | host_subdir = @host_subdir@ |
25 | ||
fa958513 | 26 | gcc_srcdir = $(libgcc_topdir)/gcc |
14e8fc8b | 27 | gcc_objdir = $(MULTIBUILDTOP)../../$(host_subdir)/gcc |
fa958513 DJ |
28 | |
29 | srcdir = @srcdir@ | |
30 | ||
31 | prefix = @prefix@ | |
32 | ||
33 | exec_prefix = @exec_prefix@ | |
34 | libdir = @libdir@ | |
89deeaff | 35 | shlib_slibdir = @slibdir@ |
fa958513 DJ |
36 | |
37 | SHELL = @SHELL@ | |
38 | ||
39 | enable_shared = @enable_shared@ | |
40 | decimal_float = @decimal_float@ | |
79b87c74 | 41 | enable_decimal_float = @enable_decimal_float@ |
8d2a9e0e | 42 | fixed_point = @fixed_point@ |
fa958513 DJ |
43 | |
44 | host_noncanonical = @host_noncanonical@ | |
45 | ||
46 | # List of extra object files that should be compiled for this target machine. | |
47 | # The rules for compiling them should be in the t-* file for the machine. | |
48 | EXTRA_PARTS = @extra_parts@ | |
49 | ||
50 | # Multilib support variables. | |
51 | MULTISRCTOP = | |
52 | MULTIBUILDTOP = | |
53 | MULTIDIRS = | |
54 | MULTISUBDIR = | |
55 | MULTIDO = true | |
56 | MULTICLEAN = true | |
57 | ||
58 | INSTALL = @INSTALL@ | |
59 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
60 | INSTALL_DATA = @INSTALL_DATA@ | |
61 | mkinstalldirs = $(SHELL) $(libgcc_topdir)/mkinstalldirs | |
62 | ||
63 | objext = .o | |
64 | ||
65 | AR = @AR@ | |
66 | AR_FLAGS = rc | |
67 | ||
68 | CC = @CC@ | |
69 | CFLAGS = @CFLAGS@ | |
70 | RANLIB = @RANLIB@ | |
fa958513 | 71 | LN_S = @LN_S@ |
fa958513 DJ |
72 | |
73 | PWD_COMMAND = $${PWDCMD-pwd} | |
74 | ||
75 | # Flags to pass to a recursive make. | |
76 | FLAGS_TO_PASS = \ | |
77 | "AR=$(AR)" \ | |
78 | "AR_FLAGS=$(AR_FLAGS)" \ | |
79 | "CC=$(CC)" \ | |
80 | "CFLAGS=$(CFLAGS)" \ | |
81 | "DESTDIR=$(DESTDIR)" \ | |
82 | "EXTRA_OFILES=$(EXTRA_OFILES)" \ | |
83 | "HDEFINES=$(HDEFINES)" \ | |
84 | "INSTALL=$(INSTALL)" \ | |
85 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
86 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ | |
87 | "LDFLAGS=$(LDFLAGS)" \ | |
88 | "LOADLIBES=$(LOADLIBES)" \ | |
89 | "RANLIB=$(RANLIB)" \ | |
90 | "SHELL=$(SHELL)" \ | |
91 | "prefix=$(prefix)" \ | |
92 | "exec_prefix=$(exec_prefix)" \ | |
93 | "libdir=$(libdir)" \ | |
94 | "libsubdir=$(libsubdir)" \ | |
95 | "tooldir=$(tooldir)" | |
96 | ||
97 | # Dependencies for "all" are set later in the file. | |
98 | all: all-multi | |
99 | # Now that we have built all the objects, we need to copy | |
100 | # them back to the GCC directory. Too many things (other | |
101 | # in-tree libraries, and DejaGNU) know about the layout | |
102 | # of the build tree, for now. | |
edbf8b16 | 103 | $(MAKE) install-leaf DESTDIR=$(gcc_objdir) \ |
fa958513 DJ |
104 | slibdir= libsubdir= MULTIOSDIR=$(MULTIDIR) |
105 | ||
106 | .PHONY: all-multi | |
107 | all-multi: | |
108 | # If this is the top-level multilib, build all the other | |
109 | # multilibs. | |
110 | @: $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all | |
111 | ||
112 | .PHONY: check installcheck | |
113 | check: | |
114 | installcheck: | |
115 | ||
116 | .PHONY: all clean | |
117 | ||
118 | clean: | |
119 | -rm -f config.h stamp-h stmp-ldirs libgcc.map | |
120 | -rm -f *$(objext) | |
121 | -rm -f *.dep | |
122 | -rm -f *.a | |
123 | -rm -f libunwind$(SHLIB_EXT) | |
124 | -rm -f libgcc_s* | |
125 | @$(MULTICLEAN) multi-clean DO=clean | |
126 | distclean: clean | |
127 | @$(MULTICLEAN) multi-clean DO=distclean | |
128 | -rm -f *~ Makefile config.cache config.status multilib.out | |
129 | -rm -f config.log | |
130 | maintainer-clean realclean: distclean | |
131 | ||
132 | Makefile: $(srcdir)/Makefile.in config.status | |
133 | CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status | |
134 | ||
135 | # Depending on Makefile makes sure that config.status has been re-run | |
136 | # if needed. This prevents problems with parallel builds. | |
137 | config.h: stamp-h ; @true | |
138 | stamp-h: $(srcdir)/config.in config.status Makefile | |
139 | CONFIG_FILES= CONFIG_HEADERS=config.h:$(srcdir)/config.in $(SHELL) ./config.status | |
140 | ||
141 | config.status: $(srcdir)/configure | |
142 | $(SHELL) ./config.status --recheck | |
143 | ||
144 | include $(gcc_objdir)/libgcc.mvars | |
145 | ||
146 | # Flags to pass to recursive makes. | |
147 | ||
148 | AR_FOR_TARGET = $(AR) | |
149 | AR_FLAGS_FOR_TARGET = | |
150 | AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc | |
151 | AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x | |
152 | AWK = @AWK@ | |
153 | GCC_FOR_TARGET = $(CC) | |
154 | LIPO = @LIPO@ | |
155 | LIPO_FOR_TARGET = $(LIPO) | |
156 | MACHMODE_H = machmode.h mode-classes.def insn-modes.h | |
157 | NM = @NM@ | |
158 | NM_FOR_TARGET = $(NM) | |
159 | RANLIB_FOR_TARGET = $(RANLIB) | |
160 | STRIP = @STRIP@ | |
161 | STRIP_FOR_TARGET = $(STRIP) | |
162 | ||
163 | # Directory in which the compiler finds libraries etc. | |
164 | libsubdir = $(libdir)/gcc/$(host_noncanonical)/$(version) | |
165 | # Used to install the shared libgcc. | |
166 | slibdir = @slibdir@ | |
167 | ||
168 | export AR_FOR_TARGET | |
169 | export AR_CREATE_FOR_TARGET | |
170 | export AR_FLAGS_FOR_TARGET | |
171 | export AR_EXTRACT_FOR_TARGET | |
172 | export AWK | |
173 | export DESTDIR | |
174 | export GCC_FOR_TARGET | |
175 | export INCLUDES | |
176 | export INSTALL_DATA | |
177 | export LIB1ASMSRC | |
178 | export LIBGCC2_CFLAGS | |
179 | export LIPO_FOR_TARGET | |
180 | export MACHMODE_H | |
181 | export NM_FOR_TARGET | |
182 | export STRIP_FOR_TARGET | |
183 | export RANLIB_FOR_TARGET | |
184 | export libsubdir | |
185 | export slibdir | |
186 | ||
79e6eaeb DJ |
187 | version := $(shell $(CC) -dumpversion) |
188 | ||
79b87c74 | 189 | ifeq ($(decimal_float),yes) |
200359e8 L |
190 | ifeq ($(enable_decimal_float),bid) |
191 | DECNUMINC = -I$(srcdir)/config/libbid -DENABLE_DECIMAL_BID_FORMAT | |
192 | else | |
79b87c74 | 193 | DECNUMINC = -I$(srcdir)/../libdecnumber/$(enable_decimal_float) \ |
bc6d4c3f | 194 | -I$(srcdir)/../libdecnumber |
200359e8 | 195 | endif |
79b87c74 MM |
196 | else |
197 | DECNUMINC = | |
198 | endif | |
fa958513 DJ |
199 | |
200 | # Specify the directories to be searched for header files. | |
201 | # Both . and srcdir are used, in that order, | |
202 | # so that *config.h will be found in the compilation | |
203 | # subdirectory rather than in the source directory. | |
204 | # -I$(@D) and -I$(srcdir)/$(@D) cause the subdirectory of the file | |
205 | # currently being compiled, in both source trees, to be examined as well. | |
206 | INCLUDES = -I. -I$(@D) -I$(gcc_objdir) \ | |
207 | -I$(srcdir) -I$(srcdir)/$(@D) -I$(srcdir)/../gcc \ | |
208 | -I$(srcdir)/../include $(DECNUMINC) | |
209 | ||
9891ec5f DJ |
210 | # Forcibly remove any profiling-related flags. There is no point |
211 | # in supporting profiled bootstrap in this library. | |
212 | override CFLAGS := $(filter-out -fprofile-generate -fprofile-use,$(CFLAGS)) | |
213 | ||
fa958513 DJ |
214 | # CFLAGS first is not perfect; normally setting CFLAGS should override any |
215 | # options in LIBGCC2_CFLAGS. But LIBGCC2_CFLAGS may contain -g0, and CFLAGS | |
216 | # will usually contain -g, so for the moment CFLAGS goes first. We must | |
217 | # include CFLAGS - that's where multilib options live. | |
6f461e76 L |
218 | INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \ |
219 | $(INCLUDES) @set_have_cc_tls@ | |
fa958513 DJ |
220 | |
221 | MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory) | |
222 | MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory) | |
223 | ||
224 | MULTIOSSUBDIR := $(shell if test $(MULTIOSDIR) != .; then echo /$(MULTIOSDIR); fi) | |
225 | inst_libdir = $(libsubdir)$(MULTISUBDIR) | |
226 | inst_slibdir = $(slibdir)$(MULTIOSSUBDIR) | |
227 | ||
228 | gcc_compile_bare = $(CC) $(INTERNAL_CFLAGS) | |
229 | compile_deps = -MT $@ -MD -MP -MF $(basename $@).dep | |
230 | gcc_compile = $(gcc_compile_bare) -o $@ $(compile_deps) | |
231 | gcc_s_compile = $(gcc_compile) -DSHARED | |
232 | ||
233 | objects = $(filter %$(objext),$^) | |
234 | ||
235 | # Collect any host-specific information from Makefile fragments. | |
236 | tmake_file = @tmake_file@ | |
237 | include $(srcdir)/empty.mk $(tmake_file) | |
238 | ||
239 | # Only handle shared libraries if both: | |
240 | # - the user requested them | |
241 | # - we know how to build them | |
242 | ifeq ($(SHLIB_LINK),) | |
243 | enable_shared := no | |
244 | endif | |
245 | ||
246 | ifeq ($(enable_shared),yes) | |
247 | iterator = $(srcdir)/empty.mk $(patsubst %,$(srcdir)/shared-object.mk,$(iter-items)) | |
248 | ||
249 | install-shared = install-shared | |
250 | ||
251 | ifneq ($(LIBUNWIND),) | |
252 | install-libunwind = install-libunwind | |
253 | endif | |
254 | ||
255 | # For -fvisibility=hidden. We need both a -fvisibility=hidden on | |
256 | # the command line, and a #define to prevent libgcc2.h etc from | |
257 | # overriding that with #pragmas. | |
258 | vis_hide = @vis_hide@ | |
259 | ||
260 | ifneq (,$(vis_hide)) | |
261 | ||
262 | # If we have -fvisibility=hidden, then we need to generate hide | |
263 | # lists for object files implemented in assembly. | |
264 | ASM_HIDDEN_OP = @asm_hidden_op@ | |
265 | ||
266 | define gen-hide-list | |
267 | $(NM) -pg $< | \ | |
268 | $(AWK) 'NF == 3 && $$2 !~ /^[UN]$$/ { print "\t$(ASM_HIDDEN_OP)", $$3 }' > $@T | |
269 | mv -f $@T $@ | |
270 | endef | |
271 | else | |
272 | gen-hide-list = echo > $@ | |
273 | endif | |
274 | ||
275 | else | |
276 | # Not enable_shared. | |
277 | iterator = $(srcdir)/empty.mk $(patsubst %,$(srcdir)/static-object.mk,$(iter-items)) | |
278 | vis_hide = | |
279 | gen-hide-list = echo > \$@ | |
280 | endif | |
281 | ||
282 | ifneq ($(EXTRA_PARTS),) | |
283 | extra-parts = libgcc-extra-parts | |
284 | INSTALL_PARTS = $(EXTRA_PARTS) | |
285 | else | |
286 | ifneq ($(GCC_EXTRA_PARTS),) | |
287 | extra-parts = gcc-extra-parts | |
288 | INSTALL_PARTS = $(GCC_EXTRA_PARTS) | |
289 | endif | |
290 | endif | |
291 | ||
292 | # Library members defined in libgcc2.c. | |
293 | lib2funcs = _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _cmpdi2 _ucmpdi2 \ | |
294 | _clear_cache _enable_execute_stack _trampoline __main _absvsi2 \ | |
295 | _absvdi2 _addvsi3 _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 \ | |
296 | _negvsi2 _negvdi2 _ctors _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 \ | |
297 | _ctzsi2 _ctzdi2 _popcount_tab _popcountsi2 _popcountdi2 \ | |
298 | _paritysi2 _paritydi2 _powisf2 _powidf2 _powixf2 _powitf2 \ | |
299 | _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3 _divxc3 \ | |
300 | _divtc3 _bswapsi2 _bswapdi2 | |
301 | ||
302 | # The floating-point conversion routines that involve a single-word integer. | |
303 | # XX stands for the integer mode. | |
304 | swfloatfuncs = $(patsubst %,_fixuns%XX,sf df xf) | |
305 | ||
306 | # Likewise double-word routines. | |
307 | dwfloatfuncs = $(patsubst %,_fix%XX,sf df xf tf) \ | |
308 | $(patsubst %,_fixuns%XX,sf df xf tf) \ | |
309 | $(patsubst %,_floatXX%,sf df xf tf) \ | |
310 | $(patsubst %,_floatunXX%,sf df xf tf) | |
311 | ||
312 | ifeq ($(LIB2_SIDITI_CONV_FUNCS),) | |
313 | lib2funcs += $(subst XX,si,$(swfloatfuncs)) | |
314 | lib2funcs += $(subst XX,di,$(dwfloatfuncs)) | |
315 | endif | |
316 | ||
317 | # These might cause a divide overflow trap and so are compiled with | |
318 | # unwinder info. | |
319 | LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4 | |
320 | ||
321 | # Remove any objects from lib2funcs and LIB2_DIVMOD_FUNCS that are | |
322 | # defined as optimized assembly code in LIB1ASMFUNCS or as C code | |
323 | # in LIB2FUNCS_EXCLUDE. | |
324 | lib2funcs := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS),$(lib2funcs)) | |
325 | LIB2_DIVMOD_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS), \ | |
326 | $(LIB2_DIVMOD_FUNCS)) | |
327 | ||
328 | # Build "libgcc1" (assembly) components. | |
329 | ifeq ($(enable_shared),yes) | |
330 | ||
331 | lib1asmfuncs-o = $(patsubst %,%$(objext),$(LIB1ASMFUNCS)) | |
332 | $(lib1asmfuncs-o): %$(objext): $(gcc_srcdir)/config/$(LIB1ASMSRC) %.vis | |
333 | $(gcc_compile) -DL$* -xassembler-with-cpp \ | |
334 | -c $(gcc_srcdir)/config/$(LIB1ASMSRC) -include $*.vis | |
335 | $(patsubst %,%.vis,$(LIB1ASMFUNCS)): %.vis: %_s$(objext) | |
336 | $(gen-hide-list) | |
337 | libgcc-objects += $(lib1asmfuncs-o) | |
338 | ||
339 | lib1asmfuncs-s-o = $(patsubst %,%_s$(objext),$(LIB1ASMFUNCS)) | |
340 | $(lib1asmfuncs-s-o): %_s$(objext): $(gcc_srcdir)/config/$(LIB1ASMSRC) | |
341 | $(gcc_s_compile) -DL$* -xassembler-with-cpp \ | |
342 | -c $(gcc_srcdir)/config/$(LIB1ASMSRC) | |
343 | libgcc-s-objects += $(lib1asmfuncs-s-o) | |
344 | ||
345 | else | |
346 | ||
347 | lib1asmfuncs-o = $(patsubst %,%$(objext),$(LIB1ASMFUNCS)) | |
348 | $(lib1asmfuncs-o): %$(objext): $(gcc_srcdir)/config/$(LIB1ASMSRC) | |
349 | $(gcc_compile) -DL$* -xassembler-with-cpp \ | |
350 | -c $(gcc_srcdir)/config/$(LIB1ASMSRC) | |
351 | libgcc-objects += $(lib1asmfuncs-o) | |
352 | ||
353 | endif | |
354 | ||
355 | # Build lib2funcs. For the static library also include LIB2FUNCS_ST. | |
356 | lib2funcs-o = $(patsubst %,%$(objext),$(lib2funcs) $(LIB2FUNCS_ST)) | |
357 | $(lib2funcs-o): %$(objext): $(gcc_srcdir)/libgcc2.c | |
358 | $(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \ | |
359 | $(vis_hide) | |
360 | libgcc-objects += $(lib2funcs-o) | |
361 | ||
362 | ifeq ($(enable_shared),yes) | |
363 | lib2funcs-s-o = $(patsubst %,%_s$(objext),$(lib2funcs)) | |
364 | $(lib2funcs-s-o): %_s$(objext): $(gcc_srcdir)/libgcc2.c | |
365 | $(gcc_s_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c | |
366 | libgcc-s-objects += $(lib2funcs-s-o) | |
367 | endif | |
368 | ||
369 | ifneq ($(LIB2_SIDITI_CONV_FUNCS),) | |
370 | # Build libgcc2.c for each conversion function, with a specific | |
371 | # L<func> definition and LIBGCC2_UNITS_PER_WORD setting. The DImode | |
372 | # functions are built with a wordsize of 4; the TImode functions are | |
373 | # built with the same labels, but a wordsize of 8. | |
374 | ||
375 | sifuncs = $(subst XX,si,$(swfloatfuncs)) | |
376 | difuncs = $(subst XX,di,$(dwfloatfuncs)) | |
377 | tifuncs = $(subst XX,ti,$(dwfloatfuncs)) | |
378 | ||
379 | iter-items := $(sifuncs) $(difuncs) $(tifuncs) | |
380 | iter-labels := $(sifuncs) $(difuncs) $(difuncs) | |
381 | iter-sizes := $(patsubst %,4,$(sifuncs) $(difuncs)) $(patsubst %,8,$(tifuncs)) | |
382 | ||
383 | include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/siditi-object.mk,$(iter-items)) | |
384 | ||
385 | libgcc-objects += $(patsubst %,%$(objext),$(sifuncs) $(difuncs) $(tifuncs)) | |
386 | ifeq ($(enable_shared),yes) | |
387 | libgcc-s-objects += $(patsubst %,%_s$(objext),$(sifuncs) $(difuncs) $(tifuncs)) | |
388 | endif | |
389 | endif | |
390 | ||
391 | # Build LIB2_DIVMOD_FUNCS. | |
392 | lib2-divmod-o = $(patsubst %,%$(objext),$(LIB2_DIVMOD_FUNCS)) | |
393 | $(lib2-divmod-o): %$(objext): $(gcc_srcdir)/libgcc2.c | |
394 | $(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \ | |
395 | -fexceptions -fnon-call-exceptions $(vis_hide) | |
396 | libgcc-objects += $(lib2-divmod-o) | |
397 | ||
398 | ifeq ($(enable_shared),yes) | |
399 | lib2-divmod-s-o = $(patsubst %,%_s$(objext),$(LIB2_DIVMOD_FUNCS)) | |
400 | $(lib2-divmod-s-o): %_s$(objext): $(gcc_srcdir)/libgcc2.c | |
401 | $(gcc_s_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \ | |
402 | -fexceptions -fnon-call-exceptions | |
403 | libgcc-s-objects += $(lib2-divmod-s-o) | |
404 | endif | |
405 | ||
406 | # $(FPBIT) et al. are pathnames relative to the GCC build | |
407 | # directory; the supporting files are made by the GCC | |
408 | # Makefile. | |
409 | # FIXME: Soon we will be able to move this logic into this directory. | |
410 | ||
411 | ifneq ($(fpbit-in-libgcc),yes) | |
412 | FPBIT:=$(if $(FPBIT),$(gcc_objdir)/$(FPBIT),) | |
413 | DPBIT:=$(if $(DPBIT),$(gcc_objdir)/$(DPBIT),) | |
414 | TPBIT:=$(if $(TPBIT),$(gcc_objdir)/$(TPBIT),) | |
415 | endif | |
416 | ||
417 | ifeq ($(TPBIT),) | |
418 | # _sf_to_tf and _df_to_tf require tp-bit.c being compiled in. | |
419 | FPBIT_FUNCS := $(filter-out _sf_to_tf,$(FPBIT_FUNCS)) | |
420 | DPBIT_FUNCS := $(filter-out _df_to_tf,$(DPBIT_FUNCS)) | |
421 | endif | |
422 | ||
423 | # Build FPBIT. | |
424 | ifneq ($(FPBIT),) | |
425 | fpbit-o = $(patsubst %,%$(objext),$(FPBIT_FUNCS)) | |
426 | $(fpbit-o): %$(objext): $(FPBIT) | |
427 | $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(FPBIT) $(vis_hide) | |
428 | libgcc-objects += $(fpbit-o) | |
429 | ||
430 | ifeq ($(enable_shared),yes) | |
431 | fpbit-s-o = $(patsubst %,%_s$(objext),$(FPBIT_FUNCS)) | |
432 | $(fpbit-s-o): %_s$(objext): $(FPBIT) | |
433 | $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(FPBIT) | |
434 | libgcc-s-objects += $(fpbit-s-o) | |
435 | endif | |
436 | endif | |
437 | ||
438 | # Build DPBIT. | |
439 | ifneq ($(DPBIT),) | |
440 | dpbit-o = $(patsubst %,%$(objext),$(DPBIT_FUNCS)) | |
441 | $(dpbit-o): %$(objext): $(DPBIT) | |
442 | $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(DPBIT) $(vis_hide) | |
443 | libgcc-objects += $(dpbit-o) | |
444 | ||
445 | ifeq ($(enable_shared),yes) | |
446 | dpbit-s-o = $(patsubst %,%_s$(objext),$(DPBIT_FUNCS)) | |
447 | $(dpbit-s-o): %_s$(objext): $(DPBIT) | |
448 | $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(DPBIT) | |
449 | libgcc-s-objects += $(dpbit-s-o) | |
450 | endif | |
451 | endif | |
452 | ||
453 | # Build TPBIT. | |
454 | ifneq ($(TPBIT),) | |
455 | tpbit-o = $(patsubst %,%$(objext),$(TPBIT_FUNCS)) | |
456 | $(tpbit-o): %$(objext): $(TPBIT) | |
457 | $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(TPBIT) $(vis_hide) | |
458 | libgcc-objects += $(tpbit-o) | |
459 | ||
460 | ifeq ($(enable_shared),yes) | |
461 | tpbit-s-o = $(patsubst %,%_s$(objext),$(TPBIT_FUNCS)) | |
462 | $(tpbit-s-o): %_s$(objext): $(TPBIT) | |
463 | $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* -c $(TPBIT) | |
464 | libgcc-s-objects += $(tpbit-s-o) | |
465 | endif | |
466 | endif | |
467 | ||
468 | # Build decimal floating point support. | |
469 | ifeq ($(decimal_float),yes) | |
470 | ||
471 | # If $DFP_ENABLE is set, then we want all data type sizes. | |
472 | ifneq ($(DFP_ENABLE),) | |
473 | D32PBIT = 1 | |
474 | D64PBIT = 1 | |
475 | D128PBIT = 1 | |
476 | endif | |
477 | ||
200359e8 | 478 | dfp-filenames = |
fa958513 | 479 | ifneq ($(D32PBIT)$(D64PBIT)$(D128PBIT),) |
200359e8 | 480 | ifeq ($(enable_decimal_float),bid) |
b2a00c89 L |
481 | dfp-filenames += bid_decimal_globals bid_decimal_data \ |
482 | bid_binarydecimal bid_convert_data \ | |
483 | _isinfd32 _isinfd64 _isinfd128 bid64_noncomp \ | |
484 | bid128_noncomp bid128_fma bid_round bid_from_int \ | |
200359e8 L |
485 | bid64_add bid128_add bid64_div bid128_div \ |
486 | bid64_mul bid128_mul bid64_compare bid128_compare \ | |
487 | bid128 bid32_to_bid64 bid32_to_bid128 bid64_to_bid128 \ | |
488 | bid64_to_int32 bid64_to_int64 \ | |
489 | bid64_to_uint32 bid64_to_uint64 \ | |
490 | bid128_to_int32 bid128_to_int64 \ | |
491 | bid128_to_uint32 bid128_to_uint64 | |
492 | else | |
2533577f | 493 | dfp-filenames += decContext decNumber decExcept decRound decLibrary decDouble decPacked decQuad decSingle |
200359e8 | 494 | endif |
fa958513 DJ |
495 | endif |
496 | ||
200359e8 L |
497 | dfp-objects = $(patsubst %,%$(objext),$(dfp-filenames)) |
498 | ifeq ($(enable_decimal_float),bid) | |
499 | $(dfp-objects): %$(objext): $(srcdir)/config/libbid/%.c | |
500 | else | |
501 | $(dfp-objects): %$(objext): $(srcdir)/../libdecnumber/%.c | |
502 | endif | |
79b87c74 | 503 | $(gcc_compile) -c $< |
200359e8 | 504 | libgcc-objects += $(dfp-objects) |
79b87c74 MM |
505 | |
506 | decbits-filenames = | |
200359e8 | 507 | ifneq ($(enable_decimal_float),bid) |
fa958513 | 508 | ifneq ($(D32PBIT),) |
79b87c74 | 509 | decbits-filenames += decimal32 |
fa958513 DJ |
510 | endif |
511 | ||
512 | ifneq ($(D64PBIT),) | |
79b87c74 | 513 | decbits-filenames += decimal64 |
fa958513 DJ |
514 | endif |
515 | ||
516 | ifneq ($(D128PBIT),) | |
79b87c74 | 517 | decbits-filenames += decimal128 |
fa958513 | 518 | endif |
79b87c74 MM |
519 | endif |
520 | ||
521 | decbits-objects = $(patsubst %,%$(objext),$(decbits-filenames)) | |
200359e8 L |
522 | ifeq ($(enable_decimal_float),bid) |
523 | $(decbits-objects): %$(objext): $(srcdir)/config/libbid/%.c | |
524 | else | |
79b87c74 | 525 | $(decbits-objects): %$(objext): $(srcdir)/../libdecnumber/$(enable_decimal_float)/%.c |
200359e8 | 526 | endif |
fa958513 | 527 | $(gcc_compile) -c $< |
79b87c74 | 528 | libgcc-objects += $(decbits-objects) |
fa958513 DJ |
529 | |
530 | # Next build individual support functions. | |
200359e8 L |
531 | ifeq ($(enable_decimal_float),bid) |
532 | ifneq ($(D32PBIT),) | |
533 | D32PBIT_FUNCS:=$(filter-out _plus_sd _minus_sd _conv_sd, $(D32PBIT_FUNCS)) | |
534 | endif | |
535 | ||
536 | ifneq ($(D64PBIT),) | |
537 | D64PBIT_FUNCS:=$(filter-out _plus_dd _minus_dd _conv_dd, $(D64PBIT_FUNCS)) | |
538 | endif | |
539 | ||
540 | ifneq ($(D128PBIT),) | |
541 | D128PBIT_FUNCS:=$(filter-out _plus_td _minus_td _conv_td, $(D128PBIT_FUNCS)) | |
542 | endif | |
543 | endif | |
544 | ||
fa958513 DJ |
545 | ifneq ($(D32PBIT),) |
546 | d32pbit-o = $(patsubst %,%$(objext),$(D32PBIT_FUNCS)) | |
200359e8 L |
547 | ifeq ($(enable_decimal_float),bid) |
548 | $(d32pbit-o): %$(objext): $(srcdir)/config/libbid/%.c | |
549 | else | |
fa958513 | 550 | $(d32pbit-o): %$(objext): $(gcc_srcdir)/config/dfp-bit.c |
200359e8 | 551 | endif |
fa958513 DJ |
552 | $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=32 -c $< |
553 | libgcc-objects += $(d32pbit-o) | |
554 | endif | |
555 | ||
556 | ifneq ($(D64PBIT),) | |
557 | d64pbit-o = $(patsubst %,%$(objext),$(D64PBIT_FUNCS)) | |
200359e8 L |
558 | ifeq ($(enable_decimal_float),bid) |
559 | $(d64pbit-o): %$(objext): $(srcdir)/config/libbid/%.c | |
560 | else | |
fa958513 | 561 | $(d64pbit-o): %$(objext): $(gcc_srcdir)/config/dfp-bit.c |
200359e8 | 562 | endif |
fa958513 DJ |
563 | $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=64 -c $< |
564 | libgcc-objects += $(d64pbit-o) | |
565 | endif | |
566 | ||
567 | ifneq ($(D128PBIT),) | |
568 | d128pbit-o = $(patsubst %,%$(objext),$(D128PBIT_FUNCS)) | |
200359e8 L |
569 | ifeq ($(enable_decimal_float),bid) |
570 | $(d128pbit-o): %$(objext): $(srcdir)/config/libbid/%.c | |
571 | else | |
fa958513 | 572 | $(d128pbit-o): %$(objext): $(gcc_srcdir)/config/dfp-bit.c |
200359e8 | 573 | endif |
fa958513 DJ |
574 | $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=128 -c $< |
575 | libgcc-objects += $(d128pbit-o) | |
576 | endif | |
577 | ||
578 | endif | |
579 | ||
8d2a9e0e CF |
580 | # Build fixed-point support. |
581 | ifeq ($(fixed_point),yes) | |
582 | ||
583 | # Generate permutations of function name and mode | |
584 | fixed-labels := $(shell $(SHELL) $(srcdir)/gen-fixed.sh arith labels) | |
585 | fixed-funcs := $(shell $(SHELL) $(srcdir)/gen-fixed.sh arith funcs) | |
586 | fixed-modes := $(shell $(SHELL) $(srcdir)/gen-fixed.sh arith modes) | |
587 | ||
588 | # Generate the rules for each arithmetic function | |
589 | iter-items := $(fixed-funcs) | |
590 | iter-labels := $(fixed-labels) | |
591 | iter-from := $(fixed-modes) | |
592 | iter-to := $(fixed-modes) | |
593 | include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/fixed-obj.mk,$(iter-items)) | |
594 | ||
595 | # Add arithmetic functions to list of objects to be built | |
596 | libgcc-objects += $(patsubst %,%$(objext),$(fixed-funcs)) | |
597 | ifeq ($(enable_shared),yes) | |
598 | libgcc-s-objects += $(patsubst %,%_s$(objext),$(fixed-funcs)) | |
599 | endif | |
600 | ||
601 | # Convert from or to fractional | |
602 | fixed-conv-funcs := $(shell $(SHELL) $(srcdir)/gen-fixed.sh conv funcs) | |
603 | fixed-conv-labels := $(shell $(SHELL) $(srcdir)/gen-fixed.sh conv labels) | |
604 | fixed-conv-from := $(shell $(SHELL) $(srcdir)/gen-fixed.sh conv from) | |
605 | fixed-conv-to := $(shell $(SHELL) $(srcdir)/gen-fixed.sh conv to) | |
606 | ||
607 | # Generate the make rules for each conversion function | |
608 | iter-items := $(fixed-conv-funcs) | |
609 | iter-labels := $(fixed-conv-labels) | |
610 | iter-from := $(fixed-conv-from) | |
611 | iter-to := $(fixed-conv-to) | |
612 | include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/fixed-obj.mk,$(iter-items)) | |
613 | ||
614 | # Add conversion functions to list of objects to be built | |
615 | libgcc-objects += $(patsubst %,%$(objext),$(fixed-conv-funcs)) | |
616 | ifeq ($(enable_shared),yes) | |
617 | libgcc-s-objects += $(patsubst %,%_s$(objext),$(fixed-conv-funcs)) | |
618 | endif | |
619 | ||
620 | endif | |
621 | ||
fa958513 DJ |
622 | # Build LIB2ADD and LIB2ADD_ST. |
623 | ifneq ($(filter-out %.c %.S %.asm,$(LIB2ADD) $(LIB2ADD_ST)),) | |
624 | $(error Unsupported files in LIB2ADD or LIB2ADD_ST.) | |
625 | endif | |
626 | ||
627 | libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADD)))) | |
628 | libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADD_ST)))) | |
629 | ||
630 | c_flags := | |
631 | iter-items := $(LIB2ADD) $(LIB2ADD_ST) | |
632 | include $(iterator) | |
633 | ||
634 | ifeq ($(enable_shared),yes) | |
635 | libgcc-s-objects += $(addsuffix _s$(objext),$(basename $(notdir $(LIB2ADD)))) | |
636 | endif | |
637 | ||
638 | # Build LIB2ADDEH, LIB2ADDEHSTATIC, and LIB2ADDEHSHARED. If we don't have | |
639 | # libgcc_eh.a, only LIB2ADDEH matters. If we do, only LIB2ADDEHSTATIC and | |
640 | # LIB2ADDEHSHARED matter. (Usually all three are identical.) | |
641 | ||
642 | c_flags := -fexceptions | |
643 | ||
644 | ifeq ($(enable_shared),yes) | |
645 | ||
646 | libgcc-eh-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADDEHSTATIC)))) | |
647 | libgcc-s-objects += $(addsuffix _s$(objext),$(basename $(notdir $(LIB2ADDEHSHARED)))) | |
648 | ||
649 | iter-items := $(sort $(LIB2ADDEHSTATIC) $(LIB2ADDEHSHARED)) | |
650 | include $(iterator) | |
651 | ||
652 | else | |
653 | # Not shared. LIB2ADDEH are added to libgcc.a. | |
654 | ||
655 | libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADDEH)))) | |
656 | ||
657 | iter-items := $(LIB2ADDEH) | |
658 | include $(iterator) | |
659 | ||
660 | endif | |
661 | ||
662 | # Build LIBUNWIND. | |
663 | ||
664 | c_flags := -fexceptions | |
665 | ||
666 | libunwind-objects += $(addsuffix $(objext),$(basename $(notdir $(LIBUNWIND)))) | |
667 | ||
668 | ifeq ($(enable_shared),yes) | |
669 | libunwind-s-objects += $(addsuffix _s$(objext),$(basename $(notdir $(LIBUNWIND)))) | |
670 | endif | |
671 | ||
672 | iter-items := $(LIBUNWIND) | |
673 | include $(iterator) | |
674 | ||
675 | # Build libgcov components. | |
676 | libgcov-objects = $(patsubst %,%$(objext),$(LIBGCOV)) | |
677 | $(libgcov-objects): %$(objext): $(gcc_srcdir)/libgcov.c | |
678 | $(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcov.c | |
679 | ||
680 | ||
681 | # Static libraries. | |
682 | libgcc.a: $(libgcc-objects) | |
683 | libgcov.a: $(libgcov-objects) | |
684 | libunwind.a: $(libunwind-objects) | |
685 | libgcc_eh.a: $(libgcc-eh-objects) | |
686 | ||
687 | libgcc.a libgcov.a libunwind.a libgcc_eh.a: | |
688 | -rm -f $@ | |
689 | ||
690 | objects="$(objects)"; \ | |
691 | if test -z "$$objects"; then \ | |
692 | echo 'int __libgcc_eh_dummy;' > eh_dummy.c; \ | |
693 | $(gcc_compile_bare) $(vis_hide) -c eh_dummy.c \ | |
694 | -o eh_dummy$(objext); \ | |
695 | objects=eh_dummy$(objext); \ | |
696 | fi; \ | |
697 | $(AR_CREATE_FOR_TARGET) $@ $$objects | |
698 | ||
699 | $(RANLIB) $@ | |
700 | ||
701 | all: libgcc.a libgcov.a | |
702 | ||
703 | ifneq ($(LIBUNWIND),) | |
704 | all: libunwind.a | |
cd5c2357 | 705 | libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) |
fa958513 DJ |
706 | endif |
707 | ||
708 | ifeq ($(enable_shared),yes) | |
709 | all: libgcc_eh.a libgcc_s$(SHLIB_EXT) | |
710 | ifneq ($(LIBUNWIND),) | |
711 | all: libunwind$(SHLIB_EXT) | |
712 | endif | |
713 | endif | |
714 | ||
715 | ifeq ($(enable_shared),yes) | |
716 | ||
717 | # Map-file generation. | |
718 | ifneq ($(SHLIB_MKMAP),) | |
719 | libgcc.map: $(SHLIB_MKMAP) $(SHLIB_MAPFILES) $(libgcc-s-objects) | |
720 | { $(NM) $(SHLIB_NM_FLAGS) $(libgcc-s-objects); echo %%; \ | |
721 | cat $(SHLIB_MAPFILES) \ | |
722 | | sed -e '/^[ ]*#/d' \ | |
723 | -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \ | |
724 | | $(gcc_compile_bare) -E -xassembler-with-cpp -; \ | |
725 | } | $(AWK) -f $(SHLIB_MKMAP) $(SHLIB_MKMAP_OPTS) > tmp-$@ | |
726 | mv tmp-$@ $@ | |
727 | libgcc_s$(SHLIB_EXT): libgcc.map | |
728 | mapfile = libgcc.map | |
729 | endif | |
730 | ||
731 | libgcc_s$(SHLIB_EXT): $(libgcc-s-objects) $(extra-parts) | |
732 | # @multilib_flags@ is still needed because this may use | |
733 | # $(GCC_FOR_TARGET) and $(LIBGCC2_CFLAGS) directly. | |
734 | # @multilib_dir@ is not really necessary, but sometimes it has | |
735 | # more uses than just a directory name. | |
736 | $(mkinstalldirs) $(MULTIDIR) | |
cd5c2357 | 737 | $(subst @multilib_flags@,$(CFLAGS) -B./,$(subst \ |
fa958513 DJ |
738 | @multilib_dir@,$(MULTIDIR),$(subst \ |
739 | @shlib_objs@,$(objects),$(subst \ | |
740 | @shlib_base_name@,libgcc_s,$(subst \ | |
741 | @shlib_map_file@,$(mapfile),$(subst \ | |
89deeaff EK |
742 | @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \ |
743 | @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK)))))))) | |
fa958513 DJ |
744 | |
745 | libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts) | |
746 | # @multilib_flags@ is still needed because this may use | |
747 | # $(GCC_FOR_TARGET) and $(LIBGCC2_CFLAGS) directly. | |
748 | # @multilib_dir@ is not really necessary, but sometimes it has | |
749 | # more uses than just a directory name. | |
750 | $(mkinstalldirs) $(MULTIDIR) | |
cd5c2357 | 751 | $(subst @multilib_flags@,$(CFLAGS) -B./,$(subst \ |
fa958513 DJ |
752 | @multilib_dir@,$(MULTIDIR),$(subst \ |
753 | @shlib_objs@,$(objects),$(subst \ | |
754 | @shlib_base_name@,libunwind,$(subst \ | |
755 | @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIBUNWIND_LINK)))))) | |
756 | ||
757 | endif | |
758 | ||
759 | # Build the standard GCC startfiles and endfiles. | |
760 | ALL_CRT_CFLAGS = $(CFLAGS) $(CRTSTUFF_CFLAGS) $(INCLUDES) | |
761 | crt_compile = $(CC) $(ALL_CRT_CFLAGS) -o $@ $(compile_deps) | |
762 | ||
763 | ifeq ($(CUSTOM_CRTSTUFF),) | |
764 | crtbegin$(objext): $(gcc_srcdir)/crtstuff.c | |
765 | $(crt_compile) $(CRTSTUFF_T_CFLAGS) \ | |
766 | -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN | |
767 | ||
768 | crtend$(objext): $(gcc_srcdir)/crtstuff.c | |
769 | $(crt_compile) $(CRTSTUFF_T_CFLAGS) \ | |
770 | -c $(gcc_srcdir)/crtstuff.c -DCRT_END | |
771 | ||
772 | # These are versions of crtbegin and crtend for shared libraries. | |
773 | crtbeginS$(objext): $(gcc_srcdir)/crtstuff.c | |
774 | $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \ | |
775 | -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O | |
776 | ||
777 | crtendS$(objext): $(gcc_srcdir)/crtstuff.c | |
778 | $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \ | |
779 | -c $(gcc_srcdir)/crtstuff.c -DCRT_END -DCRTSTUFFS_O | |
780 | ||
781 | # This is a version of crtbegin for -static links. | |
782 | crtbeginT.o: $(gcc_srcdir)/crtstuff.c | |
783 | $(crt_compile) $(CRTSTUFF_T_CFLAGS) \ | |
784 | -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O | |
785 | endif | |
786 | ||
787 | # Build extra startfiles in the libgcc directory. | |
788 | .PHONY: libgcc-extra-parts | |
789 | libgcc-extra-parts: $(EXTRA_PARTS) | |
790 | ifneq ($(GCC_EXTRA_PARTS),) | |
791 | ifneq ($(sort $(EXTRA_PARTS)),$(GCC_EXTRA_PARTS)) | |
792 | # If the gcc directory specifies which extra parts to | |
793 | # build for this target, and the libgcc configuration also | |
794 | # specifies, make sure they match. This can be removed | |
795 | # when the gcc directory no longer holds libgcc configuration; | |
796 | # it is useful when migrating a target. | |
797 | @echo "Configuration mismatch!" | |
798 | @echo "Extra parts from gcc directory: $(GCC_EXTRA_PARTS)" | |
799 | @echo "Extra parts from libgcc: $(EXTRA_PARTS)" | |
800 | exit 1 | |
801 | endif | |
802 | endif | |
803 | ||
804 | # Early copyback; see "all" above for the rationale. The | |
805 | # early copy is necessary so that the gcc -B options find | |
806 | # the right startup files when linking shared libgcc. | |
807 | $(mkinstalldirs) $(gcc_objdir)$(MULTISUBDIR) | |
808 | parts="$(EXTRA_PARTS)"; \ | |
809 | for file in $$parts; do \ | |
810 | rm -f $(gcc_objdir)$(MULTISUBDIR)/$$file; \ | |
811 | $(INSTALL_DATA) $$file $(gcc_objdir)$(MULTISUBDIR)/; \ | |
812 | done | |
813 | ||
814 | # Build extra startfiles in the gcc directory, for unconverted | |
815 | # targets. | |
816 | .PHONY: gcc-extra-parts | |
817 | gcc-extra-parts: | |
818 | # Recursively invoke make in the GCC directory to build any | |
819 | # startfiles (for now). We must do this just once, passing | |
820 | # it all the GCC_EXTRA_PARTS as simultaneous goal targets, | |
821 | # so that rules which cannot execute simultaneously are properly | |
822 | # serialized. We indirect through T_TARGET in case any multilib | |
823 | # directories contain an equals sign, to prevent make from | |
824 | # interpreting any of the goals as variable assignments. | |
825 | ||
826 | # We must use cd && make rather than make -C, or else the stage | |
827 | # number will be embedded in debug information. | |
828 | ||
829 | T=`$(PWD_COMMAND)`/ \ | |
830 | && cd $(gcc_objdir) \ | |
831 | && $(MAKE) GCC_FOR_TARGET="$(CC)" \ | |
832 | MULTILIB_CFLAGS="$(CFLAGS)" \ | |
833 | T=$$T \ | |
834 | T_TARGET="$(patsubst %,$${T}%,$(GCC_EXTRA_PARTS))" \ | |
835 | T_TARGET | |
836 | ||
837 | # Early copyback; see "all" above for the rationale. The | |
838 | # early copy is necessary so that the gcc -B options find | |
839 | # the right startup files when linking shared libgcc. | |
840 | $(mkinstalldirs) $(gcc_objdir)$(MULTISUBDIR) | |
841 | parts="$(GCC_EXTRA_PARTS)"; \ | |
842 | for file in $$parts; do \ | |
843 | rm -f $(gcc_objdir)$(MULTISUBDIR)/$$file; \ | |
844 | $(INSTALL_DATA) $$file $(gcc_objdir)$(MULTISUBDIR)/; \ | |
845 | done | |
846 | ||
847 | all: $(extra-parts) | |
848 | ||
e0a9456a | 849 | # Documentation targets (empty). |
e8bb4597 | 850 | .PHONY: info html dvi pdf install-info install-html install-pdf |
b0088af7 | 851 | |
e0a9456a | 852 | info: |
e8bb4597 | 853 | install-info: |
e0a9456a | 854 | html: |
ac84c172 | 855 | install-html: |
e0a9456a | 856 | dvi: |
e0a9456a | 857 | pdf: |
ac84c172 | 858 | install-pdf: |
e0a9456a | 859 | |
fa958513 DJ |
860 | # Install rules. These do not depend on "all", so that they can be invoked |
861 | # recursively from it. | |
862 | install-libunwind: | |
863 | $(mkinstalldirs) $(DESTDIR)$(inst_slibdir) | |
864 | ||
865 | # NOTE: Maybe this should go into $(inst_libdir), but this | |
866 | # is where the old mklibgcc.in put it. | |
867 | $(INSTALL_DATA) libunwind.a $(DESTDIR)$(inst_slibdir)/ | |
868 | chmod 644 $(DESTDIR)$(inst_slibdir)/libunwind.a | |
869 | $(RANLIB) $(DESTDIR)$(inst_slibdir)/libunwind.a | |
870 | ||
871 | $(subst @multilib_dir@,$(MULTIDIR),$(subst \ | |
872 | @shlib_base_name@,libunwind,$(subst \ | |
873 | @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIBUNWIND_INSTALL)))) | |
874 | ||
875 | install-shared: | |
876 | $(mkinstalldirs) $(DESTDIR)$(inst_libdir) | |
877 | ||
878 | $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/ | |
879 | chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a | |
880 | $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a | |
881 | ||
882 | $(subst @multilib_dir@,$(MULTIDIR),$(subst \ | |
883 | @shlib_base_name@,libgcc_s,$(subst \ | |
884 | @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) | |
885 | ||
edbf8b16 | 886 | install-leaf: $(install-shared) $(install-libunwind) |
fa958513 DJ |
887 | $(mkinstalldirs) $(DESTDIR)$(inst_libdir) |
888 | ||
889 | $(INSTALL_DATA) libgcc.a $(DESTDIR)$(inst_libdir)/ | |
890 | chmod 644 $(DESTDIR)$(inst_libdir)/libgcc.a | |
891 | $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc.a | |
892 | $(INSTALL_DATA) libgcov.a $(DESTDIR)$(inst_libdir)/ | |
893 | chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a | |
894 | $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a | |
895 | ||
896 | parts="$(INSTALL_PARTS)"; \ | |
897 | for file in $$parts; do \ | |
898 | rm -f $(DESTDIR)$(inst_libdir)/$$file; \ | |
899 | $(INSTALL_DATA) $$file $(DESTDIR)$(inst_libdir)/; \ | |
900 | done | |
901 | ||
edbf8b16 | 902 | install: install-leaf |
97af925b DJ |
903 | @$(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install |
904 | ||
fa958513 DJ |
905 | .PHONY: install install-shared install-libunwind |
906 | ||
907 | # Don't export variables to the environment, in order to not confuse | |
908 | # configure. | |
909 | .NOEXPORT: | |
910 | ||
911 | include $(srcdir)/empty.mk $(wildcard *.dep) | |
912 | ||
913 | # TODO QUEUE: | |
914 | # Garbage collect in gcc/: | |
915 | # $(LIBGCC) settings in t-* are now unused | |
916 | # | |
917 | # Remove use of $(gcc_srcdir). Source files referenced using $(gcc_srcdir) | |
918 | # should move into the libgcc directory. | |
919 |