Makefile.tpl 75 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105
  1. [+ AutoGen5 template -*- Mode: Makefile -*-
  2. in
  3. +]
  4. # Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'.
  5. #
  6. # Makefile for directory with subdirs to build.
  7. # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
  8. # 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
  9. # Free Software Foundation
  10. #
  11. # This file is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 3 of the License, or
  14. # (at your option) any later version.
  15. #
  16. # This program is distributed in the hope that it will be useful,
  17. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. # GNU General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU General Public License
  22. # along with this program; see the file COPYING3. If not see
  23. # <http://www.gnu.org/licenses/>.
  24. #
  25. # First, test for a proper version of make, but only where one is required.
  26. @if gcc
  27. ifeq (,$(.VARIABLES)) # The variable .VARIABLES, new with 3.80, is never empty.
  28. $(error GNU make version 3.80 or newer is required.)
  29. endif
  30. @endif gcc
  31. # -------------------------------
  32. # Standard Autoconf-set variables
  33. # -------------------------------
  34. VPATH=@srcdir@
  35. build_alias=@build_noncanonical@
  36. build_vendor=@build_vendor@
  37. build_os=@build_os@
  38. build=@build@
  39. host_alias=@host_noncanonical@
  40. host_vendor=@host_vendor@
  41. host_os=@host_os@
  42. host=@host@
  43. target_alias=@target_noncanonical@
  44. target_vendor=@target_vendor@
  45. target_os=@target_os@
  46. target=@target@
  47. program_transform_name = @program_transform_name@
  48. prefix = @prefix@
  49. exec_prefix = @exec_prefix@
  50. srcdir = @srcdir@
  51. bindir = @bindir@
  52. sbindir = @sbindir@
  53. libexecdir = @libexecdir@
  54. datadir = @datadir@
  55. sysconfdir = @sysconfdir@
  56. sharedstatedir = @sharedstatedir@
  57. localstatedir = @localstatedir@
  58. libdir = @libdir@
  59. includedir = @includedir@
  60. oldincludedir = @oldincludedir@
  61. infodir = @infodir@
  62. datarootdir = @datarootdir@
  63. docdir = @docdir@
  64. pdfdir = @pdfdir@
  65. htmldir = @htmldir@
  66. mandir = @mandir@
  67. man1dir = $(mandir)/man1
  68. man2dir = $(mandir)/man2
  69. man3dir = $(mandir)/man3
  70. man4dir = $(mandir)/man4
  71. man5dir = $(mandir)/man5
  72. man6dir = $(mandir)/man6
  73. man7dir = $(mandir)/man7
  74. man8dir = $(mandir)/man8
  75. man9dir = $(mandir)/man9
  76. INSTALL = @INSTALL@
  77. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  78. INSTALL_SCRIPT = @INSTALL_SCRIPT@
  79. INSTALL_DATA = @INSTALL_DATA@
  80. LN = @LN@
  81. LN_S = @LN_S@
  82. MAINT = @MAINT@
  83. MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
  84. MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
  85. # -------------------------------------------------
  86. # Miscellaneous non-standard autoconf-set variables
  87. # -------------------------------------------------
  88. # The gcc driver likes to know the arguments it was configured with.
  89. TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@
  90. tooldir = @tooldir@
  91. build_tooldir = @build_tooldir@
  92. # This is the name of the environment variable used for the path to
  93. # the libraries.
  94. RPATH_ENVVAR = @RPATH_ENVVAR@
  95. # On targets where RPATH_ENVVAR is PATH, a subdirectory of the GCC build path
  96. # is used instead of the directory itself to avoid including built
  97. # executables in PATH.
  98. GCC_SHLIB_SUBDIR = @GCC_SHLIB_SUBDIR@
  99. # If the build should make suitable code for shared host resources.
  100. host_shared = @host_shared@
  101. # Build programs are put under this directory.
  102. BUILD_SUBDIR = @build_subdir@
  103. # This is set by the configure script to the arguments to use when configuring
  104. # directories built for the build system.
  105. BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)"
  106. # Linker flags to use on the host, for stage1 or when not
  107. # bootstrapping.
  108. STAGE1_LDFLAGS = @stage1_ldflags@
  109. # Libraries to use on the host, for stage1 or when not bootstrapping.
  110. STAGE1_LIBS = @stage1_libs@
  111. # Linker flags to use for stage2 and later.
  112. POSTSTAGE1_LDFLAGS = @poststage1_ldflags@
  113. # Libraries to use for stage2 and later.
  114. POSTSTAGE1_LIBS = @poststage1_libs@
  115. # This is the list of variables to export in the environment when
  116. # configuring any subdirectory. It must also be exported whenever
  117. # recursing into a build directory in case that directory's Makefile
  118. # re-runs configure.
  119. BASE_EXPORTS = \
  120. FLEX="$(FLEX)"; export FLEX; \
  121. LEX="$(LEX)"; export LEX; \
  122. BISON="$(BISON)"; export BISON; \
  123. YACC="$(YACC)"; export YACC; \
  124. M4="$(M4)"; export M4; \
  125. SED="$(SED)"; export SED; \
  126. AWK="$(AWK)"; export AWK; \
  127. MAKEINFO="$(MAKEINFO)"; export MAKEINFO;
  128. # This is the list of variables to export in the environment when
  129. # configuring subdirectories for the build system.
  130. BUILD_EXPORTS = \
  131. $(BASE_EXPORTS) \
  132. AR="$(AR_FOR_BUILD)"; export AR; \
  133. AS="$(AS_FOR_BUILD)"; export AS; \
  134. CC="$(CC_FOR_BUILD)"; export CC; \
  135. CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
  136. CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
  137. CPP="$(CPP_FOR_BUILD)"; export CPP; \
  138. CPPFLAGS="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS; \
  139. CXX="$(CXX_FOR_BUILD)"; export CXX; \
  140. CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
  141. GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
  142. GOC="$(GOC_FOR_BUILD)"; export GOC; \
  143. GOCFLAGS="$(GOCFLAGS_FOR_BUILD)"; export GOCFLAGS; \
  144. GDC="$(GDC_FOR_BUILD)"; export GDC; \
  145. GDCFLAGS="$(GDCFLAGS_FOR_BUILD)"; export GDCFLAGS; \
  146. DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
  147. DSYMUTIL="$(DSYMUTIL_FOR_BUILD)"; export DSYMUTIL; \
  148. LD="$(LD_FOR_BUILD)"; export LD; \
  149. LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
  150. NM="$(NM_FOR_BUILD)"; export NM; \
  151. RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
  152. WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
  153. WINDMC="$(WINDMC_FOR_BUILD)"; export WINDMC;
  154. # These variables must be set on the make command line for directories
  155. # built for the build system to override those in BASE_FLAGS_TO_PASS.
  156. EXTRA_BUILD_FLAGS = \
  157. CFLAGS="$(CFLAGS_FOR_BUILD)" \
  158. LDFLAGS="$(LDFLAGS_FOR_BUILD)"
  159. # This is the list of directories to built for the host system.
  160. SUBDIRS = @configdirs@
  161. TARGET_CONFIGDIRS = @target_configdirs@
  162. # This is set by the configure script to the arguments to use when configuring
  163. # directories built for the host system.
  164. HOST_CONFIGARGS = @host_configargs@
  165. # Host programs are put under this directory, which is . except if building
  166. # with srcdir=..
  167. HOST_SUBDIR = @host_subdir@
  168. # This is the list of variables to export in the environment when
  169. # configuring subdirectories for the host system. We need to pass
  170. # some to the GCC configure because of its hybrid host/target nature.
  171. HOST_EXPORTS = \
  172. $(BASE_EXPORTS) \
  173. CC="$(CC)"; export CC; \
  174. ADA_CFLAGS="$(ADA_CFLAGS)"; export ADA_CFLAGS; \
  175. CFLAGS="$(CFLAGS)"; export CFLAGS; \
  176. CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
  177. CXX="$(CXX)"; export CXX; \
  178. CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
  179. GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \
  180. GOC="$(GOC)"; export GOC; \
  181. GDC="$(GDC)"; export GDC; \
  182. AR="$(AR)"; export AR; \
  183. AS="$(AS)"; export AS; \
  184. CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
  185. CPP_FOR_BUILD="$(CPP_FOR_BUILD)"; export CPP_FOR_BUILD; \
  186. CPPFLAGS_FOR_BUILD="$(CPPFLAGS_FOR_BUILD)"; export CPPFLAGS_FOR_BUILD; \
  187. CXX_FOR_BUILD="$(CXX_FOR_BUILD)"; export CXX_FOR_BUILD; \
  188. DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
  189. DSYMUTIL="$(DSYMUTIL)"; export DSYMUTIL; \
  190. LD="$(LD)"; export LD; \
  191. LDFLAGS="$(STAGE1_LDFLAGS) $(LDFLAGS)"; export LDFLAGS; \
  192. NM="$(NM)"; export NM; \
  193. RANLIB="$(RANLIB)"; export RANLIB; \
  194. WINDRES="$(WINDRES)"; export WINDRES; \
  195. WINDMC="$(WINDMC)"; export WINDMC; \
  196. OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
  197. OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
  198. OTOOL="$(OTOOL)"; export OTOOL; \
  199. PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)"; export PKG_CONFIG_PATH; \
  200. READELF="$(READELF)"; export READELF; \
  201. AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \
  202. AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \
  203. DSYMUTIL_FOR_TARGET="$(DSYMUTIL_FOR_TARGET)"; export DSYMUTIL_FOR_TARGET; \
  204. GCC_FOR_TARGET="$(GCC_FOR_TARGET)"; export GCC_FOR_TARGET; \
  205. LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \
  206. NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \
  207. OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \
  208. OBJCOPY_FOR_TARGET="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY_FOR_TARGET; \
  209. OTOOL_FOR_TARGET="$(OTOOL_FOR_TARGET)"; export OTOOL_FOR_TARGET; \
  210. RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
  211. READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \
  212. TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
  213. HOST_LIBS="$(STAGE1_LIBS)"; export HOST_LIBS; \
  214. GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
  215. GMPINC="$(HOST_GMPINC)"; export GMPINC; \
  216. ISLLIBS="$(HOST_ISLLIBS)"; export ISLLIBS; \
  217. ISLINC="$(HOST_ISLINC)"; export ISLINC; \
  218. LIBELFLIBS="$(HOST_LIBELFLIBS)"; export LIBELFLIBS; \
  219. LIBELFINC="$(HOST_LIBELFINC)"; export LIBELFINC; \
  220. XGCC_FLAGS_FOR_TARGET="$(XGCC_FLAGS_FOR_TARGET)"; export XGCC_FLAGS_FOR_TARGET; \
  221. @if gcc-bootstrap
  222. $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
  223. @endif gcc-bootstrap
  224. $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
  225. POSTSTAGE1_CXX_EXPORT = \
  226. CXX='$(CXX)'; export CXX; \
  227. CXX_FOR_BUILD='$(CXX_FOR_BUILD)'; export CXX_FOR_BUILD;
  228. @if target-libstdc++-v3-bootstrap
  229. # Override the above if we're bootstrapping C++.
  230. POSTSTAGE1_CXX_EXPORT = \
  231. CXX="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xg++$(exeext) \
  232. -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ -nostdinc++ \
  233. -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
  234. -B$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
  235. `if $(LEAN); then echo ' -isystem '; else echo ' -I'; fi`$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include/$(TARGET_SUBDIR) \
  236. `if $(LEAN); then echo ' -isystem '; else echo ' -I'; fi`$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/include \
  237. `if $(LEAN); then echo ' -isystem '; else echo ' -I'; fi`$$s/libstdc++-v3/libsupc++ \
  238. -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
  239. -L$$r/prev-$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs"; \
  240. export CXX; \
  241. CXX_FOR_BUILD="$$CXX"; export CXX_FOR_BUILD;
  242. @endif target-libstdc++-v3-bootstrap
  243. # Similar, for later GCC stages.
  244. POSTSTAGE1_HOST_EXPORTS = \
  245. $(HOST_EXPORTS) \
  246. CC="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
  247. -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ \
  248. $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
  249. CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \
  250. $(POSTSTAGE1_CXX_EXPORT) \
  251. $(LTO_EXPORTS) \
  252. GDC="$$r/$(HOST_SUBDIR)/prev-gcc/gdc$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
  253. -B$(build_tooldir)/bin/ $(GDC_FLAGS_FOR_TARGET) \
  254. -B$$r/prev-$(TARGET_SUBDIR)/libphobos/src \
  255. -I$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime -I$$s/libphobos/libdruntime \
  256. -L$$r/prev-$(TARGET_SUBDIR)/libphobos/src/.libs \
  257. -L$$r/prev-$(TARGET_SUBDIR)/libphobos/libdruntime/.libs"; \
  258. export GDC; \
  259. GDC_FOR_BUILD="$$GDC"; export GDC_FOR_BUILD; \
  260. GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \
  261. LDFLAGS="$(POSTSTAGE1_LDFLAGS) $(BOOT_LDFLAGS)"; export LDFLAGS; \
  262. HOST_LIBS="$(POSTSTAGE1_LIBS)"; export HOST_LIBS;
  263. # Target libraries are put under this directory:
  264. TARGET_SUBDIR = @target_subdir@
  265. # This is set by the configure script to the arguments to use when configuring
  266. # directories built for the target.
  267. TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)"
  268. # This is the list of variables to export in the environment when
  269. # configuring subdirectories for the target system.
  270. BASE_TARGET_EXPORTS = \
  271. $(BASE_EXPORTS) \
  272. AR="$(AR_FOR_TARGET)"; export AR; \
  273. AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
  274. CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
  275. CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
  276. CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
  277. CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
  278. CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
  279. GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \
  280. GOC="$(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GOC; \
  281. GDC="$(GDC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GDC; \
  282. DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
  283. DSYMUTIL="$(DSYMUTIL_FOR_TARGET)"; export DSYMUTIL; \
  284. LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \
  285. LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
  286. LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \
  287. NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \
  288. OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \
  289. OBJCOPY="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY; \
  290. OTOOL="$(OTOOL_FOR_TARGET)"; export OTOOL; \
  291. RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
  292. READELF="$(READELF_FOR_TARGET)"; export READELF; \
  293. STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
  294. WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
  295. WINDMC="$(WINDMC_FOR_TARGET)"; export WINDMC; \
  296. @if gcc-bootstrap
  297. $(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
  298. @endif gcc-bootstrap
  299. $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
  300. TARGET_CONFIGDIRS="$(TARGET_CONFIGDIRS)"; export TARGET_CONFIGDIRS;
  301. RAW_CXX_TARGET_EXPORTS = \
  302. $(BASE_TARGET_EXPORTS) \
  303. CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
  304. CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
  305. NORMAL_TARGET_EXPORTS = \
  306. $(BASE_TARGET_EXPORTS) \
  307. CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
  308. # Where to find GMP
  309. HOST_GMPLIBS = @gmplibs@
  310. HOST_GMPINC = @gmpinc@
  311. # Where to find isl
  312. HOST_ISLLIBS = @isllibs@
  313. HOST_ISLINC = @islinc@
  314. # Where to find libelf
  315. HOST_LIBELFLIBS = @libelflibs@
  316. HOST_LIBELFINC = @libelfinc@
  317. # ----------------------------------------------
  318. # Programs producing files for the BUILD machine
  319. # ----------------------------------------------
  320. SHELL = @SHELL@
  321. # pwd command to use. Allow user to override default by setting PWDCMD in
  322. # the environment to account for automounters. The make variable must not
  323. # be called PWDCMD, otherwise the value set here is passed to make
  324. # subprocesses and overrides the setting from the user's environment.
  325. # Don't use PWD since it is a common shell environment variable and we
  326. # don't want to corrupt it.
  327. PWD_COMMAND = $${PWDCMD-pwd}
  328. # compilers to use to create programs which must be run in the build
  329. # environment.
  330. AR_FOR_BUILD = @AR_FOR_BUILD@
  331. AS_FOR_BUILD = @AS_FOR_BUILD@
  332. CC_FOR_BUILD = @CC_FOR_BUILD@
  333. CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
  334. CPP_FOR_BUILD = @CPP_FOR_BUILD@
  335. CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@
  336. CXXFLAGS_FOR_BUILD = @CXXFLAGS_FOR_BUILD@
  337. CXX_FOR_BUILD = @CXX_FOR_BUILD@
  338. DLLTOOL_FOR_BUILD = @DLLTOOL_FOR_BUILD@
  339. DSYMUTIL_FOR_BUILD = @DSYMUTIL_FOR_BUILD@
  340. GFORTRAN_FOR_BUILD = @GFORTRAN_FOR_BUILD@
  341. GOC_FOR_BUILD = @GOC_FOR_BUILD@
  342. GDC_FOR_BUILD = @GDC_FOR_BUILD@
  343. LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@
  344. LD_FOR_BUILD = @LD_FOR_BUILD@
  345. NM_FOR_BUILD = @NM_FOR_BUILD@
  346. RANLIB_FOR_BUILD = @RANLIB_FOR_BUILD@
  347. WINDMC_FOR_BUILD = @WINDMC_FOR_BUILD@
  348. WINDRES_FOR_BUILD = @WINDRES_FOR_BUILD@
  349. # Special variables passed down in EXTRA_GCC_FLAGS. They are defined
  350. # here so that they can be overridden by Makefile fragments.
  351. BUILD_PREFIX = @BUILD_PREFIX@
  352. BUILD_PREFIX_1 = @BUILD_PREFIX_1@
  353. # Flags to pass to stage2 and later makes. They are defined
  354. # here so that they can be overridden by Makefile fragments.
  355. BOOT_CFLAGS= -g -O2
  356. BOOT_LDFLAGS=
  357. BOOT_ADAFLAGS= -gnatpg
  358. AWK = @AWK@
  359. SED = @SED@
  360. BISON = @BISON@
  361. YACC = @YACC@
  362. FLEX = @FLEX@
  363. LEX = @LEX@
  364. M4 = @M4@
  365. MAKEINFO = @MAKEINFO@
  366. EXPECT = @EXPECT@
  367. RUNTEST = @RUNTEST@
  368. AUTO_PROFILE = gcc-auto-profile -c 10000000
  369. # This just becomes part of the MAKEINFO definition passed down to
  370. # sub-makes. It lets flags be given on the command line while still
  371. # using the makeinfo from the object tree.
  372. # (Default to avoid splitting info files by setting the threshold high.)
  373. MAKEINFOFLAGS = --split-size=5000000
  374. # ---------------------------------------------
  375. # Programs producing files for the HOST machine
  376. # ---------------------------------------------
  377. AS = @AS@
  378. AR = @AR@ @AR_PLUGIN_OPTION@
  379. AR_FLAGS = rc
  380. CC = @CC@
  381. CXX = @CXX@
  382. DLLTOOL = @DLLTOOL@
  383. DSYMUTIL = @DSYMUTIL@
  384. LD = @LD@
  385. LIPO = @LIPO@
  386. NM = @NM@
  387. OBJDUMP = @OBJDUMP@
  388. OTOOL = @OTOOL@
  389. RANLIB = @RANLIB@ @RANLIB_PLUGIN_OPTION@
  390. READELF = @READELF@
  391. STRIP = @STRIP@
  392. WINDRES = @WINDRES@
  393. WINDMC = @WINDMC@
  394. GDC = @GDC@
  395. GNATBIND = @GNATBIND@
  396. GNATMAKE = @GNATMAKE@
  397. CFLAGS = @CFLAGS@
  398. LDFLAGS = @LDFLAGS@
  399. LIBCFLAGS = $(CFLAGS)
  400. CXXFLAGS = @CXXFLAGS@
  401. LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
  402. GOCFLAGS = $(CFLAGS)
  403. GDCFLAGS = $(CFLAGS)
  404. PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
  405. # Pass additional PGO and LTO compiler options to the PGO build.
  406. BUILD_CFLAGS = $(PGO_BUILD_CFLAGS) $(PGO_BUILD_LTO_CFLAGS)
  407. override CFLAGS += $(BUILD_CFLAGS)
  408. override CXXFLAGS += $(BUILD_CFLAGS)
  409. # Additional PGO and LTO compiler options to generate profiling data
  410. # for the PGO build.
  411. PGO_BUILD_GEN_FLAGS_TO_PASS = \
  412. PGO_BUILD_CFLAGS="@PGO_BUILD_GEN_CFLAGS@" \
  413. PGO_BUILD_LTO_CFLAGS="@PGO_BUILD_LTO_CFLAGS@"
  414. # NB: Filter out any compiler options which may fail PGO training runs.
  415. PGO_BUILD_TRAINING_CFLAGS:= \
  416. $(filter-out -Werror=%,$(CFLAGS))
  417. PGO_BUILD_TRAINING_CXXFLAGS:=\
  418. $(filter-out -Werror=%,$(CXXFLAGS))
  419. PGO_BUILD_TRAINING_CFLAGS:= \
  420. $(filter-out -Wall,$(PGO_BUILD_TRAINING_CFLAGS))
  421. PGO_BUILD_TRAINING_CXXFLAGS:= \
  422. $(filter-out -Wall,$(PGO_BUILD_TRAINING_CXXFLAGS))
  423. PGO_BUILD_TRAINING_CFLAGS:= \
  424. $(filter-out -specs=%,$(PGO_BUILD_TRAINING_CFLAGS))
  425. PGO_BUILD_TRAINING_CXXFLAGS:= \
  426. $(filter-out -specs=%,$(PGO_BUILD_TRAINING_CXXFLAGS))
  427. PGO_BUILD_TRAINING_FLAGS_TO_PASS = \
  428. PGO_BUILD_TRAINING=yes \
  429. CFLAGS_FOR_TARGET="$(PGO_BUILD_TRAINING_CFLAGS)" \
  430. CXXFLAGS_FOR_TARGET="$(PGO_BUILD_TRAINING_CXXFLAGS)"
  431. # Ignore "make check" errors in PGO training runs.
  432. PGO_BUILD_TRAINING_MFLAGS = -i
  433. # Additional PGO and LTO compiler options to use profiling data for the
  434. # PGO build.
  435. PGO_BUILD_USE_FLAGS_TO_PASS = \
  436. PGO_BUILD_CFLAGS="@PGO_BUILD_USE_CFLAGS@" \
  437. PGO_BUILD_LTO_CFLAGS="@PGO_BUILD_LTO_CFLAGS@"
  438. # PGO training targets for the PGO build. FIXME: Add gold tests to
  439. # training.
  440. PGO-TRAINING-TARGETS = binutils gas gdb ld sim
  441. PGO_BUILD_TRAINING = $(addprefix maybe-check-,$(PGO-TRAINING-TARGETS))
  442. CREATE_GCOV = create_gcov
  443. TFLAGS =
  444. # Defaults for all stages; some are overridden below.
  445. STAGE_CFLAGS = $(BOOT_CFLAGS)
  446. STAGE_TFLAGS = $(TFLAGS)
  447. STAGE_CONFIGURE_FLAGS=@stage2_werror_flag@
  448. [+ FOR bootstrap-stage +]
  449. # Defaults for stage [+id+]; some are overridden below.
  450. STAGE[+id+]_CFLAGS = $(STAGE_CFLAGS)
  451. STAGE[+id+]_CXXFLAGS = $(CXXFLAGS)
  452. @if target-libstdc++-v3-bootstrap
  453. # Override the above if we're bootstrapping C++.
  454. STAGE[+id+]_CXXFLAGS = $(STAGE[+id+]_CFLAGS)
  455. @endif target-libstdc++-v3-bootstrap
  456. STAGE[+id+]_TFLAGS = $(STAGE_TFLAGS)
  457. STAGE[+id+]_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
  458. [+ ENDFOR bootstrap-stage +]
  459. # By default, C and C++ are the only stage1 languages, because they are the
  460. # only ones we require to build with the bootstrap compiler, and also the
  461. # only ones useful for building stage2.
  462. STAGE1_CFLAGS = @stage1_cflags@
  463. STAGE1_CHECKING = @stage1_checking@
  464. STAGE1_LANGUAGES = @stage1_languages@
  465. # * We force-disable intermodule optimizations, even if
  466. # --enable-intermodule was passed, since the installed compiler
  467. # probably can't handle them. Luckily, autoconf always respects
  468. # the last argument when conflicting --enable arguments are passed.
  469. # * Likewise, we force-disable coverage flags, since the installed
  470. # compiler probably has never heard of them.
  471. # * We also disable -Wformat, since older GCCs don't understand newer %s.
  472. STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
  473. --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
  474. --disable-build-format-warnings
  475. # When using the slow stage1 compiler disable IL verification and forcefully
  476. # enable it when using the stage2 compiler instead. As we later compare
  477. # stage2 and stage3 we are merely avoid doing redundant work, plus we apply
  478. # checking when building all target libraries for release builds.
  479. STAGE1_TFLAGS += -fno-checking
  480. STAGE2_CFLAGS += -fno-checking
  481. STAGE2_TFLAGS += -fno-checking
  482. STAGE3_CFLAGS += -fchecking=1
  483. STAGE3_TFLAGS += -fchecking=1
  484. STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
  485. STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
  486. STAGEtrain_CFLAGS = $(filter-out -fchecking=1,$(STAGE3_CFLAGS))
  487. STAGEtrain_TFLAGS = $(filter-out -fchecking=1,$(STAGE3_TFLAGS))
  488. STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use -fprofile-reproducible=parallel-runs
  489. STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
  490. STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
  491. STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)
  492. STAGEautofeedback_CFLAGS = $(STAGE3_CFLAGS)
  493. STAGEautofeedback_TFLAGS = $(STAGE3_TFLAGS)
  494. do-compare = @do_compare@
  495. do-compare3 = $(do-compare)
  496. # -----------------------------------------------
  497. # Programs producing files for the TARGET machine
  498. # -----------------------------------------------
  499. AR_FOR_TARGET=@AR_FOR_TARGET@
  500. AS_FOR_TARGET=@AS_FOR_TARGET@
  501. CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@
  502. # If GCC_FOR_TARGET is not overriden on the command line, then this
  503. # variable is passed down to the gcc Makefile, where it is used to
  504. # build libgcc2.a. We define it here so that it can itself be
  505. # overridden on the command line.
  506. GCC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCC_FOR_TARGET@
  507. CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@
  508. RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@
  509. GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@
  510. GOC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GOC_FOR_TARGET@
  511. GDC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GDC_FOR_TARGET@
  512. DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
  513. DSYMUTIL_FOR_TARGET=@DSYMUTIL_FOR_TARGET@
  514. LD_FOR_TARGET=@LD_FOR_TARGET@
  515. LIPO_FOR_TARGET=@LIPO_FOR_TARGET@
  516. NM_FOR_TARGET=@NM_FOR_TARGET@
  517. OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@
  518. OBJCOPY_FOR_TARGET=@OBJCOPY_FOR_TARGET@
  519. OTOOL_FOR_TARGET=@OTOOL_FOR_TARGET@
  520. RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
  521. READELF_FOR_TARGET=@READELF_FOR_TARGET@
  522. STRIP_FOR_TARGET=@STRIP_FOR_TARGET@
  523. WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
  524. WINDMC_FOR_TARGET=@WINDMC_FOR_TARGET@
  525. COMPILER_AS_FOR_TARGET=@COMPILER_AS_FOR_TARGET@
  526. COMPILER_LD_FOR_TARGET=@COMPILER_LD_FOR_TARGET@
  527. COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_TARGET@
  528. CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@
  529. CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@
  530. LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
  531. LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
  532. LDFLAGS_FOR_TARGET = @LDFLAGS_FOR_TARGET@
  533. GOCFLAGS_FOR_TARGET = -O2 -g
  534. GDCFLAGS_FOR_TARGET = -O2 -g
  535. FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
  536. SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
  537. DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@
  538. XGCC_FLAGS_FOR_TARGET = $(FLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)
  539. # ------------------------------------
  540. # Miscellaneous targets and flag lists
  541. # ------------------------------------
  542. # The first rule in the file had better be this one. Don't put any above it.
  543. # This lives here to allow makefile fragments to contain dependencies.
  544. all:
  545. #### host and target specific makefile fragments come in here.
  546. @target_makefile_frag@
  547. @alphaieee_frag@
  548. @ospace_frag@
  549. @host_makefile_frag@
  550. ###
  551. # This is the list of directories that may be needed in RPATH_ENVVAR
  552. # so that programs built for the target machine work.
  553. TARGET_LIB_PATH = [+ FOR target_modules +][+
  554. IF lib_path +]$(TARGET_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
  555. ENDFOR target_modules +]$(HOST_LIB_PATH_gcc)
  556. [+ FOR target_modules +][+ IF lib_path +]
  557. @if target-[+module+]
  558. TARGET_LIB_PATH_[+module+] = $$r/$(TARGET_SUBDIR)/[+module+]/[+lib_path+]:
  559. @endif target-[+module+]
  560. [+ ENDIF lib_path +][+ ENDFOR target_modules +]
  561. # This is the list of directories that may be needed in RPATH_ENVVAR
  562. # so that programs built for the host machine work.
  563. HOST_LIB_PATH = [+ FOR host_modules +][+
  564. IF lib_path +]$(HOST_LIB_PATH_[+module+])[+ ENDIF lib_path +][+
  565. ENDFOR host_modules +]
  566. # Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
  567. @if gcc
  568. HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc$(GCC_SHLIB_SUBDIR):$$r/$(HOST_SUBDIR)/prev-gcc$(GCC_SHLIB_SUBDIR):
  569. @endif gcc
  570. [+ FOR host_modules +][+ IF lib_path +]
  571. @if [+module+]
  572. HOST_LIB_PATH_[+module+] = \
  573. $$r/$(HOST_SUBDIR)/[+module+]/[+lib_path+]:[+ IF bootstrap
  574. +]$$r/$(HOST_SUBDIR)/prev-[+module+]/[+lib_path+]:[+ ENDIF bootstrap +]
  575. @endif [+module+]
  576. [+ ENDIF lib_path +][+ ENDFOR host_modules +]
  577. CXX_FOR_TARGET_FLAG_TO_PASS = \
  578. "CXX_FOR_TARGET=$(CXX_FOR_TARGET)"
  579. @if target-libstdc++-v3
  580. # CXX_FOR_TARGET is tricky to get right for target libs that require a
  581. # functional C++ compiler. When we recurse, if we expand
  582. # CXX_FOR_TARGET before configuring libstdc++-v3, we won't get
  583. # libstdc++ include flags from the script. Instead, we get an
  584. # -funconfigured-* word, so that we'll get errors if this invalid C++
  585. # command line is used for anything, but also so that we can use the
  586. # word to decide whether or not to pass on this CXX_FOR_TARGET. If we
  587. # don't pass it on, sub-make will use the default definition, that
  588. # re-expands it at the time of use, so we'll get it right when we need
  589. # it. One potential exception is the expansion of CXX_FOR_TARGET
  590. # passed down as part of CXX within TARGET_FLAGS, but this wouldn't
  591. # really work, for C++ host programs can't depend on the current-stage
  592. # C++ target library.
  593. CXX_FOR_TARGET_FLAG_TO_PASS = \
  594. $(shell if echo "$(CXX_FOR_TARGET)" | grep " -funconfigured-" > /dev/null; then :; else echo '"CXX_FOR_TARGET=$(CXX_FOR_TARGET)"'; fi)
  595. @endif target-libstdc++-v3
  596. # Flags to pass down to all sub-makes. STAGE*FLAGS,
  597. # MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
  598. # overrideable (for a bootstrap build stage1 also builds gcc.info).
  599. BASE_FLAGS_TO_PASS =[+ FOR flags_to_pass +][+ IF optional +] \
  600. "`echo '[+flag+]=$([+flag+])' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"[+ ELSE optional +] \
  601. "[+flag+]=$([+flag+])"[+ ENDIF optional+][+ ENDFOR flags_to_pass +][+ FOR bootstrap-stage +] \
  602. "STAGE[+id+]_CFLAGS=$(STAGE[+id+]_CFLAGS)" \
  603. "STAGE[+id+]_CXXFLAGS=$(STAGE[+id+]_CXXFLAGS)" \
  604. "STAGE[+id+]_GENERATOR_CFLAGS=$(STAGE[+id+]_GENERATOR_CFLAGS)" \
  605. "STAGE[+id+]_TFLAGS=$(STAGE[+id+]_TFLAGS)"[+ ENDFOR bootstrap-stage +] \
  606. $(CXX_FOR_TARGET_FLAG_TO_PASS) \
  607. "TFLAGS=$(TFLAGS)" \
  608. "CONFIG_SHELL=$(SHELL)" \
  609. "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
  610. $(if $(LSAN_OPTIONS),"LSAN_OPTIONS=$(LSAN_OPTIONS)")
  611. # We leave this in just in case, but it is not needed anymore.
  612. RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS)
  613. # Flags to pass down to most sub-makes, in which we're building with
  614. # the host environment.
  615. EXTRA_HOST_FLAGS = \
  616. 'AR=$(AR)' \
  617. 'AS=$(AS)' \
  618. 'CC=$(CC)' \
  619. 'CXX=$(CXX)' \
  620. 'DLLTOOL=$(DLLTOOL)' \
  621. 'DSYMUTIL=$(DSYMUTIL)' \
  622. 'GFORTRAN=$(GFORTRAN)' \
  623. 'GOC=$(GOC)' \
  624. 'GDC=$(GDC)' \
  625. 'LD=$(LD)' \
  626. 'LIPO=$(LIPO)' \
  627. 'NM=$(NM)' \
  628. 'OBJDUMP=$(OBJDUMP)' \
  629. 'OTOOL=$(OTOOL)' \
  630. 'RANLIB=$(RANLIB)' \
  631. 'READELF=$(READELF)' \
  632. 'STRIP=$(STRIP)' \
  633. 'WINDRES=$(WINDRES)' \
  634. 'WINDMC=$(WINDMC)' \
  635. 'CREATE_GCOV=$(CREATE_GCOV)'
  636. FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)
  637. # Flags to pass to stage1 or when not bootstrapping.
  638. STAGE1_FLAGS_TO_PASS = \
  639. LDFLAGS="$${LDFLAGS}" \
  640. HOST_LIBS="$${HOST_LIBS}"
  641. # Flags to pass to stage2 and later makes.
  642. POSTSTAGE1_FLAGS_TO_PASS = \
  643. CC="$${CC}" CC_FOR_BUILD="$${CC_FOR_BUILD}" \
  644. CXX="$${CXX}" CXX_FOR_BUILD="$${CXX_FOR_BUILD}" \
  645. GDC="$${GDC}" GDC_FOR_BUILD="$${GDC_FOR_BUILD}" \
  646. GNATBIND="$${GNATBIND}" \
  647. LDFLAGS="$${LDFLAGS}" \
  648. HOST_LIBS="$${HOST_LIBS}" \
  649. $(LTO_FLAGS_TO_PASS) \
  650. "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
  651. @if gcc-bootstrap
  652. EXTRA_HOST_EXPORTS = if [ $(current_stage) != stage1 ]; then \
  653. $(POSTSTAGE1_HOST_EXPORTS) \
  654. fi;
  655. EXTRA_BOOTSTRAP_FLAGS = CC="$$CC" CXX="$$CXX" LDFLAGS="$$LDFLAGS"
  656. @endif gcc-bootstrap
  657. # Flags to pass down to makes which are built with the target environment.
  658. # The double $ decreases the length of the command line; those variables
  659. # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. The
  660. # *_CFLAGS_FOR_TARGET variables are not passed down and most often empty,
  661. # so we expand them here.
  662. EXTRA_TARGET_FLAGS = \
  663. 'AR=$$(AR_FOR_TARGET)' \
  664. 'AS=$(COMPILER_AS_FOR_TARGET)' \
  665. 'CC=$$(CC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
  666. 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
  667. 'CXX=$$(CXX_FOR_TARGET) -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/src/.libs \
  668. -B$$r/$$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs \
  669. $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
  670. 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
  671. 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
  672. 'DSYMUTIL=$$(DSYMUTIL_FOR_TARGET)' \
  673. 'GFORTRAN=$$(GFORTRAN_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
  674. 'GOC=$$(GOC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
  675. 'GOCFLAGS=$$(GOCFLAGS_FOR_TARGET)' \
  676. 'GDC=$$(GDC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
  677. 'GDCFLAGS=$$(GDCFLAGS_FOR_TARGET)' \
  678. 'LD=$(COMPILER_LD_FOR_TARGET)' \
  679. 'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \
  680. 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
  681. 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
  682. 'NM=$(COMPILER_NM_FOR_TARGET)' \
  683. 'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \
  684. 'OBJCOPY=$$(OBJCOPY_FOR_TARGET)' \
  685. 'RANLIB=$$(RANLIB_FOR_TARGET)' \
  686. 'READELF=$$(READELF_FOR_TARGET)' \
  687. 'WINDRES=$$(WINDRES_FOR_TARGET)' \
  688. 'WINDMC=$$(WINDMC_FOR_TARGET)' \
  689. 'XGCC_FLAGS_FOR_TARGET=$(XGCC_FLAGS_FOR_TARGET)' \
  690. 'STAGE1_LDFLAGS=$$(POSTSTAGE1_LDFLAGS)' \
  691. 'STAGE1_LIBS=$$(POSTSTAGE1_LIBS)' \
  692. "TFLAGS=$$TFLAGS"
  693. TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
  694. # Flags to pass down to gcc. gcc builds a library, libgcc.a, so it
  695. # unfortunately needs the native compiler and the target ar and
  696. # ranlib.
  697. # If any variables are added here, they must be added to do-*, below.
  698. # The BUILD_* variables are a special case, which are used for the gcc
  699. # cross-building scheme.
  700. EXTRA_GCC_FLAGS = \
  701. "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
  702. "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
  703. "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
  704. GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
  705. @if gcc
  706. BUILD_CONFIG = @BUILD_CONFIG@
  707. ifneq ($(BUILD_CONFIG),)
  708. include $(foreach CONFIG, $(BUILD_CONFIG), $(srcdir)/config/$(CONFIG).mk)
  709. endif
  710. @endif gcc
  711. .PHONY: configure-host
  712. configure-host: [+
  713. FOR host_modules +] \
  714. maybe-configure-[+module+][+
  715. ENDFOR host_modules +]
  716. .PHONY: configure-target
  717. configure-target: [+
  718. FOR target_modules +] \
  719. maybe-configure-target-[+module+][+
  720. ENDFOR target_modules +]
  721. # The target built for a native non-bootstrap build.
  722. .PHONY: all
  723. # --enable-pgo-build enables the PGO build.
  724. # 1. First build with -fprofile-generate.
  725. # 2. Use "make maybe-check-*" to generate profiling data.
  726. # 3. Use "make clean" to remove the previous build.
  727. # 4. Rebuild with -fprofile-use.
  728. all:
  729. @if gcc-bootstrap
  730. [ -f stage_final ] || echo stage3 > stage_final
  731. @r=`${PWD_COMMAND}`; export r; \
  732. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  733. $(MAKE) $(RECURSE_FLAGS_TO_PASS) `cat stage_final`-bubble
  734. @endif gcc-bootstrap
  735. @: $(MAKE); $(unstage)
  736. +@r=`${PWD_COMMAND}`; export r; \
  737. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  738. @if gcc-bootstrap
  739. if [ -f stage_last ]; then \
  740. TFLAGS="$(STAGE$(shell test ! -f stage_last || sed s,^stage,, stage_last)_TFLAGS)"; \
  741. $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \
  742. else \
  743. @endif gcc-bootstrap
  744. $(MAKE) $(RECURSE_FLAGS_TO_PASS) \
  745. $(PGO_BUILD_GEN_FLAGS_TO_PASS) all-host all-target \
  746. @if pgo-build
  747. && $(MAKE) $(RECURSE_FLAGS_TO_PASS) \
  748. $(PGO_BUILD_TRAINING_MFLAGS) \
  749. $(PGO_BUILD_TRAINING_FLAGS_TO_PASS) \
  750. $(PGO_BUILD_TRAINING) \
  751. && $(MAKE) $(RECURSE_FLAGS_TO_PASS) clean \
  752. && $(MAKE) $(RECURSE_FLAGS_TO_PASS) \
  753. $(PGO_BUILD_USE_FLAGS_TO_PASS) all-host all-target \
  754. @endif pgo-build
  755. @if gcc-bootstrap
  756. ; \
  757. fi \
  758. @endif gcc-bootstrap
  759. && :
  760. .PHONY: all-build
  761. [+ FOR build_modules +]
  762. all-build: maybe-all-build-[+module+][+ ENDFOR build_modules +]
  763. .PHONY: all-host
  764. [+ FOR host_modules +][+ IF bootstrap +]
  765. @if [+module+]-no-bootstrap[+ ENDIF bootstrap +]
  766. all-host: maybe-all-[+module+][+ IF bootstrap +]
  767. @endif [+module+]-no-bootstrap[+ ENDIF bootstrap +][+ ENDFOR host_modules +]
  768. .PHONY: all-target
  769. [+ FOR target_modules +][+ IF bootstrap +]
  770. @if target-[+module+]-no-bootstrap[+ ENDIF bootstrap +]
  771. all-target: maybe-all-target-[+module+][+ IF bootstrap +]
  772. @endif target-[+module+]-no-bootstrap[+
  773. ENDIF bootstrap +][+ ENDFOR target_modules +]
  774. # Do a target for all the subdirectories. A ``make do-X'' will do a
  775. # ``make X'' in all subdirectories (because, in general, there is a
  776. # dependency (below) of X upon do-X, a ``make X'' will also do this,
  777. # but it may do additional work as well).
  778. [+ FOR recursive_targets +]
  779. .PHONY: do-[+make_target+]
  780. do-[+make_target+]:
  781. @: $(MAKE); $(unstage)
  782. @r=`${PWD_COMMAND}`; export r; \
  783. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  784. $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+make_target+]-host \
  785. [+make_target+]-target
  786. .PHONY: [+make_target+]-host
  787. [+ FOR host_modules +]
  788. [+make_target+]-host: maybe-[+make_target+]-[+module+][+ ENDFOR host_modules +]
  789. .PHONY: [+make_target+]-target
  790. [+ FOR target_modules +]
  791. [+make_target+]-target: maybe-[+make_target+]-target-[+module+][+ ENDFOR target_modules +]
  792. [+ ENDFOR recursive_targets +]
  793. # Here are the targets which correspond to the do-X targets.
  794. .PHONY: info installcheck dvi pdf html
  795. .PHONY: install-info install-dvi install-pdf install-html
  796. .PHONY: clean distclean mostlyclean maintainer-clean realclean
  797. .PHONY: local-clean local-distclean local-maintainer-clean
  798. info: do-info
  799. installcheck: do-installcheck
  800. dvi: do-dvi
  801. pdf: do-pdf
  802. html: do-html
  803. # Make sure makeinfo is built before we do a `make info', if we're
  804. # in fact building texinfo.
  805. do-info: maybe-all-texinfo
  806. install-info: do-install-info dir.info
  807. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  808. if [ -f dir.info ]; then \
  809. $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info; \
  810. else true; fi
  811. install-dvi: do-install-dvi
  812. install-pdf: do-install-pdf
  813. install-html: do-install-html
  814. local-clean:
  815. -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log
  816. local-distclean:
  817. -rm -f Makefile config.status config.cache mh-frag mt-frag
  818. -rm -f maybedep.tmp serdep.tmp stage_final
  819. -if [ "$(TARGET_SUBDIR)" != "." ]; then \
  820. rm -rf $(TARGET_SUBDIR); \
  821. else true; fi
  822. -rm -rf $(BUILD_SUBDIR)
  823. -if [ "$(HOST_SUBDIR)" != "." ]; then \
  824. rm -rf $(HOST_SUBDIR); \
  825. else true; fi
  826. -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile
  827. -rm -f texinfo/doc/Makefile texinfo/po/POTFILES
  828. -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null
  829. -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null
  830. -rmdir c++tools fastjar gcc gnattools gotools 2>/dev/null
  831. -rmdir libcc1 libiberty texinfo zlib 2>/dev/null
  832. -find . -name config.cache -exec rm -f {} \; \; 2>/dev/null
  833. local-maintainer-clean:
  834. @echo "This command is intended for maintainers to use;"
  835. @echo "it deletes files that may require special tools to rebuild."
  836. clean: do-clean local-clean
  837. mostlyclean: do-mostlyclean local-clean
  838. distclean: do-distclean local-clean local-distclean
  839. maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
  840. maintainer-clean: local-distclean
  841. realclean: maintainer-clean
  842. # Check target.
  843. .PHONY: check do-check
  844. check: do-check
  845. # Only include modules actually being configured and built.
  846. .PHONY: check-host
  847. check-host: [+
  848. FOR host_modules +] \
  849. maybe-check-[+module+][+
  850. ENDFOR host_modules +]
  851. .PHONY: check-target
  852. check-target: [+
  853. FOR target_modules +] \
  854. maybe-check-target-[+module+][+
  855. ENDFOR target_modules +]
  856. do-check:
  857. @: $(MAKE); $(unstage)
  858. @r=`${PWD_COMMAND}`; export r; \
  859. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  860. $(MAKE) $(RECURSE_FLAGS_TO_PASS) check-host check-target
  861. # Automated reporting of test results.
  862. warning.log: build.log
  863. $(srcdir)/contrib/warn_summary build.log > $@
  864. mail-report.log:
  865. if test x'$(BOOT_CFLAGS)' != x''; then \
  866. BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
  867. fi; \
  868. $(srcdir)/contrib/test_summary -t >$@
  869. chmod +x $@
  870. echo If you really want to send e-mail, run ./$@ now
  871. mail-report-with-warnings.log: warning.log
  872. if test x'$(BOOT_CFLAGS)' != x''; then \
  873. BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \
  874. fi; \
  875. $(srcdir)/contrib/test_summary -t -i warning.log >$@
  876. chmod +x $@
  877. echo If you really want to send e-mail, run ./$@ now
  878. # Local Vim config
  879. $(srcdir)/.local.vimrc:
  880. $(LN_S) contrib/vimrc $@
  881. $(srcdir)/.lvimrc:
  882. $(LN_S) contrib/vimrc $@
  883. vimrc: $(srcdir)/.local.vimrc $(srcdir)/.lvimrc
  884. .PHONY: vimrc
  885. # clang-format config
  886. $(srcdir)/.clang-format:
  887. $(LN_S) contrib/clang-format $@
  888. clang-format: $(srcdir)/.clang-format
  889. .PHONY: clang-format
  890. # Installation targets.
  891. .PHONY: install uninstall
  892. install:
  893. @: $(MAKE); $(unstage)
  894. @r=`${PWD_COMMAND}`; export r; \
  895. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  896. $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-host install-target
  897. .PHONY: install-host-nogcc
  898. install-host-nogcc: [+
  899. FOR host_modules +][+ IF (not (= (get "module") "gcc")) +] \
  900. maybe-install-[+module+][+ ENDIF +][+
  901. ENDFOR host_modules +]
  902. .PHONY: install-host
  903. install-host: [+
  904. FOR host_modules +] \
  905. maybe-install-[+module+][+
  906. ENDFOR host_modules +]
  907. .PHONY: install-target
  908. install-target: [+
  909. FOR target_modules +] \
  910. maybe-install-target-[+module+][+
  911. ENDFOR target_modules +]
  912. uninstall:
  913. @echo "the uninstall target is not supported in this tree"
  914. .PHONY: install.all
  915. install.all: install-no-fixedincludes
  916. @if [ -f ./gcc/Makefile ]; then \
  917. r=`${PWD_COMMAND}`; export r; \
  918. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  919. $(HOST_EXPORTS) \
  920. (cd ./gcc && \
  921. $(MAKE) $(FLAGS_TO_PASS) install-headers); \
  922. else \
  923. true; \
  924. fi
  925. # install-no-fixedincludes is used to allow the elaboration of binary packages
  926. # suitable for distribution, where we cannot include the fixed system header
  927. # files.
  928. .PHONY: install-no-fixedincludes
  929. install-no-fixedincludes: installdirs install-host-nogcc \
  930. install-target gcc-install-no-fixedincludes
  931. .PHONY: install-strip
  932. install-strip:
  933. @: $(MAKE); $(unstage)
  934. @r=`${PWD_COMMAND}`; export r; \
  935. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  936. $(MAKE) $(RECURSE_FLAGS_TO_PASS) installdirs install-strip-host install-strip-target
  937. .PHONY: install-strip-host
  938. install-strip-host: [+
  939. FOR host_modules +] \
  940. maybe-install-strip-[+module+][+
  941. ENDFOR host_modules +]
  942. .PHONY: install-strip-target
  943. install-strip-target: [+
  944. FOR target_modules +] \
  945. maybe-install-strip-target-[+module+][+
  946. ENDFOR target_modules +]
  947. ### other supporting targets
  948. MAKEDIRS= \
  949. $(DESTDIR)$(prefix) \
  950. $(DESTDIR)$(exec_prefix)
  951. .PHONY: installdirs
  952. installdirs: mkinstalldirs
  953. $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS)
  954. dir.info: do-install-info
  955. if [ -f $(srcdir)/texinfo/gen-info-dir ]; then \
  956. $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new; \
  957. mv -f dir.info.new dir.info; \
  958. else true; \
  959. fi
  960. dist:
  961. @echo "Building a full distribution of this tree isn't done"
  962. @echo "via 'make dist'. Check out the etc/ subdirectory"
  963. etags tags: TAGS
  964. # Right now this just builds TAGS in each subdirectory. emacs19 has the
  965. # ability to use several tags files at once, so there is probably no need
  966. # to combine them into one big TAGS file (like CVS 1.3 does). We could
  967. # (if we felt like it) have this Makefile write a piece of elisp which
  968. # the user could load to tell emacs19 where all the TAGS files we just
  969. # built are.
  970. TAGS: do-TAGS
  971. # ------------------------------------
  972. # Macros for configure and all targets
  973. # ------------------------------------
  974. [+ DEFINE configure +]
  975. .PHONY: configure-[+prefix+][+module+] maybe-configure-[+prefix+][+module+]
  976. maybe-configure-[+prefix+][+module+]:
  977. @if gcc-bootstrap
  978. configure-[+prefix+][+module+]: stage_current
  979. @endif gcc-bootstrap
  980. @if [+prefix+][+module+]
  981. maybe-configure-[+prefix+][+module+]: configure-[+prefix+][+module+]
  982. configure-[+prefix+][+module+]: [+ IF bootstrap +][+ ELSE +]
  983. @: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
  984. @r=`${PWD_COMMAND}`; export r; \
  985. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  986. [+ IF check_multilibs
  987. +]echo "Checking multilib configuration for [+module+]..."; \
  988. $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]; \
  989. $(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null; \
  990. if test -r [+subdir+]/[+module+]/multilib.out; then \
  991. if cmp -s [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; then \
  992. rm -f [+subdir+]/[+module+]/multilib.tmp; \
  993. else \
  994. rm -f [+subdir+]/[+module+]/Makefile; \
  995. mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
  996. fi; \
  997. else \
  998. mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
  999. fi; \
  1000. [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
  1001. $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]; \
  1002. [+exports+] [+extra_exports+] \
  1003. echo Configuring in [+subdir+]/[+module+]; \
  1004. cd "[+subdir+]/[+module+]" || exit 1; \
  1005. case $(srcdir) in \
  1006. /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
  1007. *) topdir=`echo [+subdir+]/[+module+]/ | \
  1008. sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
  1009. esac; \
  1010. module_srcdir=[+? module_srcdir (get "module_srcdir") (get "module")+]; \
  1011. [+ IF no-config-site +]rm -f no-such-file || : ; \
  1012. CONFIG_SITE=no-such-file [+ ENDIF +]$(SHELL) \
  1013. $$s/$$module_srcdir/configure \
  1014. --srcdir=$${topdir}/$$module_srcdir \
  1015. [+args+] --build=${build_alias} --host=[+host_alias+] \
  1016. --target=[+target_alias+] [+extra_configure_flags+] \
  1017. || exit 1
  1018. @endif [+prefix+][+module+]
  1019. [+ IF bootstrap +]
  1020. [+ FOR bootstrap_stage +]
  1021. .PHONY: configure-stage[+id+]-[+prefix+][+module+] maybe-configure-stage[+id+]-[+prefix+][+module+]
  1022. maybe-configure-stage[+id+]-[+prefix+][+module+]:
  1023. @if [+prefix+][+module+]-bootstrap
  1024. maybe-configure-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
  1025. configure-stage[+id+]-[+prefix+][+module+]:
  1026. @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start
  1027. @$(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]
  1028. @r=`${PWD_COMMAND}`; export r; \
  1029. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1030. TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
  1031. [+ IF check_multilibs
  1032. +]echo "Checking multilib configuration for [+module+]..."; \
  1033. $(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null; \
  1034. if test -r [+subdir+]/[+module+]/multilib.out; then \
  1035. if cmp -s [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; then \
  1036. rm -f [+subdir+]/[+module+]/multilib.tmp; \
  1037. else \
  1038. rm -f [+subdir+]/[+module+]/Makefile; \
  1039. mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
  1040. fi; \
  1041. else \
  1042. mv [+subdir+]/[+module+]/multilib.tmp [+subdir+]/[+module+]/multilib.out; \
  1043. fi; \
  1044. [+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
  1045. [+exports+][+ IF prev +] \
  1046. [+poststage1_exports+][+ ENDIF prev +][+ IF prefix +] \
  1047. CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
  1048. CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
  1049. LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS;[+ ELSE prefix +] \
  1050. CFLAGS="$(STAGE[+id+]_CFLAGS)"; export CFLAGS; \
  1051. CXXFLAGS="$(STAGE[+id+]_CXXFLAGS)"; export CXXFLAGS;[+ IF prev +] \
  1052. LIBCFLAGS="$(STAGE[+id+]_CFLAGS)"[+ ELSE prev +] \
  1053. LIBCFLAGS="$(LIBCFLAGS)"[+ ENDIF prev +]; export LIBCFLAGS;[+
  1054. ENDIF prefix +] [+extra_exports+] \
  1055. echo Configuring stage [+id+] in [+subdir+]/[+module+]; \
  1056. $(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]; \
  1057. cd [+subdir+]/[+module+] || exit 1; \
  1058. case $(srcdir) in \
  1059. /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
  1060. *) topdir=`echo [+subdir+]/[+module+]/ | \
  1061. sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
  1062. esac; \
  1063. module_srcdir=[+? module_srcdir (get "module_srcdir") (get "module")+]; \
  1064. $(SHELL) $$s/$$module_srcdir/configure \
  1065. --srcdir=$${topdir}/$$module_srcdir \
  1066. [+args+] --build=${build_alias} --host=[+host_alias+] \
  1067. --target=[+target_alias+] \
  1068. [+ IF prev +]--with-build-libsubdir=$(HOST_SUBDIR)[+ ENDIF prev +] \
  1069. $(STAGE[+id+]_CONFIGURE_FLAGS)[+ IF extra_configure_flags +] \
  1070. [+extra_configure_flags+][+ ENDIF extra_configure_flags +]
  1071. @endif [+prefix+][+module+]-bootstrap
  1072. [+ ENDFOR bootstrap_stage +]
  1073. [+ ENDIF bootstrap +]
  1074. [+ ENDDEF +]
  1075. [+ DEFINE all +]
  1076. .PHONY: all-[+prefix+][+module+] maybe-all-[+prefix+][+module+]
  1077. maybe-all-[+prefix+][+module+]:
  1078. @if gcc-bootstrap
  1079. all-[+prefix+][+module+]: stage_current
  1080. @endif gcc-bootstrap
  1081. @if [+prefix+][+module+]
  1082. TARGET-[+prefix+][+module+]=[+
  1083. IF all_target +][+all_target+][+ ELSE +]all[+ ENDIF all_target +]
  1084. maybe-all-[+prefix+][+module+]: all-[+prefix+][+module+]
  1085. all-[+prefix+][+module+]: configure-[+prefix+][+module+][+ IF bootstrap +][+ ELSE +]
  1086. @: $(MAKE); $(unstage)[+ ENDIF bootstrap +]
  1087. @r=`${PWD_COMMAND}`; export r; \
  1088. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1089. [+exports+] [+extra_exports+] \
  1090. (cd [+subdir+]/[+module+] && \
  1091. $(MAKE) $(BASE_FLAGS_TO_PASS) [+args+] [+stage1_args+] [+extra_make_flags+] \
  1092. $(TARGET-[+prefix+][+module+]))
  1093. @endif [+prefix+][+module+]
  1094. [+ IF bootstrap +]
  1095. [+ FOR bootstrap_stage +]
  1096. .PHONY: all-stage[+id+]-[+prefix+][+module+] maybe-all-stage[+id+]-[+prefix+][+module+]
  1097. .PHONY: clean-stage[+id+]-[+prefix+][+module+] maybe-clean-stage[+id+]-[+prefix+][+module+]
  1098. maybe-all-stage[+id+]-[+prefix+][+module+]:
  1099. maybe-clean-stage[+id+]-[+prefix+][+module+]:
  1100. @if [+prefix+][+module+]-bootstrap
  1101. maybe-all-stage[+id+]-[+prefix+][+module+]: all-stage[+id+]-[+prefix+][+module+]
  1102. all-stage[+id+]: all-stage[+id+]-[+prefix+][+module+]
  1103. TARGET-stage[+id+]-[+prefix+][+module+] = $(TARGET-[+prefix+][+module+])
  1104. all-stage[+id+]-[+prefix+][+module+]: configure-stage[+id+]-[+prefix+][+module+]
  1105. @[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start
  1106. @r=`${PWD_COMMAND}`; export r; \
  1107. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1108. TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
  1109. [+exports+][+ IF prev +] \
  1110. [+poststage1_exports+][+ ENDIF prev +] [+extra_exports+] \
  1111. cd [+subdir+]/[+module+] && \
  1112. [+autoprofile+] \
  1113. $(MAKE) $(BASE_FLAGS_TO_PASS)[+ IF prefix +] \
  1114. CFLAGS="$(CFLAGS_FOR_TARGET)" \
  1115. CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
  1116. LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"[+ ELSE prefix +] \
  1117. CFLAGS="$(STAGE[+id+]_CFLAGS)" \
  1118. GENERATOR_CFLAGS="$(STAGE[+id+]_GENERATOR_CFLAGS)" \
  1119. CXXFLAGS="$(STAGE[+id+]_CXXFLAGS)"[+ IF prev +] \
  1120. LIBCFLAGS="$(STAGE[+id+]_CFLAGS)"[+ ELSE prev +] \
  1121. LIBCFLAGS="$(LIBCFLAGS)"[+ ENDIF prev +][+ ENDIF prefix +] \
  1122. CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
  1123. CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
  1124. LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
  1125. [+args+] [+IF prev +][+poststage1_args+][+ ELSE prev +] \
  1126. [+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] \
  1127. TFLAGS="$(STAGE[+id+]_TFLAGS)" [+profile_data+] \
  1128. $(TARGET-stage[+id+]-[+prefix+][+module+])
  1129. maybe-clean-stage[+id+]-[+prefix+][+module+]: clean-stage[+id+]-[+prefix+][+module+]
  1130. clean-stage[+id+]: clean-stage[+id+]-[+prefix+][+module+]
  1131. clean-stage[+id+]-[+prefix+][+module+]:
  1132. @if [ $(current_stage) = stage[+id+] ]; then \
  1133. [ -f [+subdir+]/[+module+]/Makefile ] || exit 0; \
  1134. else \
  1135. [ -f [+subdir+]/stage[+id+]-[+module+]/Makefile ] || exit 0; \
  1136. $(MAKE) stage[+id+]-start; \
  1137. fi; \
  1138. cd [+subdir+]/[+module+] && \
  1139. $(MAKE) [+args+] [+ IF prev +][+poststage1_args+][+ ELSE prev +] \
  1140. [+stage1_args+][+ ENDIF prev +] [+extra_make_flags+] clean
  1141. @endif [+prefix+][+module+]-bootstrap
  1142. [+ ENDFOR bootstrap_stage +]
  1143. [+ ENDIF bootstrap +]
  1144. [+ ENDDEF +]
  1145. # --------------------------------------
  1146. # Modules which run on the build machine
  1147. # --------------------------------------
  1148. [+ FOR build_modules +]
  1149. [+ configure prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)"
  1150. host_alias=(get "host" "${build_alias}")
  1151. target_alias=(get "target" "${target_alias}")
  1152. args="$(BUILD_CONFIGARGS)" no-config-site=true +]
  1153. [+ all prefix="build-" subdir="$(BUILD_SUBDIR)" exports="$(BUILD_EXPORTS)"
  1154. args="$(EXTRA_BUILD_FLAGS)" +]
  1155. [+ ENDFOR build_module +]
  1156. # --------------------------------------
  1157. # Modules which run on the host machine
  1158. # --------------------------------------
  1159. [+ FOR host_modules +]
  1160. [+ configure prefix="" subdir="$(HOST_SUBDIR)"
  1161. exports="$(HOST_EXPORTS)"
  1162. poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
  1163. host_alias=(get "host" "${host_alias}")
  1164. target_alias=(get "target" "${target_alias}")
  1165. args="$(HOST_CONFIGARGS)" +]
  1166. [+ all prefix="" subdir="$(HOST_SUBDIR)"
  1167. exports="$(HOST_EXPORTS)"
  1168. poststage1_exports="$(POSTSTAGE1_HOST_EXPORTS)"
  1169. args="$(EXTRA_HOST_FLAGS)"
  1170. stage1_args="$(STAGE1_FLAGS_TO_PASS)"
  1171. poststage1_args="$(POSTSTAGE1_FLAGS_TO_PASS)" +]
  1172. .PHONY: check-[+module+] maybe-check-[+module+]
  1173. maybe-check-[+module+]:
  1174. @if [+module+]
  1175. maybe-check-[+module+]: check-[+module+]
  1176. [+ IF no_check +]
  1177. check-[+module+]:
  1178. [+ ELIF no_check_cross +]
  1179. # This module is only tested in a native toolchain.
  1180. check-[+module+]:
  1181. @: $(MAKE); $(unstage)
  1182. @if [ '$(host)' = '$(target)' ]; then \
  1183. r=`${PWD_COMMAND}`; export r; \
  1184. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1185. $(HOST_EXPORTS) [+ IF bootstrap +]$(EXTRA_HOST_EXPORTS)[+
  1186. ENDIF bootstrap +] \
  1187. (cd $(HOST_SUBDIR)/[+module+] && \
  1188. $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+][+
  1189. IF bootstrap +] $(EXTRA_BOOTSTRAP_FLAGS)[+ ENDIF bootstrap +] check)
  1190. fi
  1191. [+ ELSE check +]
  1192. check-[+module+]:
  1193. @: $(MAKE); $(unstage)
  1194. @r=`${PWD_COMMAND}`; export r; \
  1195. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1196. $(HOST_EXPORTS) [+ IF bootstrap +]$(EXTRA_HOST_EXPORTS)[+
  1197. ENDIF bootstrap +] \
  1198. (cd $(HOST_SUBDIR)/[+module+] && \
  1199. $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+][+
  1200. IF bootstrap +] $(EXTRA_BOOTSTRAP_FLAGS)[+ ENDIF bootstrap +] check)
  1201. [+ ENDIF no_check +]
  1202. @endif [+module+]
  1203. .PHONY: install-[+module+] maybe-install-[+module+]
  1204. maybe-install-[+module+]:
  1205. @if [+module+]
  1206. maybe-install-[+module+]: install-[+module+]
  1207. [+ IF no_install +]
  1208. install-[+module+]:
  1209. [+ ELSE install +]
  1210. install-[+module+]: installdirs
  1211. @: $(MAKE); $(unstage)
  1212. @r=`${PWD_COMMAND}`; export r; \
  1213. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1214. $(HOST_EXPORTS) \
  1215. (cd $(HOST_SUBDIR)/[+module+] && \
  1216. $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install)
  1217. [+ ENDIF no_install +]
  1218. @endif [+module+]
  1219. .PHONY: install-strip-[+module+] maybe-install-strip-[+module+]
  1220. maybe-install-strip-[+module+]:
  1221. @if [+module+]
  1222. maybe-install-strip-[+module+]: install-strip-[+module+]
  1223. [+ IF no_install +]
  1224. install-strip-[+module+]:
  1225. [+ ELSE install +]
  1226. install-strip-[+module+]: installdirs
  1227. @: $(MAKE); $(unstage)
  1228. @r=`${PWD_COMMAND}`; export r; \
  1229. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1230. $(HOST_EXPORTS) \
  1231. (cd $(HOST_SUBDIR)/[+module+] && \
  1232. $(MAKE) $(FLAGS_TO_PASS) [+extra_make_flags+] install-strip)
  1233. [+ ENDIF no_install +]
  1234. @endif [+module+]
  1235. # Other targets (info, dvi, pdf, etc.)
  1236. [+ FOR recursive_targets +]
  1237. .PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+]
  1238. maybe-[+make_target+]-[+module+]:
  1239. @if [+module+]
  1240. maybe-[+make_target+]-[+module+]: [+make_target+]-[+module+]
  1241. [+ IF (match-value? = "missing" (get "make_target") ) +]
  1242. # [+module+] doesn't support [+make_target+].
  1243. [+make_target+]-[+module+]:
  1244. [+ ELSE +]
  1245. [+make_target+]-[+module+]: [+
  1246. FOR depend +]\
  1247. [+depend+]-[+module+] [+
  1248. ENDFOR depend +]
  1249. @[+ IF bootstrap +][+ ELSE +]: $(MAKE); $(unstage)
  1250. @[+ ENDIF bootstrap +][ -f ./[+module+]/Makefile ] || exit 0; \
  1251. r=`${PWD_COMMAND}`; export r; \
  1252. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1253. $(HOST_EXPORTS) \
  1254. for flag in $(EXTRA_HOST_FLAGS) [+extra_make_flags+]; do \
  1255. eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
  1256. done; \
  1257. echo "Doing [+make_target+] in [+module+]"; \
  1258. (cd $(HOST_SUBDIR)/[+module+] && \
  1259. $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
  1260. "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
  1261. "RANLIB=$${RANLIB}" \
  1262. "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
  1263. [+make_target+]) \
  1264. || exit 1
  1265. [+ ENDIF +]
  1266. @endif [+module+]
  1267. [+ ENDFOR recursive_targets +]
  1268. [+ ENDFOR host_modules +]
  1269. # ---------------------------------------
  1270. # Modules which run on the target machine
  1271. # ---------------------------------------
  1272. [+ FOR target_modules +]
  1273. [+ IF raw_cxx +]
  1274. [+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
  1275. check_multilibs=true
  1276. exports="$(RAW_CXX_TARGET_EXPORTS)"
  1277. host_alias=(get "host" "${target_alias}")
  1278. target_alias=(get "target" "${target_alias}")
  1279. args="$(TARGET_CONFIGARGS)" no-config-site=true +]
  1280. [+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
  1281. exports="$(RAW_CXX_TARGET_EXPORTS)"
  1282. args="$(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'" +]
  1283. [+ ELSE +]
  1284. [+ configure prefix="target-" subdir="$(TARGET_SUBDIR)"
  1285. check_multilibs=true
  1286. exports="$(NORMAL_TARGET_EXPORTS)"
  1287. host_alias=(get "host" "${target_alias}")
  1288. target_alias=(get "target" "${target_alias}")
  1289. args="$(TARGET_CONFIGARGS)" no-config-site=true +]
  1290. [+ all prefix="target-" subdir="$(TARGET_SUBDIR)"
  1291. exports="$(NORMAL_TARGET_EXPORTS)"
  1292. args="$(EXTRA_TARGET_FLAGS)" +]
  1293. [+ ENDIF +]
  1294. .PHONY: check-target-[+module+] maybe-check-target-[+module+]
  1295. maybe-check-target-[+module+]:
  1296. @if target-[+module+]
  1297. maybe-check-target-[+module+]: check-target-[+module+]
  1298. [+ IF no_check +]
  1299. # Dummy target for uncheckable module.
  1300. check-target-[+module+]:
  1301. [+ ELSE check +]
  1302. check-target-[+module+]:
  1303. @: $(MAKE); $(unstage)
  1304. @r=`${PWD_COMMAND}`; export r; \
  1305. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
  1306. IF raw_cxx +]
  1307. $(RAW_CXX_TARGET_EXPORTS) \[+
  1308. ELSE normal_cxx +]
  1309. $(NORMAL_TARGET_EXPORTS) \[+
  1310. ENDIF raw_cxx +]
  1311. (cd $(TARGET_SUBDIR)/[+module+] && \
  1312. $(MAKE) $(TARGET_FLAGS_TO_PASS) [+
  1313. IF raw_cxx
  1314. +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+
  1315. ENDIF raw_cxx
  1316. +] [+extra_make_flags+] check)
  1317. [+ ENDIF no_check +]
  1318. @endif target-[+module+]
  1319. .PHONY: install-target-[+module+] maybe-install-target-[+module+]
  1320. maybe-install-target-[+module+]:
  1321. @if target-[+module+]
  1322. maybe-install-target-[+module+]: install-target-[+module+]
  1323. [+ IF no_install +]
  1324. # Dummy target for uninstallable.
  1325. install-target-[+module+]:
  1326. [+ ELSE install +]
  1327. install-target-[+module+]: installdirs
  1328. @: $(MAKE); $(unstage)
  1329. @r=`${PWD_COMMAND}`; export r; \
  1330. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
  1331. IF raw_cxx +]
  1332. $(RAW_CXX_TARGET_EXPORTS) \[+
  1333. ELSE normal_cxx +]
  1334. $(NORMAL_TARGET_EXPORTS) \[+
  1335. ENDIF raw_cxx +]
  1336. (cd $(TARGET_SUBDIR)/[+module+] && \
  1337. $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install)
  1338. [+ ENDIF no_install +]
  1339. @endif target-[+module+]
  1340. .PHONY: install-strip-target-[+module+] maybe-install-strip-target-[+module+]
  1341. maybe-install-strip-target-[+module+]:
  1342. @if target-[+module+]
  1343. maybe-install-strip-target-[+module+]: install-strip-target-[+module+]
  1344. [+ IF no_install +]
  1345. # Dummy target for uninstallable.
  1346. install-strip-target-[+module+]:
  1347. [+ ELSE install +]
  1348. install-strip-target-[+module+]: installdirs
  1349. @: $(MAKE); $(unstage)
  1350. @r=`${PWD_COMMAND}`; export r; \
  1351. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
  1352. IF raw_cxx +]
  1353. $(RAW_CXX_TARGET_EXPORTS) \[+
  1354. ELSE normal_cxx +]
  1355. $(NORMAL_TARGET_EXPORTS) \[+
  1356. ENDIF raw_cxx +]
  1357. (cd $(TARGET_SUBDIR)/[+module+] && \
  1358. $(MAKE) $(TARGET_FLAGS_TO_PASS) [+extra_make_flags+] install-strip)
  1359. [+ ENDIF no_install +]
  1360. @endif target-[+module+]
  1361. # Other targets (info, dvi, pdf, etc.)
  1362. [+ FOR recursive_targets +]
  1363. .PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+]
  1364. maybe-[+make_target+]-target-[+module+]:
  1365. @if target-[+module+]
  1366. maybe-[+make_target+]-target-[+module+]: [+make_target+]-target-[+module+]
  1367. [+ IF (match-value? = "missing" (get "make_target") ) +]
  1368. # [+module+] doesn't support [+make_target+].
  1369. [+make_target+]-target-[+module+]:
  1370. [+ ELSE +]
  1371. [+make_target+]-target-[+module+]: [+
  1372. FOR depend +]\
  1373. [+depend+]-target-[+module+] [+
  1374. ENDFOR depend +]
  1375. @: $(MAKE); $(unstage)
  1376. @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0; \
  1377. r=`${PWD_COMMAND}`; export r; \
  1378. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \[+
  1379. IF raw_cxx +]
  1380. $(RAW_CXX_TARGET_EXPORTS) \[+
  1381. ELSE normal_cxx +]
  1382. $(NORMAL_TARGET_EXPORTS) \[+
  1383. ENDIF raw_cxx +]
  1384. echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]"; \
  1385. for flag in $(EXTRA_TARGET_FLAGS); do \
  1386. eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
  1387. done; \
  1388. (cd $(TARGET_SUBDIR)/[+module+] && \
  1389. $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
  1390. "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
  1391. "RANLIB=$${RANLIB}" \
  1392. "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
  1393. [+extra_make_flags+] [+make_target+]) \
  1394. || exit 1
  1395. [+ ENDIF +]
  1396. @endif target-[+module+]
  1397. [+ ENDFOR recursive_targets +]
  1398. [+ ENDFOR target_modules +]
  1399. @if target-libgomp
  1400. .PHONY: check-target-libgomp-c++
  1401. check-target-libgomp-c++:
  1402. $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) c++.exp" check-target-libgomp
  1403. .PHONY: check-target-libgomp-fortran
  1404. check-target-libgomp-fortran:
  1405. $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) fortran.exp" check-target-libgomp
  1406. @endif target-libgomp
  1407. @if target-libitm
  1408. .PHONY: check-target-libitm-c++
  1409. check-target-libitm-c++:
  1410. $(MAKE) RUNTESTFLAGS="$(RUNTESTFLAGS) c++.exp" check-target-libitm
  1411. @endif target-libitm
  1412. # ----------
  1413. # GCC module
  1414. # ----------
  1415. @if gcc-no-bootstrap
  1416. .PHONY: cross
  1417. cross: all-build all-gas all-ld
  1418. @r=`${PWD_COMMAND}`; export r; \
  1419. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1420. $(HOST_EXPORTS) \
  1421. echo "Building the C and C++ compiler"; \
  1422. cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++"
  1423. @r=`${PWD_COMMAND}`; export r; \
  1424. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1425. echo "Building runtime libraries"; \
  1426. $(MAKE) $(RECURSE_FLAGS_TO_PASS) LANGUAGES="c c++" all
  1427. @endif gcc-no-bootstrap
  1428. @if gcc
  1429. [+ FOR languages +]
  1430. .PHONY: check-gcc-[+language+] check-[+language+]
  1431. check-gcc-[+language+]:
  1432. r=`${PWD_COMMAND}`; export r; \
  1433. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1434. $(HOST_EXPORTS) \
  1435. (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) [+gcc-check-target+]);
  1436. check-[+language+]: check-gcc-[+language+][+ FOR lib-check-target +] [+ lib-check-target +][+ ENDFOR lib-check-target +]
  1437. [+ ENDFOR languages +]
  1438. # The gcc part of install-no-fixedincludes, which relies on an intimate
  1439. # knowledge of how a number of gcc internal targets (inter)operate. Delegate.
  1440. .PHONY: gcc-install-no-fixedincludes
  1441. gcc-install-no-fixedincludes:
  1442. @if [ -f ./gcc/Makefile ]; then \
  1443. r=`${PWD_COMMAND}`; export r; \
  1444. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1445. $(HOST_EXPORTS) \
  1446. (cd ./gcc \
  1447. && $(MAKE) $(GCC_FLAGS_TO_PASS) install-no-fixedincludes); \
  1448. else true; fi
  1449. @endif gcc
  1450. # ---------------------
  1451. # GCC bootstrap support
  1452. # ---------------------
  1453. # We track the current stage (the one in 'gcc') in the stage_current file.
  1454. # stage_last instead tracks the stage that was built last. These targets
  1455. # are dummy when toplevel bootstrap is not active.
  1456. # While making host and target tools, symlinks to the final stage must be
  1457. # there, so $(unstage) should be run at various points. To avoid excessive
  1458. # recursive invocations of make, we "inline" them using a variable. These
  1459. # must be referenced as ": $(MAKE) ; $(unstage)" rather than "$(unstage)"
  1460. # to avoid warnings from the GNU Make job server.
  1461. unstage = :
  1462. stage = :
  1463. current_stage = ""
  1464. @if gcc-bootstrap
  1465. unstage = if [ -f stage_last ]; then [ -f stage_current ] || $(MAKE) `cat stage_last`-start || exit 1; else :; fi
  1466. stage = if [ -f stage_current ]; then $(MAKE) `cat stage_current`-end || exit 1; else :; fi
  1467. current_stage = "`cat stage_current 2> /dev/null`"
  1468. @endif gcc-bootstrap
  1469. .PHONY: unstage stage
  1470. unstage:
  1471. @: $(MAKE); $(unstage)
  1472. stage:
  1473. @: $(MAKE); $(stage)
  1474. # Disable commands for lean bootstrap.
  1475. LEAN = false
  1476. # We name the build directories for the various stages "stage1-gcc",
  1477. # "stage2-gcc","stage3-gcc", etc.
  1478. # Since the 'compare' process will fail (on debugging information) if any
  1479. # directory names are different, we need to link the gcc directory for
  1480. # the previous stage to a constant name ('prev-gcc'), and to make the name of
  1481. # the build directories constant as well. For the latter, we use naked names
  1482. # like 'gcc', because the scripts in that directory assume it. We use
  1483. # mv on platforms where symlinks to directories do not work or are not
  1484. # reliable.
  1485. # 'touch' doesn't work right on some platforms.
  1486. STAMP = echo timestamp >
  1487. # We only want to compare .o files, so set this!
  1488. objext = .o
  1489. [+ FOR bootstrap-stage +]
  1490. .PHONY: stage[+id+]-start stage[+id+]-end
  1491. stage[+id+]-start::
  1492. @: $(MAKE); $(stage); \
  1493. echo stage[+id+] > stage_current; \
  1494. echo stage[+id+] > stage_last; \
  1495. $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)[+
  1496. FOR host_modules +][+ IF bootstrap +]
  1497. @if [+ module +]
  1498. @cd $(HOST_SUBDIR); [ -d stage[+id+]-[+module+] ] || \
  1499. mkdir stage[+id+]-[+module+]; \
  1500. mv stage[+id+]-[+module+] [+module+][+ IF prev +]; \
  1501. mv stage[+prev+]-[+module+] prev-[+module+] || test -f stage[+prev+]-lean [+ ENDIF prev +]
  1502. @endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
  1503. @[ -d stage[+id+]-$(TARGET_SUBDIR) ] || \
  1504. mkdir stage[+id+]-$(TARGET_SUBDIR); \
  1505. mv stage[+id+]-$(TARGET_SUBDIR) $(TARGET_SUBDIR)[+ IF prev +]; \
  1506. mv stage[+prev+]-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stage[+prev+]-lean [+ ENDIF prev +]
  1507. stage[+id+]-end:: [+ FOR host_modules +][+ IF bootstrap +]
  1508. @if [+ module +]
  1509. @if test -d $(HOST_SUBDIR)/[+module+]; then \
  1510. cd $(HOST_SUBDIR); mv [+module+] stage[+id+]-[+module+][+ IF prev +]; \
  1511. mv prev-[+module+] stage[+prev+]-[+module+]; : [+ ENDIF prev +]; \
  1512. fi
  1513. @endif [+ module +][+ ENDIF bootstrap +][+ ENDFOR host_modules +]
  1514. @if test -d $(TARGET_SUBDIR); then \
  1515. mv $(TARGET_SUBDIR) stage[+id+]-$(TARGET_SUBDIR)[+ IF prev +]; \
  1516. mv prev-$(TARGET_SUBDIR) stage[+prev+]-$(TARGET_SUBDIR); : [+ ENDIF prev +]; \
  1517. fi
  1518. rm -f stage_current
  1519. # Bubble a bug fix through all the stages up to stage [+id+]. They are
  1520. # remade, but not reconfigured. The next stage (if any) will not be
  1521. # reconfigured either.
  1522. .PHONY: stage[+id+]-bubble
  1523. stage[+id+]-bubble:: [+ IF prev +]stage[+prev+]-bubble[+ ENDIF +]
  1524. @r=`${PWD_COMMAND}`; export r; \
  1525. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1526. if test -f stage[+id+]-lean [+
  1527. IF prev +]|| test -f stage[+prev+]-lean [+ ENDIF prev +]; then \
  1528. echo Skipping rebuild of stage[+id+]; \
  1529. else \
  1530. $(MAKE) stage[+id+]-start; \[+IF lean +]
  1531. if $(LEAN); then \
  1532. rm -rf stage[+lean+]-*; \
  1533. $(STAMP) stage[+lean+]-lean; \
  1534. fi; \[+ ENDIF lean +]
  1535. $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stage[+id+]; \
  1536. fi[+ IF compare-target +]
  1537. $(MAKE) $(RECURSE_FLAGS_TO_PASS) [+compare-target+][+ ENDIF compare-target +]
  1538. .PHONY: all-stage[+id+] clean-stage[+id+]
  1539. do-clean: clean-stage[+id+]
  1540. # FIXME: Will not need to be conditional when toplevel bootstrap is the
  1541. # only possibility, but now it conflicts with no-bootstrap rules
  1542. @if gcc-bootstrap
  1543. [+ IF compare-target +]
  1544. [+compare-target+]:
  1545. @r=`${PWD_COMMAND}`; export r; \
  1546. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1547. if test -f stage[+prev+]-lean; then \
  1548. echo Cannot compare object files as stage [+prev+] was deleted.; \
  1549. exit 0; \
  1550. fi; \
  1551. : $(MAKE); $(stage); \
  1552. rm -f .bad_compare; \
  1553. echo Comparing stages [+prev+] and [+id+]; \
  1554. sed=`echo stage[+id+] | sed 's,^stage,,;s,.,.,g'`; \
  1555. files=`find stage[+id+]-* -name "*$(objext)" -print | \
  1556. sed -n s,^stage$$sed-,,p`; \
  1557. for file in $${files} ${extra-compare}; do \
  1558. f1=$$r/stage[+prev+]-$$file; f2=$$r/stage[+id+]-$$file; \
  1559. if test ! -f $$f1; then continue; fi; \
  1560. $(do-[+compare-target+]) > /dev/null 2>&1; \
  1561. if test $$? -eq 1; then \
  1562. case $$file in \
  1563. @compare_exclusions@) \
  1564. echo warning: $$file differs ;; \
  1565. *) \
  1566. echo $$file differs >> .bad_compare ;; \
  1567. esac; \
  1568. fi; \
  1569. done; \
  1570. if [ -f .bad_compare ]; then \
  1571. echo "Bootstrap comparison failure!"; \
  1572. cat .bad_compare; \
  1573. exit 1; \
  1574. else \
  1575. echo Comparison successful.; \
  1576. fi; \
  1577. $(STAMP) [+compare-target+][+ IF prev +]
  1578. if $(LEAN); then \
  1579. rm -rf stage[+prev+]-*; \
  1580. $(STAMP) stage[+prev+]-lean; \
  1581. fi[+ ENDIF prev +]
  1582. [+ ENDIF compare-target +]
  1583. [+ IF bootstrap-target +]
  1584. .PHONY: [+bootstrap-target+] [+bootstrap-target+]-lean
  1585. [+bootstrap-target+]:
  1586. echo stage[+id+] > stage_final
  1587. @r=`${PWD_COMMAND}`; export r; \
  1588. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1589. $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble
  1590. @: $(MAKE); $(unstage)
  1591. @r=`${PWD_COMMAND}`; export r; \
  1592. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1593. TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
  1594. $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
  1595. [+bootstrap-target+]-lean:
  1596. echo stage[+id+] > stage_final
  1597. @r=`${PWD_COMMAND}`; export r; \
  1598. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1599. $(MAKE) $(RECURSE_FLAGS_TO_PASS) LEAN=: stage[+id+]-bubble
  1600. @: $(MAKE); $(unstage)
  1601. @r=`${PWD_COMMAND}`; export r; \
  1602. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1603. TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
  1604. $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
  1605. [+ ENDIF bootstrap-target +]
  1606. # Rules to wipe a stage and all the following ones, also used for cleanstrap
  1607. [+ IF prev +]distclean-stage[+prev+]:: distclean-stage[+id+] [+ ENDIF prev +]
  1608. .PHONY: distclean-stage[+id+]
  1609. distclean-stage[+id+]::
  1610. @: $(MAKE); $(stage)
  1611. @test "`cat stage_last`" != stage[+id+] || rm -f stage_last
  1612. rm -rf stage[+id+]-* [+
  1613. IF compare-target +][+compare-target+] [+ ENDIF compare-target +]
  1614. [+ IF cleanstrap-target +]
  1615. .PHONY: [+cleanstrap-target+]
  1616. [+cleanstrap-target+]: do-distclean local-clean
  1617. echo stage[+id+] > stage_final
  1618. @r=`${PWD_COMMAND}`; export r; \
  1619. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1620. $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage[+id+]-bubble
  1621. @: $(MAKE); $(unstage)
  1622. @r=`${PWD_COMMAND}`; export r; \
  1623. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1624. TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
  1625. $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
  1626. [+ ENDIF cleanstrap-target +]
  1627. @endif gcc-bootstrap
  1628. [+ ENDFOR bootstrap-stage +]
  1629. stageprofile-end::
  1630. $(MAKE) distclean-stagefeedback
  1631. stagefeedback-start::
  1632. @r=`${PWD_COMMAND}`; export r; \
  1633. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1634. for i in prev-*; do \
  1635. j=`echo $$i | sed s/^prev-//`; \
  1636. cd $$r/$$i && \
  1637. { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../'$$j'/&",' | $(SHELL); } && \
  1638. { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../'$$j'/&",' | $(SHELL); }; \
  1639. done
  1640. @if gcc-bootstrap
  1641. do-distclean: distclean-stage1
  1642. # Provide a GCC build when we're building target libraries. This does
  1643. # not work as a dependency, just as the minimum necessary to avoid errors.
  1644. stage_last:
  1645. @r=`${PWD_COMMAND}`; export r; \
  1646. s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
  1647. $(MAKE) $(RECURSE_FLAGS_TO_PASS) stage1-bubble
  1648. # Same as unstage, but not phony and defaulting to stage1-start. We place
  1649. # it in the dependency so that for example `make -j3 all-gcc' works.
  1650. stage_current:
  1651. @if test -f stage_last; then $(unstage); else $(MAKE) stage1-start; fi
  1652. .PHONY: restrap
  1653. restrap::
  1654. @: $(MAKE); $(stage)
  1655. rm -rf stage1-$(TARGET_SUBDIR)[+ FOR bootstrap-stage +][+ IF prev
  1656. +] stage[+id+]-*[+ ENDIF prev +][+ ENDFOR bootstrap-stage +]
  1657. restrap:: all
  1658. @endif gcc-bootstrap
  1659. # --------------------------------------
  1660. # Dependencies between different modules
  1661. # --------------------------------------
  1662. # Generic dependencies for target modules on host stuff, especially gcc
  1663. @if gcc-bootstrap[+ FOR target_modules +][+ IF bootstrap
  1664. +][+ FOR bootstrap_stage +]
  1665. configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-gcc[+
  1666. ENDFOR +][+ ELSE bootstrap +]
  1667. configure-target-[+module+]: stage_last[+
  1668. ENDIF bootstrap +][+ ENDFOR target_modules +]
  1669. @endif gcc-bootstrap
  1670. @if gcc-no-bootstrap[+ FOR target_modules +]
  1671. configure-target-[+module+]: maybe-all-gcc[+
  1672. ENDFOR target_modules +]
  1673. @endif gcc-no-bootstrap
  1674. # There are two types of dependencies here: 'hard' dependencies, where one
  1675. # module simply won't build without the other; and 'soft' dependencies, where
  1676. # if the depended-on module is missing, the depending module will do without
  1677. # or find a substitute somewhere (perhaps installed). Soft dependencies
  1678. # are made here to depend on a 'maybe-' target. If you're not sure,
  1679. # it's safer to use a soft dependency.
  1680. [+ ;; These Scheme functions build the bulk of the dependencies.
  1681. ;; dep-target builds a string like "maybe-all-MODULE_KIND-gcc",
  1682. ;; where "maybe-" is only included if HARD is not true, and all-gcc
  1683. ;; is taken from VAR-NAME.
  1684. (define dep-target (lambda (module-kind var-name hard)
  1685. (string-append
  1686. (if hard "" "maybe-")
  1687. (dep-subtarget var-name)
  1688. module-kind
  1689. (dep-module var-name)
  1690. )))
  1691. ;; make-dep builds a dependency from the MODULE and ON AutoGen vars.
  1692. (define make-dep (lambda (module-kind on-kind)
  1693. (string-append
  1694. (dep-target module-kind "module" #t) ": "
  1695. (dep-target on-kind "on" (exist? "hard")))))
  1696. ;; dep-subtarget extracts everything up to the first dash in the given
  1697. ;; AutoGen variable, for example it extracts "all-" out of "all-gcc".
  1698. (define dep-subtarget (lambda (var-name)
  1699. (substring (get var-name) 0 (+ 1 (string-index (get var-name) #\-)))))
  1700. ;; dep-module extracts everything up to the first dash in the given
  1701. ;; AutoGen variable, for example it extracts "gcc" out of "all-gcc".
  1702. (define dep-module (lambda (var-name)
  1703. (substring (get var-name) (+ 1 (string-index (get var-name) #\-)))))
  1704. ;; dep-stage builds a string for the prefix of a bootstrap stage.
  1705. (define dep-stage (lambda ()
  1706. (string-append
  1707. "stage"
  1708. (get "id")
  1709. "-")))
  1710. ;; dep-maybe is the same as the AutoGen expression "- hard 'maybe-'"
  1711. ;; but is written in Scheme.
  1712. (define dep-maybe (lambda ()
  1713. (if (exist? "hard") "" "maybe-")))
  1714. ;; dep-kind returns returns "prebootstrap" for configure or build
  1715. ;; dependencies of bootstrapped modules on a build module
  1716. ;; (e.g. all-gcc on all-build-bison); "normal" if the dependency is
  1717. ;; on an "install" target, or if the dependence module is not
  1718. ;; bootstrapped; otherwise, it returns "bootstrap" or
  1719. ;; "postbootstrap" depending on whether the dependent module is
  1720. ;; bootstrapped. All this is only necessary for host and target
  1721. ;; modules. It might seem like, in order to avoid build races, we
  1722. ;; might need more elaborate detection between prebootstrap and
  1723. ;; postbootstrap modules, but there are no host prebootstrap
  1724. ;; modules. If there were any non-bootstrap host modules that
  1725. ;; bootstrap modules depended on, we'd get unsatisfied per-stage
  1726. ;; dependencies on them, which would be immediately noticed.
  1727. (define dep-kind (lambda ()
  1728. (cond
  1729. ((and (hash-ref boot-modules (dep-module "module"))
  1730. (=* (dep-module "on") "build-"))
  1731. "prebootstrap")
  1732. ((or (= (dep-subtarget "on") "install-")
  1733. (not (hash-ref boot-modules (dep-module "on"))))
  1734. "normal")
  1735. ((hash-ref boot-modules (dep-module "module"))
  1736. "bootstrap")
  1737. (1 "postbootstrap"))))
  1738. (define make-postboot-dep (lambda ()
  1739. (let ((target (dep-module "module")) (dep "stage_last"))
  1740. (unless (= (hash-ref postboot-targets target) dep)
  1741. (hash-create-handle! postboot-targets target dep)
  1742. ;; All non-bootstrap modules' configure target already
  1743. ;; depend on dep.
  1744. (unless (=* target "target-")
  1745. (string-append "configure-" target ": " dep "\n"))))))
  1746. ;; We now build the hash table that is used by dep-kind.
  1747. (define boot-modules (make-hash-table 113))
  1748. (define postboot-targets (make-hash-table 113))
  1749. +]
  1750. [+ FOR host_modules +][+
  1751. (if (exist? "bootstrap")
  1752. (hash-create-handle! boot-modules (get "module") #t))
  1753. "" +][+ ENDFOR host_modules +]
  1754. [+ FOR target_modules +][+
  1755. (if (exist? "bootstrap")
  1756. (hash-create-handle! boot-modules (string-append "target-" (get "module")) #t))
  1757. "" +][+ ENDFOR target_modules +]
  1758. # With all the machinery above in place, it is pretty easy to generate
  1759. # dependencies. Host dependencies are a bit more complex because we have
  1760. # to check for bootstrap/prebootstrap dependencies. To resolve
  1761. # prebootstrap dependencies, prebootstrap modules are gathered in
  1762. # a hash table.
  1763. [+ FOR dependencies +][+ CASE (dep-kind) +]
  1764. [+ == "prebootstrap" +][+ (make-dep "" "") +][+ FOR bootstrap_stage +]
  1765. [+ (make-dep (dep-stage) "") +][+ ENDFOR bootstrap_stage +]
  1766. [+ == "bootstrap" +][+ (make-dep "" "") +][+ FOR bootstrap_stage +]
  1767. [+ (make-dep (dep-stage) (dep-stage)) +][+ ENDFOR bootstrap_stage +]
  1768. [+ == "normal" +][+ (make-dep "" "") +]
  1769. [+ ESAC +][+ ENDFOR dependencies +]
  1770. @if gcc-bootstrap
  1771. [+ FOR dependencies +][+ CASE (dep-kind) +]
  1772. [+ == "postbootstrap" +][+ (make-postboot-dep) +][+ ESAC +][+
  1773. ENDFOR dependencies +]@endif gcc-bootstrap
  1774. @unless gcc-bootstrap
  1775. [+ FOR dependencies +][+ CASE (dep-kind) +]
  1776. [+ == "postbootstrap" +][+ (make-dep "" "") +]
  1777. [+ ESAC +][+ ENDFOR dependencies +]@endunless gcc-bootstrap
  1778. # Dependencies for target modules on other target modules are
  1779. # described by lang_env_dependencies; the defaults apply to anything
  1780. # not mentioned there.
  1781. [+
  1782. ;; Predicate for whether LANG was specified in lang_env_dependencies.
  1783. (define lang-dep (lambda (lang)
  1784. (hash-ref lang-env-deps (string-append (get "module") "-" lang))))
  1785. ;; Build the hash table we will need.
  1786. (define lang-env-deps (make-hash-table 7))
  1787. +][+ FOR lang_env_dependencies +][+
  1788. (if (exist? "cxx")
  1789. (hash-create-handle! lang-env-deps
  1790. (string-append (get "module") "-" "cxx") #t))
  1791. (if (exist? "no_c")
  1792. (hash-create-handle! lang-env-deps
  1793. (string-append (get "module") "-" "no_c") #t))
  1794. (if (exist? "no_gcc")
  1795. (hash-create-handle! lang-env-deps
  1796. (string-append (get "module") "-" "no_gcc") #t))
  1797. "" +][+ ENDFOR lang_env_dependencies +]
  1798. @if gcc-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc"))
  1799. +][+ IF bootstrap +][+ FOR bootstrap_stage +]
  1800. configure-stage[+id+]-target-[+module+]: maybe-all-stage[+id+]-target-libgcc[+
  1801. ENDFOR +][+ ENDIF bootstrap +][+ ENDIF +][+ ENDFOR target_modules +]
  1802. @endif gcc-bootstrap
  1803. @if gcc-no-bootstrap[+ FOR target_modules +][+ IF (not (lang-dep "no_gcc")) +]
  1804. configure-target-[+module+]: maybe-all-target-libgcc[+
  1805. ENDIF +][+ ENDFOR target_modules +]
  1806. @endif gcc-no-bootstrap
  1807. [+ FOR target_modules +][+ IF (not (lang-dep "no_c")) +]
  1808. configure-target-[+module+]: maybe-all-target-newlib maybe-all-target-libgloss[+
  1809. ENDIF +][+ IF (lang-dep "cxx") +]
  1810. configure-target-[+module+]: maybe-all-target-libstdc++-v3[+
  1811. ENDIF +]
  1812. [+ ENDFOR target_modules +]
  1813. CONFIGURE_GDB_TK = @CONFIGURE_GDB_TK@
  1814. GDB_TK = @GDB_TK@
  1815. INSTALL_GDB_TK = @INSTALL_GDB_TK@
  1816. configure-gdb: $(CONFIGURE_GDB_TK)
  1817. all-gdb: $(gdbnlmrequirements) $(GDB_TK)
  1818. install-gdb: $(INSTALL_GDB_TK)
  1819. # Serialization dependencies. Host configures don't work well in parallel to
  1820. # each other, due to contention over config.cache. Target configures and
  1821. # build configures are similar.
  1822. @serialization_dependencies@
  1823. # --------------------------------
  1824. # Regenerating top level configury
  1825. # --------------------------------
  1826. # Rebuilding Makefile.in, using autogen.
  1827. AUTOGEN = autogen
  1828. $(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def
  1829. cd $(srcdir) && $(AUTOGEN) Makefile.def
  1830. # Rebuilding Makefile.
  1831. Makefile: $(srcdir)/Makefile.in config.status
  1832. CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
  1833. config.status: configure
  1834. CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck
  1835. # Rebuilding configure.
  1836. AUTOCONF = autoconf
  1837. $(srcdir)/configure: @MAINT@ $(srcdir)/configure.ac $(srcdir)/config/acx.m4 \
  1838. $(srcdir)/config/override.m4 $(srcdir)/config/proginstall.m4 \
  1839. $(srcdir)/config/elf.m4 $(srcdir)/config/isl.m4 \
  1840. $(srcdir)/config/gcc-plugin.m4 \
  1841. $(srcdir)/libtool.m4 $(srcdir)/ltoptions.m4 $(srcdir)/ltsugar.m4 \
  1842. $(srcdir)/ltversion.m4 $(srcdir)/lt~obsolete.m4
  1843. cd $(srcdir) && $(AUTOCONF)
  1844. # ------------------------------
  1845. # Special directives to GNU Make
  1846. # ------------------------------
  1847. # Don't pass command-line variables to submakes.
  1848. .NOEXPORT:
  1849. MAKEOVERRIDES=
  1850. # end of Makefile.in