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