Subversion Repositories Kolibri OS

Rev

Rev 6533 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1.  
  2. export CC = kos32-gcc
  3. export AR = kos32-ar
  4. export LD = kos32-ld
  5. export STRIP = kos32-strip
  6.  
  7. INSTALLDIR:= /home/autobuild/tools/win32/mingw32/lib
  8.  
  9. export SDK_DIR:= $(abspath ../../../../sdk)
  10.  
  11. cpu_type = i386
  12. enable_shared = no
  13. double_type_size = 64
  14. long_double_type_size = 96
  15. decimal_float = yes
  16. enable_vtable_verify = no
  17. enable_decimal_float = bid
  18. fixed_point = no
  19.  
  20. # List of extra object files that should be compiled for this target machine.
  21. # The rules for compiling them should be in the t-* file for the machine.
  22. EXTRA_PARTS = crtbegin.o crtend.o crtfastmath.o
  23.  
  24. CFLAGS_OPT+= -fomit-frame-pointer -fno-ident -mno-ms-bitfields
  25. CFLAGS_OPT+= -fbuilding-libgcc -fno-stack-protector
  26.  
  27. CFLAGS = -c -O2 -DIN_GCC -DIN_LIBGCC2 -DHAVE_CC_TLS -DUSE_EMUTLS
  28. CFLAGS+= -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -UWINNT -U_MSC_VER
  29. CFLAGS+= -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
  30. CFLAGS+= -Wold-style-definition $(CFLAGS_OPT)
  31.  
  32. DECNUMINC = -Iconfig/libbid -DENABLE_DECIMAL_BID_FORMAT
  33.  
  34. INCLUDES = -I. -I../gcc -I../include -I$(SDK_DIR)/sources/newlib/libc/include $(DECNUMINC)
  35.  
  36. gcc_compile = $(CC) $(INCLUDES) $(CFLAGS)
  37.  
  38. # Defined in libgcc2.c, included only in the static library.
  39. LIB2FUNCS_ST = _eprintf __gcc_bcmp
  40.  
  41. # List of functions not to build from libgcc2.c.
  42. LIB2FUNCS_EXCLUDE =
  43.  
  44. # These might cause a divide overflow trap and so are compiled with
  45. # unwinder info.
  46. LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
  47.  
  48.  
  49.  
  50. objext = .o
  51.  
  52. FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
  53.         _fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
  54.         _lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \
  55.         _sf_to_df _sf_to_tf _thenan_sf _sf_to_usi _usi_to_sf
  56.  
  57. DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
  58.         _fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \
  59.         _lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \
  60.         _df_to_sf _df_to_tf _thenan_df _df_to_usi _usi_to_df
  61.  
  62. TPBIT_FUNCS = _pack_tf _unpack_tf _addsub_tf _mul_tf _div_tf \
  63.         _fpcmp_parts_tf _compare_tf _eq_tf _ne_tf _gt_tf _ge_tf \
  64.         _lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf \
  65.         _tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf
  66.  
  67. # Additional sources to handle exceptions; overridden by targets as needed.
  68. LIB2ADDEH = unwind-dw2.c unwind-dw2-fde.c unwind-sjlj.c unwind-c.c
  69. LIB2ADDEHSTATIC = $(LIB2ADDEH)
  70.  
  71. LIB2ADD = config/i386/gthr-kos32.c      \
  72.         config/i386/kos32-app.c         \
  73.         config/i386/libc-loader.c
  74.  
  75. EH_MODEL = dw2
  76. CUSTOM_CRTSTUFF = yes
  77.  
  78.  
  79. #crtbegin.o: config/i386/cygming-crtbegin.c
  80.  
  81. #       $(crt_compile) -fno-omit-frame-pointer  -c $<
  82.  
  83.  
  84. #crtbeginS.o: config/i386/cygming-crtbegin.c
  85.  
  86. #       $(crt_compile) -fno-omit-frame-pointer  -c $< -DCRTSTUFFS_O
  87.  
  88.  
  89. # We intentionally use a implementation-reserved init priority of 0,
  90.  
  91. # so allow the warning.
  92.  
  93. #crtend.o: config/i386/cygming-crtend.c
  94.  
  95. #       $(crt_compile) -fno-omit-frame-pointer -Wno-error -c $<
  96.  
  97. # This is an endfile, Use -minline-all-stringops to ensure
  98.  
  99. # that __builtin_memset doesn't refer to the lib function memset().
  100.  
  101. crtfastmath.o: config/i386/crtfastmath.c
  102.  
  103.         $(gcc_compile) -mfxsr -msse -c $<
  104.  
  105. LIB1ASMSRC = i386/start.S
  106. LIB1ASMFUNCS = _chkstk _chkstk_ms _start
  107.  
  108. DFP_ENABLE = true
  109.  
  110. LIB2ADD += config/i386/cpuinfo.c
  111. LIB2ADD += config/i386/sfp-exceptions.c
  112.  
  113.  
  114. softfp_float_modes := tf
  115. softfp_int_modes := si di ti
  116.  
  117. softfp_extensions := sftf dftf xftf
  118.  
  119. softfp_truncations := tfsf tfdf tfxf
  120.  
  121. softfp_exclude_libgcc2 := n
  122.  
  123. # Omit TImode functions
  124.  
  125. softfp_int_modes := si di
  126.  
  127.  
  128. # Provide fallbacks for __builtin_copysignq and __builtin_fabsq.
  129.  
  130. LIB2ADD += config/i386/32/tf-signs.c
  131.  
  132. # While emutls.c has nothing to do with EH, it is in LIB2ADDEH*
  133. # instead of LIB2ADD because that's the way to be sure on some targets
  134. # (e.g. *-*-darwin*) only one copy of it is linked.
  135. LIB2ADDEH += emutls.c
  136. LIB2ADDEHSTATIC += emutls.c
  137.  
  138.  
  139. softfp_float_funcs = add$(m)3 div$(m)3 eq$(m)2 ge$(m)2 le$(m)2 mul$(m)3 \
  140.   neg$(m)2 sub$(m)3 unord$(m)2
  141. softfp_floatint_funcs = fix$(m)$(i) fixuns$(m)$(i) \
  142.   float$(i)$(m) floatun$(i)$(m)
  143.  
  144. softfp_func_list := \
  145.   $(foreach m,$(softfp_float_modes), \
  146.               $(softfp_float_funcs) \
  147.               $(foreach i,$(softfp_int_modes), \
  148.                           $(softfp_floatint_funcs))) \
  149.   $(foreach e,$(softfp_extensions),extend$(e)2) \
  150.   $(foreach t,$(softfp_truncations),trunc$(t)2) \
  151.   $(softfp_extras)
  152.  
  153. ifeq ($(softfp_exclude_libgcc2),y)
  154. # This list is taken from mklibgcc.in and doesn't presently allow for
  155. # 64-bit targets where si should become di and di should become ti.
  156. softfp_func_list := $(filter-out floatdidf floatdisf fixunsdfsi fixunssfsi \
  157.   fixunsdfdi fixdfdi fixunssfdi fixsfdi fixxfdi fixunsxfdi \
  158.   floatdixf fixunsxfsi fixtfdi fixunstfdi floatditf \
  159.   floatundidf floatundisf floatundixf floatunditf,$(softfp_func_list))
  160. endif
  161.  
  162. softfp_file_list := $(addsuffix .c,$(addprefix soft-fp/,$(softfp_func_list)))
  163.  
  164. # Disable missing prototype and type limit warnings.  The prototypes
  165. # for the functions in the soft-fp files have not been brought across
  166. # from glibc.
  167.  
  168. soft-fp-objects-base = $(basename $(notdir $(softfp_file_list)))
  169.  
  170. soft-fp-objects = $(addsuffix $(objext), $(soft-fp-objects-base)) \
  171.   $(addsuffix _s$(objext), $(soft-fp-objects-base))
  172.  
  173. $(soft-fp-objects) : INTERNAL_CFLAGS += -Wno-missing-prototypes -Wno-type-limits
  174.  
  175. LIB2ADD += $(softfp_file_list)
  176.  
  177. ifneq ($(softfp_exclude_libgcc2),y)
  178. # Functions in libgcc2.c are excluded for each soft-float mode (a
  179. # target may have both soft-float and hard-float modes), for the fixed
  180. # list of integer modes (si and di) for which libgcc2.c defines any
  181. # such functions.  Depending on the target, the si and di symbols may
  182. # in fact define di and ti functions.
  183.  
  184. LIB2FUNCS_EXCLUDE += \
  185.   $(addprefix _,$(foreach m,$(softfp_float_modes), \
  186.                             $(foreach i,si di, \
  187.                                         $(softfp_floatint_funcs))))
  188. endif
  189.  
  190. iterator = empty.mk $(patsubst %,static-object.mk,$(iter-items))
  191.  
  192.  
  193. lib2funcs =     _muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _cmpdi2 _ucmpdi2     \
  194.                 _clear_cache _trampoline __main _absvsi2 _absvdi2 _addvsi3      \
  195.                 _addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2  \
  196.                 _ctors _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2     \
  197.                 _popcount_tab _popcountsi2 _popcountdi2 _paritysi2 _paritydi2   \
  198.                 _powisf2 _powidf2 _powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3     \
  199.                 _multc3 _divsc3 _divdc3 _divxc3 _divtc3 _bswapsi2 _bswapdi2     \
  200.                 _clrsbsi2 _clrsbdi2
  201.  
  202. swfloatfuncs = $(patsubst %,_fixuns%XX,sf df xf)
  203.  
  204. dwfloatfuncs = $(patsubst %,_fix%XX,sf df xf tf) \
  205.                 $(patsubst %,_fixuns%XX,sf df xf tf) \
  206.                 $(patsubst %,_floatXX%,sf df xf tf) \
  207.                 $(patsubst %,_floatunXX%,sf df xf tf)
  208.  
  209. ifeq ($(LIB2_SIDITI_CONV_FUNCS),)
  210.   lib2funcs += $(subst XX,si,$(swfloatfuncs))
  211.   lib2funcs += $(subst XX,di,$(dwfloatfuncs))
  212. endif
  213.  
  214. # These might cause a divide overflow trap and so are compiled with
  215. # unwinder info.
  216. LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
  217.  
  218. # Remove any objects from lib2funcs and LIB2_DIVMOD_FUNCS that are
  219. # defined as optimized assembly code in LIB1ASMFUNCS or as C code
  220. # in LIB2FUNCS_EXCLUDE.
  221. lib2funcs := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS),$(lib2funcs))
  222. LIB2_DIVMOD_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS), \
  223.                        $(LIB2_DIVMOD_FUNCS))
  224.  
  225. # Build "libgcc1" (assembly) components.
  226.  
  227. lib1asmfuncs-o = $(patsubst %,%$(objext),$(LIB1ASMFUNCS))
  228. $(lib1asmfuncs-o): %$(objext): config/$(LIB1ASMSRC)
  229.         $(gcc_compile) -DL$* -xassembler-with-cpp -c $< -o $@
  230. libgcc-objects += $(lib1asmfuncs-o)
  231.  
  232.  
  233.  
  234. # Build lib2funcs.  For the static library also include LIB2FUNCS_ST.
  235. lib2funcs-o = $(patsubst %,%$(objext),$(lib2funcs) $(LIB2FUNCS_ST))
  236. $(lib2funcs-o): %$(objext): libgcc2.c
  237.         $(gcc_compile) -DL$* -c $< -o $@
  238. libgcc-objects += $(lib2funcs-o)
  239.  
  240. ifneq ($(LIB2_SIDITI_CONV_FUNCS),)
  241. # Build libgcc2.c for each conversion function, with a specific
  242. # L<func> definition and LIBGCC2_UNITS_PER_WORD setting.  The DImode
  243. # functions are built with a wordsize of 4; the TImode functions are
  244. # built with the same labels, but a wordsize of 8.
  245.  
  246. sifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,si,$(swfloatfuncs)))
  247. difuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,di,$(dwfloatfuncs)))
  248. tifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,ti,$(dwfloatfuncs)))
  249.  
  250. iter-items := $(sifuncs) $(difuncs) $(tifuncs)
  251. iter-labels := $(sifuncs) $(difuncs) $(difuncs)
  252. iter-sizes := $(patsubst %,4,$(sifuncs) $(difuncs)) $(patsubst %,8,$(tifuncs))
  253.  
  254. include empty.mk $(patsubst %,siditi-object.mk,$(iter-items))
  255.  
  256. libgcc-objects += $(patsubst %,%$(objext),$(sifuncs) $(difuncs) $(tifuncs))
  257. endif
  258.  
  259. ifeq ($(LIB2_DIVMOD_EXCEPTION_FLAGS),)
  260. # Provide default flags for compiling divmod functions, if they haven't been
  261. # set already by a target-specific Makefile fragment.
  262. LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions -fnon-call-exceptions
  263. endif
  264.  
  265. # Build LIB2_DIVMOD_FUNCS.
  266. lib2-divmod-o = $(patsubst %,%$(objext),$(LIB2_DIVMOD_FUNCS))
  267. $(lib2-divmod-o): %$(objext): libgcc2.c
  268.         $(gcc_compile) -DL$* -c $< $(LIB2_DIVMOD_EXCEPTION_FLAGS) -o $@
  269. libgcc-objects += $(lib2-divmod-o)
  270.  
  271. ifeq ($(TPBIT),)
  272. # _sf_to_tf and _df_to_tf require tp-bit.c being compiled in.
  273. FPBIT_FUNCS := $(filter-out _sf_to_tf,$(FPBIT_FUNCS))
  274. DPBIT_FUNCS := $(filter-out _df_to_tf,$(DPBIT_FUNCS))
  275. endif
  276.  
  277. FPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(FPBIT_FUNCS))
  278. DPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(DPBIT_FUNCS))
  279. TPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(TPBIT_FUNCS))
  280.  
  281. fpbit-src := fp-bit.c
  282.  
  283. # Build FPBIT.
  284. ifneq ($(FPBIT),)
  285. fpbit-o = $(patsubst %,%$(objext),$(FPBIT_FUNCS))
  286. $(fpbit-o): %$(objext): $(fpbit-src)
  287.         $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DFLOAT $(FPBIT_CFLAGS) -c $< -o $@
  288. libgcc-objects += $(fpbit-o)
  289. endif
  290.  
  291. # Build DPBIT.
  292. ifneq ($(DPBIT),)
  293. dpbit-o = $(patsubst %,%$(objext),$(DPBIT_FUNCS))
  294. $(dpbit-o): %$(objext): $(fpbit-src)
  295.         $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* $(DPBIT_CFLAGS) -c $< -o $@
  296. libgcc-objects += $(dpbit-o)
  297. endif
  298.  
  299. # Build TPBIT.
  300. ifneq ($(TPBIT),)
  301. tpbit-o = $(patsubst %,%$(objext),$(TPBIT_FUNCS))
  302. $(tpbit-o): %$(objext): $(fpbit-src)
  303.         $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DTFLOAT $(TPBIT_CFLAGS) -c $< -o $@
  304. libgcc-objects += $(tpbit-o)
  305. endif
  306.  
  307. # Build decimal floating point support.
  308. ifeq ($(decimal_float),yes)
  309.  
  310. # If $DFP_ENABLE is set, then we want all data type sizes.
  311. ifneq ($(DFP_ENABLE),)
  312. D32PBIT = 1
  313. D64PBIT = 1
  314. D128PBIT = 1
  315. endif
  316.  
  317. dfp-filenames =
  318. ifneq ($(D32PBIT)$(D64PBIT)$(D128PBIT),)
  319. ifeq ($(enable_decimal_float),bid)
  320. dfp-filenames += bid_decimal_globals bid_decimal_data \
  321.                  bid_binarydecimal bid_convert_data \
  322.                  _isinfd32 _isinfd64 _isinfd128 bid64_noncomp \
  323.                  bid128_noncomp bid128_fma bid_round bid_from_int \
  324.                  bid64_add bid128_add bid64_div bid128_div \
  325.                  bid64_mul bid128_mul bid64_compare bid128_compare \
  326.                  bid128 bid32_to_bid64 bid32_to_bid128 bid64_to_bid128 \
  327.                  bid64_to_int32 bid64_to_int64 \
  328.                  bid64_to_uint32 bid64_to_uint64 \
  329.                  bid128_to_int32 bid128_to_int64 \
  330.                  bid128_to_uint32 bid128_to_uint64
  331. else
  332. dfp-filenames += decContext decNumber decExcept decRound decLibrary decDouble decPacked decQuad decSingle
  333. endif
  334. endif
  335.  
  336.  
  337. dfp-objects = $(patsubst %,%$(objext),$(dfp-filenames))
  338. ifeq ($(enable_decimal_float),bid)
  339. $(dfp-objects): %$(objext): config/libbid/%.c
  340. else
  341. $(dfp-objects): %$(objext): ../libdecnumber/%.c
  342. endif
  343.         $(gcc_compile) -c $<
  344. libgcc-objects += $(dfp-objects)
  345.  
  346. decbits-filenames =
  347. ifneq ($(enable_decimal_float),bid)
  348. ifneq ($(D32PBIT),)
  349. decbits-filenames += decimal32
  350. endif
  351.  
  352. ifneq ($(D64PBIT),)
  353. decbits-filenames += decimal64
  354. endif
  355.  
  356. ifneq ($(D128PBIT),)
  357. decbits-filenames += decimal128
  358. endif
  359. endif
  360.  
  361. decbits-objects = $(patsubst %,%$(objext),$(decbits-filenames))
  362. ifeq ($(enable_decimal_float),bid)
  363. $(decbits-objects): %$(objext): config/libbid/%.c
  364. else
  365. $(decbits-objects): %$(objext): ../libdecnumber/$(enable_decimal_float)/%.c
  366. endif
  367.         $(gcc_compile) -c $<
  368. libgcc-objects += $(decbits-objects)
  369.  
  370.  
  371.  
  372. # Next build individual support functions.
  373. D32PBIT_FUNCS = _addsub_sd _div_sd _mul_sd _plus_sd _minus_sd \
  374.         _eq_sd _ne_sd _lt_sd _gt_sd _le_sd _ge_sd \
  375.         _sd_to_si _sd_to_di _sd_to_usi _sd_to_udi \
  376.         _si_to_sd _di_to_sd _usi_to_sd _udi_to_sd \
  377.         _sd_to_sf _sd_to_df _sd_to_xf _sd_to_tf \
  378.         _sf_to_sd _df_to_sd _xf_to_sd _tf_to_sd \
  379.         _sd_to_dd _sd_to_td _unord_sd _conv_sd
  380.  
  381. D64PBIT_FUNCS = _addsub_dd _div_dd _mul_dd _plus_dd _minus_dd \
  382.         _eq_dd _ne_dd _lt_dd _gt_dd _le_dd _ge_dd \
  383.         _dd_to_si _dd_to_di _dd_to_usi _dd_to_udi \
  384.         _si_to_dd _di_to_dd _usi_to_dd _udi_to_dd \
  385.         _dd_to_sf _dd_to_df _dd_to_xf _dd_to_tf \
  386.         _sf_to_dd _df_to_dd _xf_to_dd _tf_to_dd \
  387.         _dd_to_sd _dd_to_td _unord_dd _conv_dd
  388.  
  389. D128PBIT_FUNCS = _addsub_td _div_td _mul_td _plus_td _minus_td \
  390.         _eq_td _ne_td _lt_td _gt_td _le_td _ge_td \
  391.         _td_to_si _td_to_di _td_to_usi _td_to_udi \
  392.         _si_to_td _di_to_td _usi_to_td _udi_to_td \
  393.         _td_to_sf _td_to_df _td_to_xf _td_to_tf \
  394.         _sf_to_td _df_to_td _xf_to_td _tf_to_td \
  395.         _td_to_sd _td_to_dd _unord_td _conv_td
  396.  
  397. ifeq ($(enable_decimal_float),bid)
  398. ifneq ($(D32PBIT),)
  399. D32PBIT_FUNCS:=$(filter-out _plus_sd _minus_sd _conv_sd, $(D32PBIT_FUNCS))
  400. endif
  401.  
  402. ifneq ($(D64PBIT),)
  403. D64PBIT_FUNCS:=$(filter-out _plus_dd _minus_dd _conv_dd, $(D64PBIT_FUNCS))
  404. endif
  405.  
  406. ifneq ($(D128PBIT),)
  407. D128PBIT_FUNCS:=$(filter-out _plus_td _minus_td _conv_td, $(D128PBIT_FUNCS))
  408. endif
  409. endif
  410.  
  411. ifneq ($(D32PBIT),)
  412. d32pbit-o = $(patsubst %,%$(objext),$(D32PBIT_FUNCS))
  413. ifeq ($(enable_decimal_float),bid)
  414. $(d32pbit-o): %$(objext): config/libbid/%.c
  415. else
  416. $(d32pbit-o): %$(objext): $(srcdir)/dfp-bit.c
  417. endif
  418.         $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=32 -c $< -o $@
  419. libgcc-objects += $(d32pbit-o)
  420. endif
  421.  
  422. ifneq ($(D64PBIT),)
  423. d64pbit-o = $(patsubst %,%$(objext),$(D64PBIT_FUNCS))
  424. ifeq ($(enable_decimal_float),bid)
  425. $(d64pbit-o): %$(objext): config/libbid/%.c
  426. else
  427. $(d64pbit-o): %$(objext): $(srcdir)/dfp-bit.c
  428. endif
  429.         $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=64 -c $<
  430. libgcc-objects += $(d64pbit-o)
  431. endif
  432.  
  433. ifneq ($(D128PBIT),)
  434. d128pbit-o = $(patsubst %,%$(objext),$(D128PBIT_FUNCS))
  435. ifeq ($(enable_decimal_float),bid)
  436. $(d128pbit-o): %$(objext): config/libbid/%.c
  437. else
  438. $(d128pbit-o): %$(objext): $(srcdir)/dfp-bit.c
  439. endif
  440.         $(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=128 -c $<
  441. libgcc-objects += $(d128pbit-o)
  442. endif
  443.  
  444. endif
  445.  
  446. # Build LIB2ADD and LIB2ADD_ST.
  447. ifneq ($(filter-out %.c %.S %.asm,$(LIB2ADD) $(LIB2ADD_ST)),)
  448. $(error Unsupported files in LIB2ADD or LIB2ADD_ST.)
  449. endif
  450.  
  451. libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADD))))
  452. libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADD_ST))))
  453.  
  454. c_flags :=
  455. iter-items := $(LIB2ADD) $(LIB2ADD_ST)
  456. include $(iterator)
  457.  
  458. c_flags := -fexceptions
  459.  
  460. libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADDEH))))
  461.  
  462. iter-items := $(LIB2ADDEH)
  463. include $(iterator)
  464.  
  465.  
  466. # targets
  467.  
  468. all: libgcc.a
  469.  
  470. libgcc.a : $(libgcc-objects) Makefile
  471.         $(AR) crs libgcc.a $(libgcc-objects)
  472.  
  473. install: libgcc.a
  474.         mv -f libgcc.a $(INSTALLDIR)/libgcc.a
  475.  
  476.  
  477.