Makefile.in 37 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148
  1. # Makefile.in
  2. # Copyright (C) 2005-2015 Free Software Foundation, Inc.
  3. #
  4. # This file is part of GCC.
  5. #
  6. # GCC is free software; you can redistribute it and/or modify it under the
  7. # terms of the GNU Library General Public License as published by the Free
  8. # Software Foundation; either version 3 of the License, or (at your option)
  9. # any later version.
  10. #
  11. # GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  12. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  13. # FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  14. # more details.
  15. #
  16. # You should have received a copy of the GNU General Public License along
  17. # with GCC; see the file COPYING3. If not see
  18. # <http://www.gnu.org/licenses/>.
  19. #
  20. libgcc_topdir = @libgcc_topdir@
  21. host_subdir = @host_subdir@
  22. gcc_objdir = $(MULTIBUILDTOP)../../$(host_subdir)/gcc
  23. srcdir = @srcdir@
  24. prefix = @prefix@
  25. exec_prefix = @exec_prefix@
  26. libdir = @libdir@
  27. shlib_slibdir = @slibdir@
  28. SHELL = @SHELL@
  29. cpu_type = @cpu_type@
  30. enable_shared = @enable_shared@
  31. double_type_size = @double_type_size@
  32. long_double_type_size = @long_double_type_size@
  33. decimal_float = @decimal_float@
  34. enable_vtable_verify = @enable_vtable_verify@
  35. enable_decimal_float = @enable_decimal_float@
  36. fixed_point = @fixed_point@
  37. with_aix_soname = @with_aix_soname@
  38. host_noncanonical = @host_noncanonical@
  39. target_noncanonical = @target_noncanonical@
  40. # List of extra object files that should be compiled for this target machine.
  41. # The rules for compiling them should be in the t-* file for the machine.
  42. EXTRA_PARTS = @extra_parts@
  43. FORCE_EXPLICIT_EH_REGISTRY = @force_explicit_eh_registry@
  44. extra-parts = libgcc-extra-parts
  45. # Multilib support variables.
  46. MULTISRCTOP =
  47. MULTIBUILDTOP =
  48. MULTIDIRS =
  49. MULTISUBDIR =
  50. MULTIDO = true
  51. MULTICLEAN = true
  52. INSTALL = @INSTALL@
  53. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  54. INSTALL_DATA = @INSTALL_DATA@
  55. mkinstalldirs = $(SHELL) $(libgcc_topdir)/mkinstalldirs
  56. INSTALL_PARTS = $(EXTRA_PARTS)
  57. objext = .o
  58. AR = @AR@
  59. AR_FLAGS = rc
  60. CC = @CC@
  61. CFLAGS = @CFLAGS@
  62. RANLIB = @RANLIB@
  63. LN_S = @LN_S@
  64. PWD_COMMAND = $${PWDCMD-pwd}
  65. # Flags to pass to a recursive make.
  66. FLAGS_TO_PASS = \
  67. "AR=$(AR)" \
  68. "AR_FLAGS=$(AR_FLAGS)" \
  69. "CC=$(CC)" \
  70. "CFLAGS=$(CFLAGS)" \
  71. "DESTDIR=$(DESTDIR)" \
  72. "EXTRA_OFILES=$(EXTRA_OFILES)" \
  73. "HDEFINES=$(HDEFINES)" \
  74. "INSTALL=$(INSTALL)" \
  75. "INSTALL_DATA=$(INSTALL_DATA)" \
  76. "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
  77. "LDFLAGS=$(LDFLAGS)" \
  78. "LOADLIBES=$(LOADLIBES)" \
  79. "RANLIB=$(RANLIB)" \
  80. "SHELL=$(SHELL)" \
  81. "prefix=$(prefix)" \
  82. "exec_prefix=$(exec_prefix)" \
  83. "libdir=$(libdir)" \
  84. "libsubdir=$(libsubdir)" \
  85. "tooldir=$(tooldir)"
  86. # Dependencies for "all" are set later in the file.
  87. all: all-multi
  88. # Now that we have built all the objects, we need to copy
  89. # them back to the GCC directory. Too many things (other
  90. # in-tree libraries, and DejaGNU) know about the layout
  91. # of the build tree, for now.
  92. $(MAKE) install-leaf DESTDIR=$(gcc_objdir) \
  93. slibdir= libsubdir= MULTIOSDIR=$(MULTIDIR)
  94. .PHONY: all-multi
  95. all-multi:
  96. # If this is the top-level multilib, build all the other
  97. # multilibs.
  98. @: $(MAKE) ; exec $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=all
  99. .PHONY: check installcheck
  100. check:
  101. installcheck:
  102. .PHONY: all clean
  103. clean:
  104. -rm -f libgcc_tm.h libgcc.map
  105. -rm -f libgcc_tm.stamp stmp-ldirs
  106. -rm -f *$(objext)
  107. -rm -f *.dep
  108. -rm -f *.a
  109. -rm -f libunwind$(SHLIB_EXT)
  110. -rm -f libgcc_s*
  111. @$(MULTICLEAN) multi-clean DO=clean
  112. distclean: clean
  113. @$(MULTICLEAN) multi-clean DO=distclean
  114. -rm -f auto-target.h
  115. -rm -f stamp-h
  116. -rm -f *~ Makefile config.cache config.status multilib.out
  117. -rm -f config.log
  118. maintainer-clean realclean: distclean
  119. Makefile: $(srcdir)/Makefile.in config.status
  120. CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
  121. # Depending on Makefile makes sure that config.status has been re-run
  122. # if needed. This prevents problems with parallel builds.
  123. auto-target.h: stamp-h ; @true
  124. stamp-h: $(srcdir)/config.in config.status Makefile
  125. CONFIG_FILES= CONFIG_HEADERS=auto-target.h:$(srcdir)/config.in $(SHELL) ./config.status
  126. config.status: $(srcdir)/configure $(srcdir)/config.host
  127. $(SHELL) ./config.status --recheck
  128. AUTOCONF = autoconf
  129. configure_deps = \
  130. $(srcdir)/../config/enable.m4 \
  131. $(srcdir)/../config/tls.m4 \
  132. $(srcdir)/../config/acx.m4 \
  133. $(srcdir)/../config/no-executables.m4 \
  134. $(srcdir)/../config/override.m4 \
  135. $(srcdir)/../config/dfp.m4 \
  136. $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(configure_deps)
  137. cd $(srcdir) && $(AUTOCONF)
  138. include $(gcc_objdir)/libgcc.mvars
  139. # Flags to pass to recursive makes.
  140. AR_FOR_TARGET = $(AR)
  141. AR_FLAGS_FOR_TARGET =
  142. AR_CREATE_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) rc
  143. AR_EXTRACT_FOR_TARGET = $(AR_FOR_TARGET) $(AR_FLAGS_FOR_TARGET) x
  144. AWK = @AWK@
  145. GCC_FOR_TARGET = $(CC)
  146. LIPO = @LIPO@
  147. LIPO_FOR_TARGET = $(LIPO)
  148. MACHMODE_H = machmode.h mode-classes.def insn-modes.h
  149. NM = @NM@
  150. NM_FOR_TARGET = $(NM)
  151. RANLIB_FOR_TARGET = $(RANLIB)
  152. STRIP = @STRIP@
  153. STRIP_FOR_TARGET = $(STRIP)
  154. # Directory in which the compiler finds libraries etc.
  155. libsubdir = $(libdir)/gcc/$(host_noncanonical)/$(version)@accel_dir_suffix@
  156. # Used to install the shared libgcc.
  157. slibdir = @slibdir@
  158. # Maybe used for DLLs on Windows targets.
  159. toolexecdir = @toolexecdir@
  160. toolexeclibdir = @toolexeclibdir@
  161. export AR_FOR_TARGET
  162. export AR_CREATE_FOR_TARGET
  163. export AR_FLAGS_FOR_TARGET
  164. export AR_EXTRACT_FOR_TARGET
  165. export AWK
  166. export DESTDIR
  167. export GCC_FOR_TARGET
  168. export INCLUDES
  169. export INSTALL_DATA
  170. export LIB1ASMSRC
  171. export LIBGCC2_CFLAGS
  172. export LIPO_FOR_TARGET
  173. export MACHMODE_H
  174. export NM_FOR_TARGET
  175. export STRIP_FOR_TARGET
  176. export RANLIB_FOR_TARGET
  177. export libsubdir
  178. export slibdir
  179. export toolexecdir
  180. export toolexeclibdir
  181. version := $(shell cat $(srcdir)/../gcc/BASE-VER)
  182. ifeq ($(decimal_float),yes)
  183. ifeq ($(enable_decimal_float),bid)
  184. DECNUMINC = -I$(srcdir)/config/libbid -DENABLE_DECIMAL_BID_FORMAT
  185. else
  186. DECNUMINC = -I$(srcdir)/../libdecnumber/$(enable_decimal_float) \
  187. -I$(srcdir)/../libdecnumber
  188. endif
  189. else
  190. DECNUMINC =
  191. endif
  192. # Options to use when compiling libgcc2.a.
  193. #
  194. LIBGCC2_DEBUG_CFLAGS = -g
  195. LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
  196. $(LIBGCC2_DEBUG_CFLAGS) -DIN_LIBGCC2 \
  197. -fbuilding-libgcc -fno-stack-protector \
  198. $(INHIBIT_LIBC_CFLAGS)
  199. # Additional options to use when compiling libgcc2.a.
  200. # Some targets override this to -isystem include
  201. LIBGCC2_INCLUDES =
  202. # Additional target-dependent options for compiling libgcc2.a.
  203. HOST_LIBGCC2_CFLAGS =
  204. PICFLAG = @PICFLAG@
  205. # Defined in libgcc2.c, included only in the static library.
  206. LIB2FUNCS_ST = _eprintf __gcc_bcmp
  207. # List of functions not to build from libgcc2.c.
  208. LIB2FUNCS_EXCLUDE =
  209. # These might cause a divide overflow trap and so are compiled with
  210. # unwinder info.
  211. LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
  212. # List of extra C and assembler files to add to static and shared libgcc2.
  213. # Assembler files should have names ending in `.S'.
  214. LIB2ADD =
  215. # List of extra C and assembler files to add to static libgcc2.
  216. # Assembler files should have names ending in `.S'.
  217. LIB2ADD_ST =
  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. # Forcibly remove any profiling-related flags. There is no point
  228. # in supporting profiled bootstrap in this library.
  229. override CFLAGS := $(filter-out -fprofile-generate -fprofile-use,$(CFLAGS))
  230. # CFLAGS first is not perfect; normally setting CFLAGS should override any
  231. # options in LIBGCC2_CFLAGS. But LIBGCC2_CFLAGS may contain -g0, and CFLAGS
  232. # will usually contain -g, so for the moment CFLAGS goes first. We must
  233. # include CFLAGS - that's where multilib options live.
  234. INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
  235. $(INCLUDES) @set_have_cc_tls@ @set_use_emutls@
  236. # Options to use when compiling crtbegin/end.
  237. CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
  238. -finhibit-size-directive -fno-inline -fno-exceptions \
  239. -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
  240. -fbuilding-libgcc -fno-stack-protector $(FORCE_EXPLICIT_EH_REGISTRY) \
  241. $(INHIBIT_LIBC_CFLAGS)
  242. # Extra flags to use when compiling crt{begin,end}.o.
  243. CRTSTUFF_T_CFLAGS =
  244. MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
  245. MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
  246. MULTIOSSUBDIR := $(shell if test $(MULTIOSDIR) != .; then echo /$(MULTIOSDIR); fi)
  247. inst_libdir = $(libsubdir)$(MULTISUBDIR)
  248. inst_slibdir = $(slibdir)$(MULTIOSSUBDIR)
  249. gcc_compile_bare = $(CC) $(INTERNAL_CFLAGS)
  250. compile_deps = -MT $@ -MD -MP -MF $(basename $@).dep
  251. gcc_compile = $(gcc_compile_bare) -o $@ $(compile_deps)
  252. gcc_s_compile = $(gcc_compile) -DSHARED
  253. objects = $(filter %$(objext),$^)
  254. # Collect any host-specific information from Makefile fragments.
  255. LIBGCC_VER_GNU_PREFIX = __
  256. LIBGCC_VER_FIXEDPOINT_GNU_PREFIX = __
  257. LIBGCC_VER_SYMBOLS_PREFIX =
  258. FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
  259. _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
  260. _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \
  261. _sf_to_df _sf_to_tf _thenan_sf _sf_to_usi _usi_to_sf
  262. DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
  263. _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \
  264. _lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \
  265. _df_to_sf _df_to_tf _thenan_df _df_to_usi _usi_to_df
  266. TPBIT_FUNCS = _pack_tf _unpack_tf _addsub_tf _mul_tf _div_tf \
  267. _fpcmp_parts_tf _compare_tf _eq_tf _ne_tf _gt_tf _ge_tf \
  268. _lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf \
  269. _tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf
  270. # Additional sources to handle exceptions; overridden by targets as needed.
  271. LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
  272. $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
  273. LIB2ADDEHSTATIC = $(LIB2ADDEH)
  274. LIB2ADDEHSHARED = $(LIB2ADDEH)
  275. # nm flags to list global symbols in libgcc object files.
  276. SHLIB_NM_FLAGS = -pg
  277. # Don't build libunwind by default.
  278. LIBUNWIND =
  279. SHLIBUNWIND_LINK =
  280. SHLIBUNWIND_INSTALL =
  281. tmake_file = @tmake_file@
  282. include $(srcdir)/empty.mk $(tmake_file)
  283. # Collect target defines and headers from config.host.
  284. libgcc_tm_defines = @tm_defines@
  285. libgcc_tm_file = @tm_file@
  286. libgcc_tm.h: libgcc_tm.stamp; @true
  287. libgcc_tm.stamp:
  288. DEFINES='$(libgcc_tm_defines)' HEADERS='$(libgcc_tm_file)' \
  289. $(srcdir)/mkheader.sh > tmp-libgcc_tm.h
  290. $(SHELL) $(srcdir)/../move-if-change tmp-libgcc_tm.h libgcc_tm.h
  291. echo timestamp > $@
  292. # Only handle shared libraries if both:
  293. # - the user requested them
  294. # - we know how to build them
  295. ifeq ($(SHLIB_LINK),)
  296. enable_shared := no
  297. endif
  298. ifeq ($(enable_shared),yes)
  299. iterator = $(srcdir)/empty.mk $(patsubst %,$(srcdir)/shared-object.mk,$(iter-items))
  300. install-shared = install-shared
  301. ifneq ($(LIBUNWIND),)
  302. install-libunwind = install-libunwind
  303. endif
  304. endif
  305. # For -fvisibility=hidden. We need both a -fvisibility=hidden on
  306. # the command line, and a #define to prevent libgcc2.h etc from
  307. # overriding that with #pragmas.
  308. vis_hide = @vis_hide@
  309. ifneq (,$(vis_hide))
  310. # If we have -fvisibility=hidden, then we need to generate hide
  311. # lists for object files implemented in assembly.
  312. ASM_HIDDEN_OP = @asm_hidden_op@
  313. define gen-hide-list
  314. $(NM) -pg $< | \
  315. $(AWK) 'NF == 3 && $$2 !~ /^[UN]$$/ && $$3 !~ /.*_compat/ \
  316. && $$3 !~ /.*@.*/ \
  317. { print "\t$(ASM_HIDDEN_OP)", $$3 }' > $@T
  318. mv -f $@T $@
  319. endef
  320. else
  321. gen-hide-list = echo > $@
  322. endif
  323. ifneq ($(enable_shared),yes)
  324. iterator = $(srcdir)/empty.mk $(patsubst %,$(srcdir)/static-object.mk,$(iter-items))
  325. endif
  326. LIB2ADD += enable-execute-stack.c
  327. # While emutls.c has nothing to do with EH, it is in LIB2ADDEH*
  328. # instead of LIB2ADD because that's the way to be sure on some targets
  329. # (e.g. *-*-darwin*) only one copy of it is linked.
  330. LIB2ADDEH += $(srcdir)/emutls.c
  331. LIB2ADDEHSTATIC += $(srcdir)/emutls.c
  332. LIB2ADDEHSHARED += $(srcdir)/emutls.c
  333. # Library members defined in libgcc2.c.
  334. lib2funcs = _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _cmpdi2 _ucmpdi2 \
  335. _clear_cache _trampoline __main _absvsi2 \
  336. _absvdi2 _addvsi3 _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 \
  337. _negvsi2 _negvdi2 _ctors _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 \
  338. _ctzsi2 _ctzdi2 _popcount_tab _popcountsi2 _popcountdi2 \
  339. _paritysi2 _paritydi2 _powisf2 _powidf2 _powixf2 _powitf2 \
  340. _mulsc3 _muldc3 _mulxc3 _multc3 _divsc3 _divdc3 _divxc3 \
  341. _divtc3 _bswapsi2 _bswapdi2 _clrsbsi2 _clrsbdi2
  342. # The floating-point conversion routines that involve a single-word integer.
  343. # XX stands for the integer mode.
  344. swfloatfuncs = $(patsubst %,_fixuns%XX,sf df xf)
  345. # Likewise double-word routines.
  346. dwfloatfuncs = $(patsubst %,_fix%XX,sf df xf tf) \
  347. $(patsubst %,_fixuns%XX,sf df xf tf) \
  348. $(patsubst %,_floatXX%,sf df xf tf) \
  349. $(patsubst %,_floatunXX%,sf df xf tf)
  350. ifeq ($(LIB2_SIDITI_CONV_FUNCS),)
  351. lib2funcs += $(subst XX,si,$(swfloatfuncs))
  352. lib2funcs += $(subst XX,di,$(dwfloatfuncs))
  353. endif
  354. # These might cause a divide overflow trap and so are compiled with
  355. # unwinder info.
  356. LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
  357. # Remove any objects from lib2funcs and LIB2_DIVMOD_FUNCS that are
  358. # defined as optimized assembly code in LIB1ASMFUNCS or as C code
  359. # in LIB2FUNCS_EXCLUDE.
  360. lib2funcs := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS),$(lib2funcs))
  361. LIB2_DIVMOD_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS), \
  362. $(LIB2_DIVMOD_FUNCS))
  363. # Build "libgcc1" (assembly) components.
  364. lib1asmfuncs-o = $(patsubst %,%$(objext),$(LIB1ASMFUNCS))
  365. $(lib1asmfuncs-o): %$(objext): $(srcdir)/config/$(LIB1ASMSRC) %.vis
  366. $(gcc_compile) -DL$* -xassembler-with-cpp -c $< -include $*.vis
  367. $(patsubst %,%.vis,$(LIB1ASMFUNCS)): %.vis: %_s$(objext)
  368. $(gen-hide-list)
  369. libgcc-objects += $(lib1asmfuncs-o)
  370. lib1asmfuncs-s-o = $(patsubst %,%_s$(objext),$(LIB1ASMFUNCS))
  371. $(lib1asmfuncs-s-o): %_s$(objext): $(srcdir)/config/$(LIB1ASMSRC)
  372. $(gcc_s_compile) -DL$* -xassembler-with-cpp -c $<
  373. ifeq ($(enable_shared),yes)
  374. libgcc-s-objects += $(lib1asmfuncs-s-o)
  375. endif
  376. # Build lib2funcs. For the static library also include LIB2FUNCS_ST.
  377. lib2funcs-o = $(patsubst %,%$(objext),$(lib2funcs) $(LIB2FUNCS_ST))
  378. $(lib2funcs-o): %$(objext): $(srcdir)/libgcc2.c
  379. $(gcc_compile) -DL$* -c $< $(vis_hide)
  380. libgcc-objects += $(lib2funcs-o)
  381. ifeq ($(enable_shared),yes)
  382. lib2funcs-s-o = $(patsubst %,%_s$(objext),$(lib2funcs))
  383. $(lib2funcs-s-o): %_s$(objext): $(srcdir)/libgcc2.c
  384. $(gcc_s_compile) -DL$* -c $<
  385. libgcc-s-objects += $(lib2funcs-s-o)
  386. endif
  387. ifneq ($(LIB2_SIDITI_CONV_FUNCS),)
  388. # Build libgcc2.c for each conversion function, with a specific
  389. # L<func> definition and LIBGCC2_UNITS_PER_WORD setting. The DImode
  390. # functions are built with a wordsize of 4; the TImode functions are
  391. # built with the same labels, but a wordsize of 8.
  392. sifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,si,$(swfloatfuncs)))
  393. difuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,di,$(dwfloatfuncs)))
  394. tifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,ti,$(dwfloatfuncs)))
  395. iter-items := $(sifuncs) $(difuncs) $(tifuncs)
  396. iter-labels := $(sifuncs) $(difuncs) $(difuncs)
  397. iter-sizes := $(patsubst %,4,$(sifuncs) $(difuncs)) $(patsubst %,8,$(tifuncs))
  398. include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/siditi-object.mk,$(iter-items))
  399. libgcc-objects += $(patsubst %,%$(objext),$(sifuncs) $(difuncs) $(tifuncs))
  400. ifeq ($(enable_shared),yes)
  401. libgcc-s-objects += $(patsubst %,%_s$(objext),$(sifuncs) $(difuncs) $(tifuncs))
  402. endif
  403. endif
  404. ifeq ($(LIB2_DIVMOD_EXCEPTION_FLAGS),)
  405. # Provide default flags for compiling divmod functions, if they haven't been
  406. # set already by a target-specific Makefile fragment.
  407. LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions -fnon-call-exceptions
  408. endif
  409. # Build LIB2_DIVMOD_FUNCS.
  410. lib2-divmod-o = $(patsubst %,%$(objext),$(LIB2_DIVMOD_FUNCS))
  411. $(lib2-divmod-o): %$(objext): $(srcdir)/libgcc2.c
  412. $(gcc_compile) -DL$* -c $< \
  413. $(LIB2_DIVMOD_EXCEPTION_FLAGS) $(vis_hide)
  414. libgcc-objects += $(lib2-divmod-o)
  415. ifeq ($(enable_shared),yes)
  416. lib2-divmod-s-o = $(patsubst %,%_s$(objext),$(LIB2_DIVMOD_FUNCS))
  417. $(lib2-divmod-s-o): %_s$(objext): $(srcdir)/libgcc2.c
  418. $(gcc_s_compile) -DL$* -c $< \
  419. $(LIB2_DIVMOD_EXCEPTION_FLAGS)
  420. libgcc-s-objects += $(lib2-divmod-s-o)
  421. endif
  422. ifeq ($(TPBIT),)
  423. # _sf_to_tf and _df_to_tf require tp-bit.c being compiled in.
  424. FPBIT_FUNCS := $(filter-out _sf_to_tf,$(FPBIT_FUNCS))
  425. DPBIT_FUNCS := $(filter-out _df_to_tf,$(DPBIT_FUNCS))
  426. endif
  427. FPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(FPBIT_FUNCS))
  428. DPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(DPBIT_FUNCS))
  429. TPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(TPBIT_FUNCS))
  430. fpbit-src := $(srcdir)/fp-bit.c
  431. # Build FPBIT.
  432. ifneq ($(FPBIT),)
  433. fpbit-o = $(patsubst %,%$(objext),$(FPBIT_FUNCS))
  434. $(fpbit-o): %$(objext): $(fpbit-src)
  435. $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DFLOAT $(FPBIT_CFLAGS) -c $< $(vis_hide)
  436. libgcc-objects += $(fpbit-o)
  437. ifeq ($(enable_shared),yes)
  438. fpbit-s-o = $(patsubst %,%_s$(objext),$(FPBIT_FUNCS))
  439. $(fpbit-s-o): %_s$(objext): $(fpbit-src)
  440. $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DFLOAT $(FPBIT_CFLAGS) -c $<
  441. libgcc-s-objects += $(fpbit-s-o)
  442. endif
  443. endif
  444. # Build DPBIT.
  445. ifneq ($(DPBIT),)
  446. dpbit-o = $(patsubst %,%$(objext),$(DPBIT_FUNCS))
  447. $(dpbit-o): %$(objext): $(fpbit-src)
  448. $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* $(DPBIT_CFLAGS) -c $< $(vis_hide)
  449. libgcc-objects += $(dpbit-o)
  450. ifeq ($(enable_shared),yes)
  451. dpbit-s-o = $(patsubst %,%_s$(objext),$(DPBIT_FUNCS))
  452. $(dpbit-s-o): %_s$(objext): $(fpbit-src)
  453. $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* $(DPBIT_CFLAGS) -c $<
  454. libgcc-s-objects += $(dpbit-s-o)
  455. endif
  456. endif
  457. # Build TPBIT.
  458. ifneq ($(TPBIT),)
  459. tpbit-o = $(patsubst %,%$(objext),$(TPBIT_FUNCS))
  460. $(tpbit-o): %$(objext): $(fpbit-src)
  461. $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DTFLOAT $(TPBIT_CFLAGS) -c $< $(vis_hide)
  462. libgcc-objects += $(tpbit-o)
  463. ifeq ($(enable_shared),yes)
  464. tpbit-s-o = $(patsubst %,%_s$(objext),$(TPBIT_FUNCS))
  465. $(tpbit-s-o): %_s$(objext): $(fpbit-src)
  466. $(gcc_s_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DTFLOAT $(TPBIT_CFLAGS) -c $<
  467. libgcc-s-objects += $(tpbit-s-o)
  468. endif
  469. endif
  470. # Build decimal floating point support.
  471. ifeq ($(decimal_float),yes)
  472. # If $DFP_ENABLE is set, then we want all data type sizes.
  473. ifneq ($(DFP_ENABLE),)
  474. D32PBIT = 1
  475. D64PBIT = 1
  476. D128PBIT = 1
  477. endif
  478. dfp-filenames =
  479. ifneq ($(D32PBIT)$(D64PBIT)$(D128PBIT),)
  480. ifeq ($(enable_decimal_float),bid)
  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 \
  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
  493. dfp-filenames += decContext decNumber decExcept decRound decLibrary decDouble decPacked decQuad decSingle
  494. endif
  495. endif
  496. dfp-objects = $(patsubst %,%$(objext),$(dfp-filenames))
  497. ifeq ($(enable_decimal_float),bid)
  498. $(dfp-objects): %$(objext): $(srcdir)/config/libbid/%.c
  499. else
  500. $(dfp-objects): %$(objext): $(srcdir)/../libdecnumber/%.c
  501. endif
  502. $(gcc_compile) -c $<
  503. libgcc-objects += $(dfp-objects)
  504. decbits-filenames =
  505. ifneq ($(enable_decimal_float),bid)
  506. ifneq ($(D32PBIT),)
  507. decbits-filenames += decimal32
  508. endif
  509. ifneq ($(D64PBIT),)
  510. decbits-filenames += decimal64
  511. endif
  512. ifneq ($(D128PBIT),)
  513. decbits-filenames += decimal128
  514. endif
  515. endif
  516. decbits-objects = $(patsubst %,%$(objext),$(decbits-filenames))
  517. ifeq ($(enable_decimal_float),bid)
  518. $(decbits-objects): %$(objext): $(srcdir)/config/libbid/%.c
  519. else
  520. $(decbits-objects): %$(objext): $(srcdir)/../libdecnumber/$(enable_decimal_float)/%.c
  521. endif
  522. $(gcc_compile) -c $<
  523. libgcc-objects += $(decbits-objects)
  524. # Next build individual support functions.
  525. D32PBIT_FUNCS = _addsub_sd _div_sd _mul_sd _plus_sd _minus_sd \
  526. _eq_sd _ne_sd _lt_sd _gt_sd _le_sd _ge_sd \
  527. _sd_to_si _sd_to_di _sd_to_usi _sd_to_udi \
  528. _si_to_sd _di_to_sd _usi_to_sd _udi_to_sd \
  529. _sd_to_sf _sd_to_df _sd_to_xf _sd_to_tf \
  530. _sf_to_sd _df_to_sd _xf_to_sd _tf_to_sd \
  531. _sd_to_dd _sd_to_td _unord_sd _conv_sd
  532. D64PBIT_FUNCS = _addsub_dd _div_dd _mul_dd _plus_dd _minus_dd \
  533. _eq_dd _ne_dd _lt_dd _gt_dd _le_dd _ge_dd \
  534. _dd_to_si _dd_to_di _dd_to_usi _dd_to_udi \
  535. _si_to_dd _di_to_dd _usi_to_dd _udi_to_dd \
  536. _dd_to_sf _dd_to_df _dd_to_xf _dd_to_tf \
  537. _sf_to_dd _df_to_dd _xf_to_dd _tf_to_dd \
  538. _dd_to_sd _dd_to_td _unord_dd _conv_dd
  539. D128PBIT_FUNCS = _addsub_td _div_td _mul_td _plus_td _minus_td \
  540. _eq_td _ne_td _lt_td _gt_td _le_td _ge_td \
  541. _td_to_si _td_to_di _td_to_usi _td_to_udi \
  542. _si_to_td _di_to_td _usi_to_td _udi_to_td \
  543. _td_to_sf _td_to_df _td_to_xf _td_to_tf \
  544. _sf_to_td _df_to_td _xf_to_td _tf_to_td \
  545. _td_to_sd _td_to_dd _unord_td _conv_td
  546. ifeq ($(enable_decimal_float),bid)
  547. ifneq ($(D32PBIT),)
  548. D32PBIT_FUNCS:=$(filter-out _plus_sd _minus_sd _conv_sd, $(D32PBIT_FUNCS))
  549. endif
  550. ifneq ($(D64PBIT),)
  551. D64PBIT_FUNCS:=$(filter-out _plus_dd _minus_dd _conv_dd, $(D64PBIT_FUNCS))
  552. endif
  553. ifneq ($(D128PBIT),)
  554. D128PBIT_FUNCS:=$(filter-out _plus_td _minus_td _conv_td, $(D128PBIT_FUNCS))
  555. endif
  556. endif
  557. ifneq ($(D32PBIT),)
  558. d32pbit-o = $(patsubst %,%$(objext),$(D32PBIT_FUNCS))
  559. ifeq ($(enable_decimal_float),bid)
  560. $(d32pbit-o): %$(objext): $(srcdir)/config/libbid/%.c
  561. else
  562. $(d32pbit-o): %$(objext): $(srcdir)/dfp-bit.c
  563. endif
  564. $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=32 -c $<
  565. libgcc-objects += $(d32pbit-o)
  566. endif
  567. ifneq ($(D64PBIT),)
  568. d64pbit-o = $(patsubst %,%$(objext),$(D64PBIT_FUNCS))
  569. ifeq ($(enable_decimal_float),bid)
  570. $(d64pbit-o): %$(objext): $(srcdir)/config/libbid/%.c
  571. else
  572. $(d64pbit-o): %$(objext): $(srcdir)/dfp-bit.c
  573. endif
  574. $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=64 -c $<
  575. libgcc-objects += $(d64pbit-o)
  576. endif
  577. ifneq ($(D128PBIT),)
  578. d128pbit-o = $(patsubst %,%$(objext),$(D128PBIT_FUNCS))
  579. ifeq ($(enable_decimal_float),bid)
  580. $(d128pbit-o): %$(objext): $(srcdir)/config/libbid/%.c
  581. else
  582. $(d128pbit-o): %$(objext): $(srcdir)/dfp-bit.c
  583. endif
  584. $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=128 -c $<
  585. libgcc-objects += $(d128pbit-o)
  586. endif
  587. endif
  588. ifeq ($(SYNC),yes)
  589. libgcc-sync-size-funcs := $(foreach op, add sub or and xor nand, \
  590. sync_fetch_and_$(op) \
  591. sync_$(op)_and_fetch) \
  592. sync_bool_compare_and_swap \
  593. sync_val_compare_and_swap \
  594. sync_lock_test_and_set
  595. libgcc-sync-size-funcs := $(foreach prefix, $(libgcc-sync-size-funcs), \
  596. $(foreach suffix, 1 2 4 8 16, \
  597. $(prefix)_$(suffix)))
  598. libgcc-sync-size-funcs-o = $(patsubst %,%$(objext),$(libgcc-sync-size-funcs))
  599. $(libgcc-sync-size-funcs-o): %$(objext): $(srcdir)/sync.c
  600. $(gcc_compile) $(SYNC_CFLAGS) \
  601. -DFN=`echo "$*" | sed 's/_[^_]*$$//'` \
  602. -DSIZE=`echo "$*" | sed 's/.*_//'` \
  603. -c $< $(vis_hide)
  604. libgcc-objects += $(libgcc-sync-size-funcs-o)
  605. libgcc-sync-funcs := sync_synchronize
  606. libgcc-sync-funcs-o = $(patsubst %,%$(objext),$(libgcc-sync-funcs))
  607. $(libgcc-sync-funcs-o): %$(objext): $(srcdir)/sync.c
  608. $(gcc_compile) $(SYNC_CFLAGS) \
  609. -DL$* \
  610. -c $< $(vis_hide)
  611. libgcc-objects += $(libgcc-sync-funcs-o)
  612. ifeq ($(enable_shared),yes)
  613. libgcc-sync-size-funcs-s-o = $(patsubst %,%_s$(objext), \
  614. $(libgcc-sync-size-funcs))
  615. $(libgcc-sync-size-funcs-s-o): %_s$(objext): $(srcdir)/sync.c
  616. $(gcc_s_compile) $(SYNC_CFLAGS) \
  617. -DFN=`echo "$*" | sed 's/_[^_]*$$//'` \
  618. -DSIZE=`echo "$*" | sed 's/.*_//'` \
  619. -c $<
  620. libgcc-s-objects += $(libgcc-sync-size-funcs-s-o)
  621. libgcc-sync-funcs-s-o = $(patsubst %,%_s$(objext),$(libgcc-sync-funcs))
  622. $(libgcc-sync-funcs-s-o): %_s$(objext): $(srcdir)/sync.c
  623. $(gcc_s_compile) $(SYNC_CFLAGS) \
  624. -DL$* \
  625. -c $<
  626. libgcc-s-objects += $(libgcc-sync-funcs-s-o)
  627. endif
  628. endif
  629. # Build fixed-point support.
  630. ifeq ($(fixed_point),yes)
  631. # Generate permutations of function name and mode
  632. fixed-labels := $(shell $(SHELL) $(srcdir)/gen-fixed.sh arith labels)
  633. fixed-funcs := $(shell $(SHELL) $(srcdir)/gen-fixed.sh arith funcs)
  634. fixed-modes := $(shell $(SHELL) $(srcdir)/gen-fixed.sh arith modes)
  635. # Generate the rules for each arithmetic function
  636. iter-items := $(fixed-funcs)
  637. iter-labels := $(fixed-labels)
  638. iter-from := $(fixed-modes)
  639. iter-to := $(fixed-modes)
  640. include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/fixed-obj.mk,$(iter-items))
  641. # Add arithmetic functions to list of objects to be built
  642. libgcc-objects += $(patsubst %,%$(objext),$(filter-out $(LIB2FUNCS_EXCLUDE),$(fixed-funcs)))
  643. ifeq ($(enable_shared),yes)
  644. libgcc-s-objects += $(patsubst %,%_s$(objext),$(filter-out $(LIB2FUNCS_EXCLUDE),$(fixed-funcs)))
  645. endif
  646. # Convert from or to fractional
  647. fixed-conv-funcs := $(shell $(SHELL) $(srcdir)/gen-fixed.sh conv funcs)
  648. fixed-conv-labels := $(shell $(SHELL) $(srcdir)/gen-fixed.sh conv labels)
  649. fixed-conv-from := $(shell $(SHELL) $(srcdir)/gen-fixed.sh conv from)
  650. fixed-conv-to := $(shell $(SHELL) $(srcdir)/gen-fixed.sh conv to)
  651. # Generate the make rules for each conversion function
  652. iter-items := $(fixed-conv-funcs)
  653. iter-labels := $(fixed-conv-labels)
  654. iter-from := $(fixed-conv-from)
  655. iter-to := $(fixed-conv-to)
  656. include $(srcdir)/empty.mk $(patsubst %,$(srcdir)/fixed-obj.mk,$(iter-items))
  657. # Add conversion functions to list of objects to be built
  658. libgcc-objects += $(patsubst %,%$(objext),$(filter-out $(LIB2FUNCS_EXCLUDE),$(fixed-conv-funcs)))
  659. ifeq ($(enable_shared),yes)
  660. libgcc-s-objects += $(patsubst %,%_s$(objext),$(filter-out $(LIB2FUNCS_EXCLUDE),$(fixed-conv-funcs)))
  661. endif
  662. endif
  663. # Build LIB2ADD and LIB2ADD_ST.
  664. ifneq ($(filter-out %.c %.S %.asm,$(LIB2ADD) $(LIB2ADD_ST)),)
  665. $(error Unsupported files in LIB2ADD or LIB2ADD_ST.)
  666. endif
  667. libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADD))))
  668. libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADD_ST))))
  669. c_flags :=
  670. iter-items := $(LIB2ADD) $(LIB2ADD_ST)
  671. include $(iterator)
  672. ifeq ($(enable_shared),yes)
  673. libgcc-s-objects += $(addsuffix _s$(objext),$(basename $(notdir $(LIB2ADD))))
  674. endif
  675. # Build LIB2ADDEH, LIB2ADDEHSTATIC, and LIB2ADDEHSHARED. If we don't have
  676. # libgcc_eh.a, only LIB2ADDEH matters. If we do, only LIB2ADDEHSTATIC and
  677. # LIB2ADDEHSHARED matter. (Usually all three are identical.)
  678. c_flags := -fexceptions
  679. ifeq ($(enable_shared),yes)
  680. libgcc-eh-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADDEHSTATIC))))
  681. libgcc-s-objects += $(addsuffix _s$(objext),$(basename $(notdir $(LIB2ADDEHSHARED))))
  682. iter-items := $(sort $(LIB2ADDEHSTATIC) $(LIB2ADDEHSHARED))
  683. include $(iterator)
  684. else
  685. # Not shared. LIB2ADDEH are added to libgcc.a.
  686. libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADDEH))))
  687. iter-items := $(LIB2ADDEH)
  688. include $(iterator)
  689. endif
  690. # Build LIBUNWIND. Use -fno-exceptions so that the unwind library does
  691. # not generate calls to __gcc_personality_v0.
  692. c_flags := -fno-exceptions
  693. libunwind-objects += $(addsuffix $(objext),$(basename $(notdir $(LIBUNWIND))))
  694. ifeq ($(enable_shared),yes)
  695. libunwind-s-objects += $(addsuffix _s$(objext),$(basename $(notdir $(LIBUNWIND))))
  696. endif
  697. iter-items := $(LIBUNWIND)
  698. include $(iterator)
  699. # Build libgcov components.
  700. LIBGCOV_MERGE = _gcov_merge_add _gcov_merge_single _gcov_merge_delta \
  701. _gcov_merge_ior _gcov_merge_time_profile _gcov_merge_icall_topn
  702. LIBGCOV_PROFILER = _gcov_interval_profiler _gcov_pow2_profiler \
  703. _gcov_one_value_profiler _gcov_indirect_call_profiler \
  704. _gcov_average_profiler _gcov_ior_profiler \
  705. _gcov_indirect_call_profiler_v2 _gcov_time_profiler \
  706. _gcov_indirect_call_topn_profiler
  707. LIBGCOV_INTERFACE = _gcov_dump _gcov_flush _gcov_fork \
  708. _gcov_execl _gcov_execlp \
  709. _gcov_execle _gcov_execv _gcov_execvp _gcov_execve _gcov_reset
  710. LIBGCOV_DRIVER = _gcov
  711. libgcov-merge-objects = $(patsubst %,%$(objext),$(LIBGCOV_MERGE))
  712. libgcov-profiler-objects = $(patsubst %,%$(objext),$(LIBGCOV_PROFILER))
  713. libgcov-interface-objects = $(patsubst %,%$(objext),$(LIBGCOV_INTERFACE))
  714. libgcov-driver-objects = $(patsubst %,%$(objext),$(LIBGCOV_DRIVER))
  715. libgcov-objects = $(libgcov-merge-objects) $(libgcov-profiler-objects) \
  716. $(libgcov-interface-objects) $(libgcov-driver-objects)
  717. $(libgcov-merge-objects): %$(objext): $(srcdir)/libgcov-merge.c $(srcdir)/libgcov.h
  718. $(gcc_compile) -DL$* -c $(srcdir)/libgcov-merge.c
  719. $(libgcov-profiler-objects): %$(objext): $(srcdir)/libgcov-profiler.c $(srcdir)/libgcov.h
  720. $(gcc_compile) -DL$* -c $(srcdir)/libgcov-profiler.c
  721. $(libgcov-interface-objects): %$(objext): $(srcdir)/libgcov-interface.c $(srcdir)/libgcov.h
  722. $(gcc_compile) -DL$* -c $(srcdir)/libgcov-interface.c
  723. $(libgcov-driver-objects): %$(objext): $(srcdir)/libgcov-driver.c \
  724. $(srcdir)/libgcov-driver-system.c $(srcdir)/libgcov.h
  725. $(gcc_compile) -DL$* -c $(srcdir)/libgcov-driver.c
  726. # Static libraries.
  727. libgcc.a: $(libgcc-objects)
  728. libgcov.a: $(libgcov-objects)
  729. libunwind.a: $(libunwind-objects)
  730. libgcc_eh.a: $(libgcc-eh-objects)
  731. libgcc.a libgcov.a libunwind.a libgcc_eh.a:
  732. -rm -f $@
  733. objects="$(objects)"; \
  734. if test -z "$$objects"; then \
  735. echo 'int __libgcc_eh_dummy;' > eh_dummy.c; \
  736. $(gcc_compile_bare) $(vis_hide) -c eh_dummy.c \
  737. -o eh_dummy$(objext); \
  738. objects=eh_dummy$(objext); \
  739. fi; \
  740. $(AR_CREATE_FOR_TARGET) $@ $$objects
  741. $(RANLIB) $@
  742. all: libgcc.a libgcov.a
  743. ifneq ($(LIBUNWIND),)
  744. all: libunwind.a
  745. libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT)
  746. endif
  747. ifeq ($(enable_shared),yes)
  748. all: libgcc_eh.a libgcc_s$(SHLIB_EXT)
  749. ifneq ($(LIBUNWIND),)
  750. all: libunwind$(SHLIB_EXT)
  751. endif
  752. endif
  753. ifeq ($(enable_shared),yes)
  754. # Map-file generation.
  755. ifneq ($(SHLIB_MKMAP),)
  756. libgcc.map.in: $(SHLIB_MAPFILES)
  757. { cat $(SHLIB_MAPFILES) \
  758. | sed -e '/^[ ]*#/d' \
  759. -e 's/^%\(if\|else\|elif\|endif\|define\)/#\1/' \
  760. | $(gcc_compile_bare) -E -xassembler-with-cpp -; \
  761. } > tmp-$@
  762. mv tmp-$@ $@
  763. libgcc.map: $(SHLIB_MKMAP) libgcc.map.in $(libgcc-s-objects)
  764. { $(NM) $(SHLIB_NM_FLAGS) $(libgcc-s-objects); echo %%; \
  765. cat libgcc.map.in; \
  766. } | $(AWK) -f $(SHLIB_MKMAP) $(SHLIB_MKMAP_OPTS) > tmp-$@
  767. mv tmp-$@ $@
  768. libgcc_s$(SHLIB_EXT): libgcc.map
  769. mapfile = libgcc.map
  770. endif
  771. libgcc-std.ver: $(srcdir)/libgcc-std.ver.in
  772. sed -e 's/__PFX__/$(LIBGCC_VER_GNU_PREFIX)/g' \
  773. -e 's/__FIXPTPFX__/$(LIBGCC_VER_FIXEDPOINT_GNU_PREFIX)/g' < $< > $@
  774. libgcc_s$(SHLIB_EXT): $(libgcc-s-objects) $(extra-parts) libgcc.a
  775. # @multilib_flags@ is still needed because this may use
  776. # $(GCC_FOR_TARGET) and $(LIBGCC2_CFLAGS) directly.
  777. # @multilib_dir@ is not really necessary, but sometimes it has
  778. # more uses than just a directory name.
  779. $(mkinstalldirs) $(MULTIDIR)
  780. $(subst @multilib_flags@,$(CFLAGS) -B./,$(subst \
  781. @multilib_dir@,$(MULTIDIR),$(subst \
  782. @shlib_objs@,$(objects) libgcc.a,$(subst \
  783. @shlib_base_name@,libgcc_s,$(subst \
  784. @shlib_map_file@,$(mapfile),$(subst \
  785. @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(subst \
  786. @shlib_slibdir@,$(shlib_slibdir),$(SHLIB_LINK))))))))
  787. libunwind$(SHLIB_EXT): $(libunwind-s-objects) $(extra-parts)
  788. # @multilib_flags@ is still needed because this may use
  789. # $(GCC_FOR_TARGET) and $(LIBGCC2_CFLAGS) directly.
  790. # @multilib_dir@ is not really necessary, but sometimes it has
  791. # more uses than just a directory name.
  792. $(mkinstalldirs) $(MULTIDIR)
  793. $(subst @multilib_flags@,$(CFLAGS) -B./,$(subst \
  794. @multilib_dir@,$(MULTIDIR),$(subst \
  795. @shlib_objs@,$(objects),$(subst \
  796. @shlib_base_name@,libunwind,$(subst \
  797. @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIBUNWIND_LINK))))))
  798. endif
  799. # Build the standard GCC startfiles and endfiles.
  800. ALL_CRT_CFLAGS = $(CFLAGS) $(CRTSTUFF_CFLAGS) $(INCLUDES)
  801. crt_compile = $(CC) $(ALL_CRT_CFLAGS) -o $@ $(compile_deps)
  802. ifeq ($(CUSTOM_CRTSTUFF),)
  803. # Compile two additional files that are linked with every program
  804. # linked using GCC on systems using COFF or ELF, for the sake of C++
  805. # constructors.
  806. crtbegin$(objext): $(srcdir)/crtstuff.c
  807. $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN
  808. crtend$(objext): $(srcdir)/crtstuff.c
  809. $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_END
  810. # These are versions of crtbegin and crtend for shared libraries.
  811. crtbeginS$(objext): $(srcdir)/crtstuff.c
  812. $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $< -DCRT_BEGIN -DCRTSTUFFS_O
  813. crtendS$(objext): $(srcdir)/crtstuff.c
  814. $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $< -DCRT_END -DCRTSTUFFS_O
  815. # This is a version of crtbegin for -static links.
  816. crtbeginT$(objext): $(srcdir)/crtstuff.c
  817. $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN -DCRTSTUFFT_O
  818. # crtoffloadbegin and crtoffloadend contain symbols, that mark the begin and
  819. # the end of tables with addresses, required for offloading.
  820. crtoffloadbegin$(objext): $(srcdir)/offloadstuff.c
  821. $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN
  822. crtoffloadend$(objext): $(srcdir)/offloadstuff.c
  823. $(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_END
  824. endif
  825. ifeq ($(enable_vtable_verify),yes)
  826. # These are used in vtable verification; see comments in source files for
  827. # more details.
  828. vtv_start$(objext): $(srcdir)/vtv_start.c
  829. $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $(srcdir)/vtv_start.c
  830. vtv_end$(objext): $(srcdir)/vtv_end.c
  831. $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $(srcdir)/vtv_end.c
  832. vtv_start_preinit$(objext): $(srcdir)/vtv_start_preinit.c
  833. $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $(srcdir)/vtv_start_preinit.c
  834. vtv_end_preinit$(objext): $(srcdir)/vtv_end_preinit.c
  835. $(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $(srcdir)/vtv_end_preinit.c
  836. endif
  837. ifeq ($(CUSTOM_CRTIN),)
  838. # -x assembler-with-cpp is only needed on case-insensitive filesystem.
  839. crti$(objext): $(srcdir)/config/$(cpu_type)/crti.S
  840. $(crt_compile) -c -x assembler-with-cpp $<
  841. crtn$(objext): $(srcdir)/config/$(cpu_type)/crtn.S
  842. $(crt_compile) -c -x assembler-with-cpp $<
  843. endif
  844. # Build extra startfiles in the libgcc directory.
  845. .PHONY: libgcc-extra-parts
  846. libgcc-extra-parts: $(EXTRA_PARTS)
  847. # Early copyback; see "all" above for the rationale. The
  848. # early copy is necessary so that the gcc -B options find
  849. # the right startup files when linking shared libgcc.
  850. $(mkinstalldirs) $(gcc_objdir)$(MULTISUBDIR)
  851. parts="$(EXTRA_PARTS)"; \
  852. for file in $$parts; do \
  853. rm -f $(gcc_objdir)$(MULTISUBDIR)/$$file; \
  854. $(INSTALL_DATA) $$file $(gcc_objdir)$(MULTISUBDIR)/; \
  855. case $$file in \
  856. *.a) \
  857. $(RANLIB) $(gcc_objdir)$(MULTISUBDIR)/$$file ;; \
  858. esac; \
  859. done
  860. all: $(extra-parts)
  861. $(libgcc-objects) $(libgcc-s-objects) $(libgcc-eh-objects) \
  862. $(libgcov-objects) \
  863. $(libunwind-objects) $(libunwind-s-objects) \
  864. $(EXTRA_PARTS): libgcc_tm.h
  865. # Copy unwind.h to the place where gcc will look for it at build-time
  866. install-unwind_h-forbuild:
  867. dest=$(gcc_objdir)/include/tmp$$$$-unwind.h; \
  868. cp unwind.h $$dest; \
  869. chmod a+r $$dest; \
  870. sh $(srcdir)/../move-if-change $$dest $(gcc_objdir)/include/unwind.h
  871. # Copy unwind.h to the place where gcc will look at run-time, once installed
  872. #
  873. # This is redundant with the internal copy above when using a regular toplevel
  874. # "install" target, because gcc's install will copy to the destination as well.
  875. #
  876. # This is however useful for "install-no-fixincludes" case, when only the gcc
  877. # internal headers are copied by gcc's install.
  878. install-unwind_h:
  879. $(mkinstalldirs) $(DESTDIR)$(libsubdir)/include
  880. $(INSTALL_DATA) unwind.h $(DESTDIR)$(libsubdir)/include
  881. all: install-unwind_h-forbuild
  882. # Documentation targets (empty).
  883. .PHONY: info html dvi pdf install-info install-html install-pdf
  884. info:
  885. install-info:
  886. html:
  887. install-html:
  888. dvi:
  889. pdf:
  890. install-pdf:
  891. # Install rules. These do not depend on "all", so that they can be invoked
  892. # recursively from it.
  893. install-libunwind:
  894. $(mkinstalldirs) $(DESTDIR)$(inst_slibdir)
  895. # NOTE: Maybe this should go into $(inst_libdir), but this
  896. # is where the old mklibgcc.in put it.
  897. $(INSTALL_DATA) libunwind.a $(DESTDIR)$(inst_slibdir)/
  898. chmod 644 $(DESTDIR)$(inst_slibdir)/libunwind.a
  899. $(RANLIB) $(DESTDIR)$(inst_slibdir)/libunwind.a
  900. $(subst @multilib_dir@,$(MULTIDIR),$(subst \
  901. @shlib_base_name@,libunwind,$(subst \
  902. @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIBUNWIND_INSTALL))))
  903. install-shared:
  904. $(mkinstalldirs) $(DESTDIR)$(inst_libdir)
  905. $(INSTALL_DATA) libgcc_eh.a $(DESTDIR)$(inst_libdir)/
  906. chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a
  907. $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a
  908. $(subst @multilib_dir@,$(MULTIDIR),$(subst \
  909. @shlib_base_name@,libgcc_s,$(subst \
  910. @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL))))
  911. install-leaf: $(install-shared) $(install-libunwind)
  912. $(mkinstalldirs) $(DESTDIR)$(inst_libdir)
  913. $(INSTALL_DATA) libgcc.a $(DESTDIR)$(inst_libdir)/
  914. chmod 644 $(DESTDIR)$(inst_libdir)/libgcc.a
  915. $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc.a
  916. $(INSTALL_DATA) libgcov.a $(DESTDIR)$(inst_libdir)/
  917. chmod 644 $(DESTDIR)$(inst_libdir)/libgcov.a
  918. $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcov.a
  919. parts="$(INSTALL_PARTS)"; \
  920. for file in $$parts; do \
  921. rm -f $(DESTDIR)$(inst_libdir)/$$file; \
  922. $(INSTALL_DATA) $$file $(DESTDIR)$(inst_libdir)/; \
  923. case $$file in \
  924. *.a) \
  925. $(RANLIB) $(gcc_objdir)$(MULTISUBDIR)/$$file ;; \
  926. esac; \
  927. done
  928. install: install-leaf install-unwind_h
  929. @: $(MAKE) ; $(MULTIDO) $(FLAGS_TO_PASS) multi-do DO=install
  930. install-strip: install
  931. .PHONY: install install-shared install-libunwind install-strip
  932. .PHONY: install-unwind_h install-unwind_h-forbuild
  933. # Don't export variables to the environment, in order to not confuse
  934. # configure.
  935. .NOEXPORT:
  936. include $(srcdir)/empty.mk $(wildcard *.dep)